Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1205183002: Revert of remove workaround for dx9 angle slow rgba pixel ops (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrGpu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 6366b44e245f21550e72119e1763e47274885b59..20669b8e78bfcd7677cce97ff2a8575cb8516622 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -270,14 +270,21 @@
///////////////////////////////////////////////////////////////////////////////
GrPixelConfig GrGLGpu::preferredReadPixelsConfig(GrPixelConfig readConfig,
GrPixelConfig surfaceConfig) const {
- 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.
+ 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.
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;
@@ -286,7 +293,11 @@
GrPixelConfig GrGLGpu::preferredWritePixelsConfig(GrPixelConfig writeConfig,
GrPixelConfig surfaceConfig) const {
- return writeConfig;
+ if (GR_GL_RGBA_8888_PIXEL_OPS_SLOW && kRGBA_8888_GrPixelConfig == writeConfig) {
+ return kBGRA_8888_GrPixelConfig;
+ } else {
+ return writeConfig;
+ }
}
bool GrGLGpu::canWriteTexturePixels(const GrTexture* texture, GrPixelConfig srcConfig) const {
« no previous file with comments | « src/gpu/GrGpu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698