diff options
author | bsalomon <bsalomon@google.com> | 2015-06-24 13:22:50 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-24 13:22:50 -0700 |
commit | 1e1adc33ba1acb9a2ad41c0a5a9b6166ee9d7a2a (patch) | |
tree | f3978f17559721a0e69c556d975d057986678e70 /src/gpu | |
parent | 4760f32f2a68acdcfee53eae98bbdabb19238e8d (diff) |
remove workaround for dx9 angle slow rgba pixel ops
TBR=robertphillips@google.com
Review URL: https://codereview.chromium.org/1207003002
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/GrGpu.h | 3 | ||||
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 27 |
2 files changed, 9 insertions, 21 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index 3bb84a4485..d9c2e18bdb 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -148,8 +148,7 @@ public: } /** - * Called before uploading writing pixels to a GrTexture when the src pixel config doesn't - * match the texture's config. + * Called before uploading writing pixels to a GrTexture. */ virtual bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig) const = 0; diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 20669b8e78..6366b44e24 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -270,21 +270,14 @@ void GrGLGpu::contextAbandoned() { /////////////////////////////////////////////////////////////////////////////// GrPixelConfig GrGLGpu::preferredReadPixelsConfig(GrPixelConfig readConfig, GrPixelConfig surfaceConfig) const { - if (GR_GL_RGBA_8888_PIXEL_OPS_SLOW && kRGBA_8888_GrPixelConfig == readConfig) { - return kBGRA_8888_GrPixelConfig; - } else if (kMesa_GrGLDriver == this->glContext().driver() && - GrBytesPerPixel(readConfig) == 4 && - GrPixelConfigSwapRAndB(readConfig) == surfaceConfig) { - // Mesa 3D takes a slow path on when reading back BGRA from an RGBA surface and vice-versa. - // Perhaps this should be guarded by some compiletime or runtime check. + if (kMesa_GrGLDriver == this->glContext().driver() && + GrBytesPerPixel(readConfig) == 4 && GrPixelConfigSwapRAndB(readConfig) == surfaceConfig) { + // Mesa 3D takes a slow path on when reading back BGRA from an RGBA surface and vice-versa. + // Perhaps this should be guarded by some compile-time or runtime check. return surfaceConfig; - } else if (readConfig == kBGRA_8888_GrPixelConfig - && !this->glCaps().readPixelsSupported( - this->glInterface(), - GR_GL_BGRA, - GR_GL_UNSIGNED_BYTE, - surfaceConfig - )) { + } else if (readConfig == kBGRA_8888_GrPixelConfig && + !this->glCaps().readPixelsSupported(this->glInterface(), GR_GL_BGRA, + GR_GL_UNSIGNED_BYTE, surfaceConfig)) { return kRGBA_8888_GrPixelConfig; } else { return readConfig; @@ -293,11 +286,7 @@ GrPixelConfig GrGLGpu::preferredReadPixelsConfig(GrPixelConfig readConfig, GrPixelConfig GrGLGpu::preferredWritePixelsConfig(GrPixelConfig writeConfig, GrPixelConfig surfaceConfig) const { - if (GR_GL_RGBA_8888_PIXEL_OPS_SLOW && kRGBA_8888_GrPixelConfig == writeConfig) { - return kBGRA_8888_GrPixelConfig; - } else { - return writeConfig; - } + return writeConfig; } bool GrGLGpu::canWriteTexturePixels(const GrTexture* texture, GrPixelConfig srcConfig) const { |