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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 188633002: Query the preferred readback config in CopyFromBackingStore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for test build issue. 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/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index fdc7810375eb907c8fe2b6decebddd50447fc996..10dbfeb6c4bfa960f9d738fb55d85d0dade1b953 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -6,6 +6,7 @@
#include <android/bitmap.h>
+#include "base/android/sys_utils.h"
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/callback_helpers.h"
@@ -1386,6 +1387,17 @@ bool RenderWidgetHostViewAndroid::IsReadbackConfigSupported(
return gl_helper->IsReadbackConfigSupported(bitmap_config);
}
+SkBitmap::Config RenderWidgetHostViewAndroid::PreferredReadbackFormat() {
+ // Define the criteria here. If say the 16 texture readback 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;
+ }
+ return SkBitmap::kARGB_8888_Config;
+}
+
// static
void RenderWidgetHostViewPort::GetDefaultScreenInfo(
blink::WebScreenInfo* results) {

Powered by Google App Engine
This is Rietveld 408576698