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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.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_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index cc774c16aa769ba8b7a3a06a4e4f77d91562017b..773929a62189f3c7c31803f549bcc59cf9f25ee5 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -446,7 +446,8 @@ BackingStore* RenderWidgetHostViewAura::AllocBackingStore(
}
void RenderWidgetHostViewAura::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));
@@ -462,9 +463,9 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurface(
ui::Texture* container = it->second;
DCHECK(container);
- gfx::Size size_in_pixel = ConvertSizeToPixel(this, size);
+ gfx::Size dst_size_in_pixel = ConvertSizeToPixel(this, dst_size);
if (!output->initialize(
- size_in_pixel.width(), size_in_pixel.height(), true))
+ dst_size_in_pixel.width(), dst_size_in_pixel.height(), true))
return;
ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
@@ -475,9 +476,11 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurface(
unsigned char* addr = static_cast<unsigned char*>(
output->getTopDevice()->accessBitmap(true).getPixels());
scoped_callback_runner.Release();
+ gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(this, src_subrect);
gl_helper->CopyTextureTo(container->texture_id(),
container->size(),
- size_in_pixel,
+ src_subrect_in_pixel,
+ dst_size_in_pixel,
addr,
callback);
}

Powered by Google App Engine
This is Rietveld 408576698