Add bit to GrGLCaps for fixed function support

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://chromiumcodereview.appspot.com/23587014

git-svn-id: http://skia.googlecode.com/svn/trunk/src@11043 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/gl/GrGLCaps.cpp b/gpu/gl/GrGLCaps.cpp
index a6740cc..382bfba 100644
--- a/gpu/gl/GrGLCaps.cpp
+++ b/gpu/gl/GrGLCaps.cpp
@@ -47,6 +47,7 @@
     fVertexArrayObjectSupport = false;
     fUseNonVBOVertexAndIndexDynamicData = false;
     fIsCoreProfile = false;
+    fFixedFunctionSupport = false;
     fDiscardFBSupport = false;
 }
 
@@ -84,6 +85,7 @@
     fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport;
     fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicData;
     fIsCoreProfile = caps.fIsCoreProfile;
+    fFixedFunctionSupport = caps.fFixedFunctionSupport;
     fDiscardFBSupport = caps.fDiscardFBSupport;
 
     return *this;
@@ -117,6 +119,7 @@
             fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT);
         }
         if (!fIsCoreProfile) {
+            fFixedFunctionSupport = true;
             GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_COORDS, &fMaxFixedFunctionTextureCoords);
             // Sanity check
             SkASSERT(fMaxFixedFunctionTextureCoords > 0 && fMaxFixedFunctionTextureCoords < 128);
@@ -589,9 +592,15 @@
     GR_STATIC_ASSERT(GR_ARRAY_COUNT(kFBFetchTypeStr) == kLast_FBFetchType + 1);
 
 
+    GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO"));
+    GrPrintf("Fixed Function Support: %s\n", (fFixedFunctionSupport ? "YES" : "NO"));
     GrPrintf("MSAA Type: %s\n", kMSFBOExtStr[fMSFBOType]);
     GrPrintf("FB Fetch Type: %s\n", kFBFetchTypeStr[fFBFetchType]);
     GrPrintf("Max FS Uniform Vectors: %d\n", fMaxFragmentUniformVectors);
+    GrPrintf("Max FS Texture Units: %d\n", fMaxFragmentTextureUnits);
+    if (fFixedFunctionSupport) {
+        GrPrintf("Max Fixed Function Texture Coords: %d\n", fMaxFixedFunctionTextureCoords);
+    }
     GrPrintf("Max Vertex Attributes: %d\n", fMaxVertexAttributes);
     GrPrintf("Support RGBA8 Render Buffer: %s\n", (fRGBA8RenderbufferSupport ? "YES": "NO"));
     GrPrintf("BGRA support: %s\n", (fBGRAFormatSupport ? "YES": "NO"));
@@ -612,6 +621,5 @@
     GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
     GrPrintf("Use non-VBO for dynamic data: %s\n",
              (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
-    GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO"));
     GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "NO"));
 }
diff --git a/gpu/gl/GrGLCaps.h b/gpu/gl/GrGLCaps.h
index 79251b2..a4d5673 100644
--- a/gpu/gl/GrGLCaps.h
+++ b/gpu/gl/GrGLCaps.h
@@ -282,6 +282,8 @@
 
     bool isCoreProfile() const { return fIsCoreProfile; }
 
+    bool fixedFunctionSupport() const { return fFixedFunctionSupport; }
+
     /// Is there support for discarding the frame buffer
     bool discardFBSupport() const { return fDiscardFBSupport; }
 
@@ -364,6 +366,7 @@
     bool fVertexArrayObjectSupport : 1;
     bool fUseNonVBOVertexAndIndexDynamicData : 1;
     bool fIsCoreProfile : 1;
+    bool fFixedFunctionSupport : 1;
     bool fDiscardFBSupport : 1;
 
     typedef GrDrawTargetCaps INHERITED;
diff --git a/gpu/gl/GrGpuGL.cpp b/gpu/gl/GrGpuGL.cpp
index 94a1306..28e41af 100644
--- a/gpu/gl/GrGpuGL.cpp
+++ b/gpu/gl/GrGpuGL.cpp
@@ -364,9 +364,7 @@
         fHWBoundRenderTarget = NULL;
     }
 
-    if (resetBits & kFixedFunction_GrGLBackendState &&
-        kDesktop_GrGLBinding == this->glBinding() &&
-        !this->glCaps().isCoreProfile()) {
+    if (resetBits & kFixedFunction_GrGLBackendState && this->glCaps().fixedFunctionSupport()) {
 
         fHWProjectionMatrixState.invalidate();
         // we don't use the model view matrix.