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 |