diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-18 12:47:06 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-18 12:47:06 +0000 |
commit | e76b7ccb860b7ffcd86a42af8eecfe30f96493fa (patch) | |
tree | a8e100dee1e9e0952eb2f5566031734b7f874791 | |
parent | 845eafddb09e9a28b45b502abb544df1e286a324 (diff) |
fix gl error of 'invalid enum' from GL_COLOR_TABLE
Committed on behalf of Guanqun.Lu@gmail.com
Review URL: http://codereview.appspot.com/6300106/
git-svn-id: http://skia.googlecode.com/svn/trunk@4272 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 5 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 4 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 7b2bb35ead..ec125b7712 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -34,6 +34,7 @@ void GrGLCaps::reset() { fTextureUsageSupport = false; fTexStorageSupport = false; fTextureRedSupport = false; + fImagingSupport = false; } GrGLCaps::GrGLCaps(const GrGLCaps& caps) { @@ -61,6 +62,7 @@ GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { fTextureUsageSupport = caps.fTextureUsageSupport; fTexStorageSupport = caps.fTexStorageSupport; fTextureRedSupport = caps.fTextureRedSupport; + fImagingSupport = caps.fImagingSupport; return *this; } @@ -146,6 +148,9 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo) { fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg"); } + fImagingSupport = kDesktop_GrGLBinding == binding && + ctxInfo.hasExtension("GL_ARB_imaging"); + this->initFSAASupport(ctxInfo); this->initStencilFormats(ctxInfo); } diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h index 70f17bd9ec..ec75a53428 100644 --- a/src/gpu/gl/GrGLCaps.h +++ b/src/gpu/gl/GrGLCaps.h @@ -211,6 +211,9 @@ public: /// Is there support for GL_RED and GL_R8 bool textureRedSupport() const { return fTextureRedSupport; } + /// Is GL_ARB_IMAGING supported + bool imagingSupport() const { return fImagingSupport; } + private: /** * Maintains a bit per GrPixelConfig. It is used to avoid redundantly @@ -281,6 +284,7 @@ private: bool fTextureUsageSupport : 1; bool fTexStorageSupport : 1; bool fTextureRedSupport : 1; + bool fImagingSupport : 1; }; #endif diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 6549e050f1..dd65394a33 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -468,7 +468,9 @@ void GrGpuGL::onResetContext() { 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)); + if (this->glCaps().imagingSupport()) { + 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 |