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

Unified Diff: content/browser/renderer_host/render_widget_host_view_gtk.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: address comments 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_view_gtk.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc
index d1db5257a1f208f1009ecd35cb59057a8d4f42a6..ec74be199eadcda8f7483deb5dd07be615b30350 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -1030,23 +1030,26 @@ BackingStore* RenderWidgetHostViewGtk::AllocBackingStore(
depth);
}
-// NOTE: |output| is initialized with the size of the view and |size| is
-// ignored on GTK.
+// NOTE: |output| is initialized with the size of |src_subrect|, and |dst_size|
+// is ignored on GTK.
void RenderWidgetHostViewGtk::CopyFromCompositingSurface(
- const gfx::Size& /* size */,
+ const gfx::Rect& src_subrect,
+ const gfx::Size& /* dst_size */,
const base::Callback<void(bool)>& callback,
skia::PlatformCanvas* output) {
base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false));
const gfx::Rect bounds = GetViewBounds();
XImage* image = XGetImage(ui::GetXDisplay(), ui::GetX11RootWindow(),
- bounds.x(), bounds.y(),
- bounds.width(), bounds.height(),
+ bounds.x() + src_subrect.x(),
+ bounds.y() + src_subrect.y(),
+ src_subrect.width(),
+ src_subrect.height(),
AllPlanes, ZPixmap);
if (!image)
return;
- if (!output->initialize(bounds.width(), bounds.height(), true)) {
+ if (!output->initialize(src_subrect.width(), src_subrect.height(), true)) {
XFree(image);
return;
}

Powered by Google App Engine
This is Rietveld 408576698