Chromium Code Reviews| Index: src/gpu/gl/GrGpuGL.cpp |
| diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp |
| index 035ef3bb1bf43c99d5d80552cf16c1bc317d959c..e9f61dcd74d71bf31b584995c8567994832bf11c 100644 |
| --- a/src/gpu/gl/GrGpuGL.cpp |
| +++ b/src/gpu/gl/GrGpuGL.cpp |
| @@ -266,21 +266,28 @@ void GrGpuGL::fillInConfigRenderableTable() { |
| } |
| namespace { |
| -GrPixelConfig preferred_pixel_ops_config(GrPixelConfig config) { |
| - if (GR_GL_RGBA_8888_PIXEL_OPS_SLOW && kRGBA_8888_GrPixelConfig == config) { |
| +GrPixelConfig preferred_pixel_ops_config(GrPixelConfig cpuConfig, GrPixelConfig surfaceConfig) { |
| + if (GR_GL_RGBA_8888_PIXEL_OPS_SLOW && kRGBA_8888_GrPixelConfig == cpuConfig) { |
| return kBGRA_8888_GrPixelConfig; |
|
robertphillips
2013/05/22 15:33:24
seems like there is an extra set of parens in here
|
| + } else if ((GrBytesPerPixel(cpuConfig) == 4 && |
| + GrPixelConfigSwapRAndB(cpuConfig) == surfaceConfig)) { |
| + // It is believed to be slower (at least on Intel Linux GL drivers) to readback BGRA from |
|
Jun Jiang
2013/05/22 17:27:20
I think it may be more reasonable to say "it is be
|
| + // an RGBA surface and vice-versa. Perhaps this should be keyed off the GL vendor string. |
| + return surfaceConfig; |
| } else { |
| - return config; |
| + return cpuConfig; |
| } |
| } |
| } |
| -GrPixelConfig GrGpuGL::preferredReadPixelsConfig(GrPixelConfig config) const { |
| - return preferred_pixel_ops_config(config); |
| +GrPixelConfig GrGpuGL::preferredReadPixelsConfig(GrPixelConfig readConfig, |
| + GrPixelConfig surfaceConfig) const { |
| + return preferred_pixel_ops_config(readConfig, surfaceConfig); |
| } |
| -GrPixelConfig GrGpuGL::preferredWritePixelsConfig(GrPixelConfig config) const { |
| - return preferred_pixel_ops_config(config); |
| +GrPixelConfig GrGpuGL::preferredWritePixelsConfig(GrPixelConfig writeConfig, |
| + GrPixelConfig surfaceConfig) const { |
| + return preferred_pixel_ops_config(writeConfig, surfaceConfig); |
| } |
| bool GrGpuGL::canWriteTexturePixels(const GrTexture* texture, GrPixelConfig srcConfig) const { |