diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-21 20:14:29 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-21 20:14:29 +0000 |
commit | 469d0dd944833444a363591be1ee6a76bdecf96d (patch) | |
tree | 3c3bc1bbe1cffd865adca2d9657f39938924c6e2 /src/gpu | |
parent | 1f1db4cc5b62fc74efc01a4c92cbc1f7bddce241 (diff) |
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
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/gl/GrGLDefines.h | 8 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 19 |
2 files changed, 23 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h index d63a166632..7bd1f02591 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 341675bc18..02ff78e5ec 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -464,9 +464,22 @@ void GrGpuGL::onResetContext() { 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 @@ void GrGpuGL::onResetContext() { fHWGeometryState.fArrayPtrsDirty = true; - GL_CALL(ColorMask(GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE)); - fHWBoundRenderTarget = NULL; // we assume these values |