Index: src/gpu/gl/GrGpuGL.cpp |
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp |
index 035ef3bb1bf43c99d5d80552cf16c1bc317d959c..aa8e9c1531ef7ca515812791cfcea3a831f985ea 100644 |
--- a/src/gpu/gl/GrGpuGL.cpp |
+++ b/src/gpu/gl/GrGpuGL.cpp |
@@ -266,21 +266,24 @@ void GrGpuGL::fillInConfigRenderableTable() { |
} |
namespace { |
-GrPixelConfig preferred_pixel_ops_config(GrPixelConfig config) { |
+GrPixelConfig preferred_pixel_ops_config(GrPixelConfig config, GrPixelConfig targetConfig) { |
if (GR_GL_RGBA_8888_PIXEL_OPS_SLOW && kRGBA_8888_GrPixelConfig == config) { |
return kBGRA_8888_GrPixelConfig; |
+ } else if (config == targetConfig |
+ || (GrBytesPerPixel(config) == 4 && GrPixelConfigSwapRAndB(config) == targetConfig)) { |
+ return targetConfig; |
} else { |
return config; |
} |
} |
} |
-GrPixelConfig GrGpuGL::preferredReadPixelsConfig(GrPixelConfig config) const { |
- return preferred_pixel_ops_config(config); |
+GrPixelConfig GrGpuGL::preferredReadPixelsConfig(GrPixelConfig readConfig, GrPixelConfig targetConfig) const { |
+ return preferred_pixel_ops_config(readConfig, targetConfig); |
} |
-GrPixelConfig GrGpuGL::preferredWritePixelsConfig(GrPixelConfig config) const { |
- return preferred_pixel_ops_config(config); |
+GrPixelConfig GrGpuGL::preferredWritePixelsConfig(GrPixelConfig writeConfig, GrPixelConfig targetConfig) const { |
+ return preferred_pixel_ops_config(writeConfig, targetConfig); |
} |
bool GrGpuGL::canWriteTexturePixels(const GrTexture* texture, GrPixelConfig srcConfig) const { |