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

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

Issue 10910242: Makes copying layers clone external textures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 8 years, 3 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 c5d4edbdf2d0472a943e8a7875d0eff706326ed7..63438fab2a7de6bb3d768929f6d1d7d5e3fa7c11 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1271,6 +1271,28 @@ bool RenderWidgetHostViewAura::HasHitTestMask() const {
void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const {
}
+scoped_refptr<ui::Texture> RenderWidgetHostViewAura::CopyTexture() {
+ ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
+ GLHelper* gl_helper = factory->GetGLHelper();
+ if (!gl_helper)
+ return scoped_refptr<ui::Texture>();
+
+ std::map<uint64, scoped_refptr<ui::Texture> >::iterator it =
+ image_transport_clients_.find(current_surface_);
+ if (it == image_transport_clients_.end())
piman 2012/09/13 00:19:10 Maybe also check host_->is_accelerated_compositing
+ return scoped_refptr<ui::Texture>();
+
+ ui::Texture* container = it->second;
+ DCHECK(container);
+ gfx::Size size_in_pixels(ConvertSizeToPixel(this, window_->bounds().size()));
piman 2012/09/13 00:19:10 How about texture->size() ? That way you're guaran
+ WebKit::WebGLId surface_handle =
piman 2012/09/13 00:19:10 nit: I'd name this texture_id or something. It's r
+ gl_helper->CopyTexture(container->texture_id(), size_in_pixels);
+ if (!surface_handle)
+ return scoped_refptr<ui::Texture>();
+ return scoped_refptr<ui::Texture>(
+ factory->CreateTransportClient(size_in_pixels, surface_handle));
+}
+
////////////////////////////////////////////////////////////////////////////////
// RenderWidgetHostViewAura, ui::EventHandler implementation:
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | content/browser/web_contents/web_contents_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698