move more stuff that should be private out from GrGLConfig.h
Review URL: http://codereview.appspot.com/6202053/
git-svn-id: http://skia.googlecode.com/svn/trunk@3856 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGpuGLShaders.cpp b/src/gpu/gl/GrGpuGLShaders.cpp
index 1fcfbbe..f381564 100644
--- a/src/gpu/gl/GrGpuGLShaders.cpp
+++ b/src/gpu/gl/GrGpuGLShaders.cpp
@@ -843,6 +843,19 @@
void GrGpuGLShaders::postDraw() {
}
+#if GR_TEXT_SCALAR_IS_USHORT
+ #define TEXT_COORDS_GL_TYPE GR_GL_UNSIGNED_SHORT
+ #define TEXT_COORDS_ARE_NORMALIZED 1
+#elif GR_TEXT_SCALAR_IS_FLOAT
+ #define TEXT_COORDS_GL_TYPE GR_GL_FLOAT
+ #define TEXT_COORDS_ARE_NORMALIZED 0
+#elif GR_TEXT_SCALAR_IS_FIXED
+ #define TEXT_COORDS_GL_TYPE GR_GL_FIXED
+ #define TEXT_COORDS_ARE_NORMALIZED 0
+#else
+ #error "unknown GR_TEXT_SCALAR type"
+#endif
+
void GrGpuGLShaders::setupGeometry(int* startVertex,
int* startIndex,
int vertexCount,
@@ -881,10 +894,11 @@
GrGLenum scalarType;
bool texCoordNorm;
if (currLayout & kTextFormat_VertexLayoutBit) {
- scalarType = GrGLTextType;
- texCoordNorm = GR_GL_TEXT_TEXTURE_NORMALIZED;
+ scalarType = TEXT_COORDS_GL_TYPE;
+ texCoordNorm = SkToBool(TEXT_COORDS_ARE_NORMALIZED);
} else {
- scalarType = GrGLType;
+ GR_STATIC_ASSERT(GR_SCALAR_IS_FLOAT);
+ scalarType = GR_GL_FLOAT;
texCoordNorm = false;
}
@@ -902,7 +916,7 @@
// position and tex coord offsets change if above conditions are true
// or the type/normalization changed based on text vs nontext type coords.
bool posAndTexChange = allOffsetsChange ||
- (((GrGLTextType != GrGLType) || GR_GL_TEXT_TEXTURE_NORMALIZED) &&
+ (((TEXT_COORDS_GL_TYPE != GR_GL_FLOAT) || TEXT_COORDS_ARE_NORMALIZED) &&
(kTextFormat_VertexLayoutBit &
(fHWGeometryState.fVertexLayout ^ currLayout)));