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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.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_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 73c306d28292d3d19feb1d8aec5d5d9ba7fa3633..3cd158729be2b8d30a7aed79288d35c037feeb6c 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -718,16 +718,15 @@ void RenderWidgetHostImpl::SetIsLoading(bool is_loading) {
void RenderWidgetHostImpl::CopyFromBackingStore(
const gfx::Rect& src_subrect,
const gfx::Size& accelerated_dst_size,
- const base::Callback<void(bool, const SkBitmap&)>& callback) {
+ const base::Callback<void(bool, const SkBitmap&)>& callback,
+ const SkBitmap::Config& bitmap_config) {
if (view_ && is_accelerated_compositing_active_) {
TRACE_EVENT0("browser",
"RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface");
gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ?
gfx::Rect(view_->GetViewBounds().size()) : src_subrect;
- view_->CopyFromCompositingSurface(accelerated_copy_rect,
- accelerated_dst_size,
- callback,
- SkBitmap::kARGB_8888_Config);
+ view_->CopyFromCompositingSurface(
+ accelerated_copy_rect, accelerated_dst_size, callback, bitmap_config);
return;
}
@@ -2532,4 +2531,10 @@ void RenderWidgetHostImpl::AddLatencyInfoComponentIds(
}
}
+SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() {
+ if (view_)
+ return view_->PreferredReadbackFormat();
+ return SkBitmap::kARGB_8888_Config;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698