When GL context is reset set some desktop-only GL state to values that we assume later.
 
Review URL: http://codereview.appspot.com/6222052/



git-svn-id: http://skia.googlecode.com/svn/trunk@4018 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h
index d63a166..7bd1f02 100644
--- a/src/gpu/gl/GrGLDefines.h
+++ b/src/gpu/gl/GrGLDefines.h
@@ -129,6 +129,14 @@
 #define GR_GL_POLYGON_OFFSET_FILL            0x8037
 #define GR_GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
 #define GR_GL_SAMPLE_COVERAGE                0x80A0
+#define GR_GL_POLYGON_OFFSET_FILL            0x8037
+#define GR_GL_POLYGON_SMOOTH                 0x0B41
+#define GR_GL_POLYGON_STIPPLE                0x0B42
+#define GR_GL_COLOR_LOGIC_OP                 0x0BF2
+#define GR_GL_COLOR_TABLE                    0x80D0
+#define GR_GL_INDEX_LOGIC_OP                 0x0BF1
+#define GR_GL_VERTEX_PROGRAM_POINT_SIZE      0x8642
+#define GR_GL_LINE_STIPPLE                   0x0B24
 
 /* ErrorCode */
 #define GR_GL_NO_ERROR                       0
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 341675b..02ff78e 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -464,9 +464,22 @@
     fHWDitherEnabled = kUnknown_TriState;
 
     if (kDesktop_GrGLBinding == this->glBinding()) {
-        // we never use point or polygon smoothing
-        // should we also disable polygon smoothing?
+        // Desktop-only state that we never change
         GL_CALL(Disable(GR_GL_POINT_SMOOTH));
+        GL_CALL(Disable(GR_GL_LINE_SMOOTH));
+        GL_CALL(Disable(GR_GL_POLYGON_SMOOTH));
+        GL_CALL(Disable(GR_GL_POLYGON_STIPPLE));
+        GL_CALL(Disable(GR_GL_COLOR_LOGIC_OP));
+        GL_CALL(Disable(GR_GL_COLOR_TABLE));
+        GL_CALL(Disable(GR_GL_INDEX_LOGIC_OP));
+        GL_CALL(Disable(GR_GL_POLYGON_OFFSET_FILL));
+        // Since ES doesn't support glPointSize at all we always use the VS to
+        // set the point size
+        GL_CALL(Enable(GR_GL_VERTEX_PROGRAM_POINT_SIZE));
+
+        // We should set glPolygonMode(FRONT_AND_BACK,FILL) here, too. It isn't
+        // currently part of our gl interface. There are probably others as 
+        // well.
     }
     fHWAAState.invalidate();
     fHWWriteToColor = kUnknown_TriState;
@@ -507,8 +520,6 @@
     
     fHWGeometryState.fArrayPtrsDirty = true;
 
-    GL_CALL(ColorMask(GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE));
-
     fHWBoundRenderTarget = NULL;
 
     // we assume these values