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

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

Issue 10815070: Support copying a partial rectangle region from the compositing surface on Aura and GTK. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 de65f0cab2706c712874cc34f3376e4c9b3a565f..e1cae476ef70b07202a13e19196433728ae3357a 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -496,16 +496,17 @@ void RenderWidgetHostImpl::SetIsLoading(bool is_loading) {
}
void RenderWidgetHostImpl::CopyFromBackingStore(
- const gfx::Rect& src_rect,
- const gfx::Size& accelerated_dest_size,
+ const gfx::Rect& src_subrect,
+ const gfx::Size& accelerated_dst_size,
const base::Callback<void(bool)>& callback,
skia::PlatformCanvas* output) {
if (view_ && is_accelerated_compositing_active_) {
TRACE_EVENT0("browser",
"RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface");
- // TODO(mazda): Support partial copy with |src_rect|
- // (http://crbug.com/118571).
- view_->CopyFromCompositingSurface(accelerated_dest_size,
+ gfx::Rect copy_rect = src_subrect.IsEmpty() ?
+ gfx::Rect(view_->GetViewBounds().size()) : src_subrect;
+ view_->CopyFromCompositingSurface(copy_rect,
+ accelerated_dst_size,
callback,
output);
return;
@@ -519,10 +520,8 @@ void RenderWidgetHostImpl::CopyFromBackingStore(
TRACE_EVENT0("browser",
"RenderWidgetHostImpl::CopyFromBackingStore::FromBackingStore");
- const gfx::Size backing_store_size = backing_store->size();
- gfx::Rect copy_rect = src_rect.IsEmpty() ?
- gfx::Rect(0, 0, backing_store_size.width(), backing_store_size.height()) :
- src_rect;
+ gfx::Rect copy_rect = src_subrect.IsEmpty() ?
+ gfx::Rect(backing_store->size()) : src_subrect;
// When the result size is equal to the backing store size, copy from the
// backing store directly to the output canvas.
bool result = backing_store->CopyFromBackingStore(copy_rect, output);

Powered by Google App Engine
This is Rietveld 408576698