diff options
author | 2012-04-30 19:02:08 +0000 | |
---|---|---|
committer | 2012-04-30 19:02:08 +0000 | |
commit | 0048469578b15aae90f1427895ef6186f00ac7bf (patch) | |
tree | fd1e808fb1e6757c27bbfd06322b705f123bfbd6 /src/gpu/gl/GrGpuGL.cpp | |
parent | 8790fc635e5a9f24d1fa6291449efe436324fefd (diff) |
Roll back http://code.google.com/p/skia/source/detail?r=3622 to deal with http://crbug.com/125596 ('M20 windows renderer stability maze')
git-svn-id: http://skia.googlecode.com/svn/trunk@3800 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGpuGL.cpp')
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 3b5fffe7ef..5f8772e6e5 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -322,8 +322,7 @@ void GrGpuGL::fillInConfigRenderableTable() { } } else { // On ES we can only hope for R8 - fConfigRenderSupport[kAlpha_8_GrPixelConfig] = - this->glCaps().textureRedSupport(); + fConfigRenderSupport[kAlpha_8_GrPixelConfig] = false; } if (kDesktop_GrGLBinding != this->glBinding()) { @@ -2044,20 +2043,12 @@ unsigned gr_to_gl_filter(GrSamplerState::Filter filter) { } } -// get_swizzle is only called from this .cpp so it is OK to inline it here -inline const GrGLenum* get_swizzle(GrPixelConfig config, - const GrSamplerState& sampler, - const GrGLCaps& glCaps) { +const GrGLenum* get_swizzle(GrPixelConfig config, + const GrSamplerState& sampler) { if (GrPixelConfigIsAlphaOnly(config)) { - if (glCaps.textureRedSupport()) { - static const GrGLenum gRedSmear[] = { GR_GL_RED, GR_GL_RED, - GR_GL_RED, GR_GL_RED }; - return gRedSmear; - } else { - static const GrGLenum gAlphaSmear[] = { GR_GL_ALPHA, GR_GL_ALPHA, - GR_GL_ALPHA, GR_GL_ALPHA }; - return gAlphaSmear; - } + static const GrGLenum gAlphaSmear[] = { GR_GL_ALPHA, GR_GL_ALPHA, + GR_GL_ALPHA, GR_GL_ALPHA }; + return gAlphaSmear; } else if (sampler.swapsRAndB()) { static const GrGLenum gRedBlueSwap[] = { GR_GL_BLUE, GR_GL_GREEN, GR_GL_RED, GR_GL_ALPHA }; @@ -2137,7 +2128,7 @@ bool GrGpuGL::flushGLStateCommon(GrPrimitiveType type) { newTexParams.fWrapS = wraps[sampler.getWrapX()]; newTexParams.fWrapT = wraps[sampler.getWrapY()]; memcpy(newTexParams.fSwizzleRGBA, - get_swizzle(nextTexture->config(), sampler, this->glCaps()), + get_swizzle(nextTexture->config(), sampler), sizeof(newTexParams.fSwizzleRGBA)); if (setAll || newTexParams.fFilter != oldTexParams.fFilter) { setTextureUnit(s); @@ -2379,25 +2370,14 @@ bool GrGpuGL::configToGLFormats(GrPixelConfig config, } break; case kAlpha_8_GrPixelConfig: - if (this->glCaps().textureRedSupport()) { - *internalFormat = GR_GL_RED; - *externalFormat = GR_GL_RED; - if (getSizedInternalFormat) { - *internalFormat = GR_GL_R8; - } else { - *internalFormat = GR_GL_RED; - } - *externalType = GR_GL_UNSIGNED_BYTE; + *internalFormat = GR_GL_ALPHA; + *externalFormat = GR_GL_ALPHA; + if (getSizedInternalFormat) { + *internalFormat = GR_GL_ALPHA8; } else { *internalFormat = GR_GL_ALPHA; - *externalFormat = GR_GL_ALPHA; - if (getSizedInternalFormat) { - *internalFormat = GR_GL_ALPHA8; - } else { - *internalFormat = GR_GL_ALPHA; - } - *externalType = GR_GL_UNSIGNED_BYTE; } + *externalType = GR_GL_UNSIGNED_BYTE; break; default: return false; |