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

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

Issue 1786813002: Fix BGRA/RGBA readback conversions on mac (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 5baed59f14de1cb501d766144c8343e2f14beef0..6209ce40204bbe6bdd452b0d95cd8aee5ccdb8f0 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -53,6 +53,7 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
fRGBA8888PixelsOpsAreSlow = false;
fPartialFBOReadIsSlow = false;
fMipMapLevelAndLodControlSupport = false;
+ fRGBAToBGRAReadbackConversionsAreSlow = false;
fBlitFramebufferSupport = kNone_BlitFramebufferSupport;
@@ -266,6 +267,16 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
fPartialFBOReadIsSlow = isANGLE;
#endif
+ bool isMESA = kMesa_GrGLDriver == ctxInfo.driver();
+ bool isMAC = false;
+#ifdef SK_BUILD_FOR_MAC
+ isMAC = true;
+#endif
+
+ // Both mesa and mac have reduced performance if reading back an RGBA framebuffer as BGRA or
+ // vis-versa.
+ fRGBAToBGRAReadbackConversionsAreSlow = isMESA || isMAC;
+
/**************************************************************************
* GrShaderCaps fields
**************************************************************************/
@@ -1052,6 +1063,8 @@ SkString GrGLCaps::dump() const {
r.appendf("External texture support: %s\n", (fExternalTextureSupport ? "YES" : "NO"));
r.appendf("Rectangle texture support: %s\n", (fRectangleTextureSupport? "YES" : "NO"));
r.appendf("Texture swizzle support: %s\n", (fTextureSwizzleSupport ? "YES" : "NO"));
+ r.appendf("BGRA to RGBA readback conversions are slow: %s\n",
+ (fRGBAToBGRAReadbackConversionsAreSlow ? "YES" : "NO"));
r.append("Configs\n-------\n");
for (int i = 0; i < kGrPixelConfigCnt; ++i) {
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | src/gpu/gl/GrGLGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698