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

Unified Diff: content/common/gpu/client/gl_helper_readback_support.cc

Issue 188633002: Query the preferred readback config in CopyFromBackingStore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: content/common/gpu/client/gl_helper_readback_support.cc
diff --git a/content/common/gpu/client/gl_helper_readback_support.cc b/content/common/gpu/client/gl_helper_readback_support.cc
index 28bae135670a8e9886e44cbcf2454a607714b261..d3e31eda89927ac96a6d0772256e21233f4a1291 100644
--- a/content/common/gpu/client/gl_helper_readback_support.cc
+++ b/content/common/gpu/client/gl_helper_readback_support.cc
@@ -4,6 +4,9 @@
#include "content/common/gpu/client/gl_helper_readback_support.h"
#include "base/logging.h"
+#if defined(OS_ANDROID)
+#include "base/android/sys_utils.h"
+#endif
namespace content {
@@ -90,4 +93,17 @@ bool GLHelperReadbackSupport::IsReadbackConfigSupported(
}
}
+SkBitmap::Config GLHelperReadbackSupport::PreferredReadbackFormat() {
+#if defined(OS_ANDROID)
+ // Define the criteria here. If say the 16 texture readbback is
+ // supported we should go with that (this degrades quality)
+ // or stick back to the default format.
+ if (base::android::SysUtils::IsLowEndDevice()) {
+ if (IsReadbackConfigSupported(SkBitmap::kRGB_565_Config))
+ return SkBitmap::kRGB_565_Config;
+ }
+#endif
+ return SkBitmap::kARGB_8888_Config;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698