Bumped num stages to 4 in preparation for AA clipping

http://codereview.appspot.com/6135046/



git-svn-id: http://skia.googlecode.com/svn/trunk@3783 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 270912e..63bc15a 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -38,7 +38,7 @@
      * or not.
      */
     enum {
-        kNumStages = 3,
+        kNumStages = 4,
         kMaxTexCoords = kNumStages
     };
 
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 3e3ff51..c5dd3ec 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -75,26 +75,30 @@
 
 /* These values were generated by the above function */
 const GrVertexLayout gStageTexCoordMasks[] = {
-    0x49,
-    0x92,
-    0x124
+    0x1111,
+    0x2222,
+    0x4444,
+    0x8888,
 };
-
 GR_STATIC_ASSERT(GrDrawState::kNumStages == GR_ARRAY_COUNT(gStageTexCoordMasks));
-const GrVertexLayout gStageMasks[] = {
-    0x249,
-    0x492,
-    0x924
-};
 
+const GrVertexLayout gStageMasks[] = {
+    0x11111,
+    0x22222,
+    0x44444,
+    0x88888,
+};
 GR_STATIC_ASSERT(GrDrawState::kNumStages == GR_ARRAY_COUNT(gStageMasks));
+
 const GrVertexLayout gTexCoordMasks[] = {
-    0x7,
-    0x38,
-    0x1c0,
+    0xf,
+    0xf0,
+    0xf00,
+    0xf000,
 };
 GR_STATIC_ASSERT(GrDrawState::kMaxTexCoords == GR_ARRAY_COUNT(gTexCoordMasks));
 
+
 bool check_layout(GrVertexLayout layout) {
     // can only have 1 or 0 bits set for each stage.
     for (int s = 0; s < GrDrawState::kNumStages; ++s) {
@@ -1291,3 +1295,4 @@
     GrPrintf("Max Render Target Size      : %d\n", fMaxRenderTargetSize);
 }
 
+
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp
index 7fd4d0d..1a01d92 100644
--- a/src/gpu/gl/GrGLCreateNullInterface.cpp
+++ b/src/gpu/gl/GrGLCreateNullInterface.cpp
@@ -275,9 +275,6 @@
         case GR_GL_MAX_VERTEX_ATTRIBS:
             *params = 16;
             break;
-        case GR_GL_MAX_TEXTURE_UNITS:
-            *params = 8;
-            break;
         default:
             GrCrash("Unexpected pname to GetIntegerv");
     }
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 9abd01c..3b5fffe 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -230,10 +230,6 @@
     const GrGLInterface* gl = this->glInterface();
     GR_GL_GetIntegerv(gl, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
     GrAssert(maxTextureUnits > GrDrawState::kNumStages);
-    if (kES2_GrGLBinding != this->glBinding()) {
-        GR_GL_GetIntegerv(gl, GR_GL_MAX_TEXTURE_UNITS, &maxTextureUnits);
-        GrAssert(maxTextureUnits > GrDrawState::kNumStages);
-    }
 
     GrGLint numFormats;
     GR_GL_GetIntegerv(gl, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats);
diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
index 120381e..685e18d 100644
--- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
+++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
@@ -758,9 +758,6 @@
         case GR_GL_MAX_VARYING_VECTORS:
             *params = kDefaultMaxVaryingVectors;
             break;
-        case GR_GL_MAX_TEXTURE_UNITS:
-            *params = GrDebugGL::getInstance()->getMaxTextureUnits();
-            break;
         default:
             GrCrash("Unexpected pname to GetIntegerv");
     }