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

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

Issue 15746007: fix slowness of getImageData() for CanvasRenderingContext2D in linux due to un-optimized format for… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove parens Created 7 years, 7 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/gl/GrGpuGL.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/GrGpuGL.cpp
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 035ef3bb1bf43c99d5d80552cf16c1bc317d959c..0c47060e4f5033454caf5b1748762a57a4c6eb47 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;
+ } else if (GrBytesPerPixel(cpuConfig) == 4 &&
+ GrPixelConfigSwapRAndB(cpuConfig) == 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 {
- 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 {
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698