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

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: Incorporate review feedback 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..e41f17cc76d0c595fcf3311ae648e87622d0541a 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,31 @@ bool RenderWidgetHostViewAura::HasHitTestMask() const {
void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const {
}
+scoped_refptr<ui::Texture> RenderWidgetHostViewAura::CopyTexture() {
+ if (!host_->is_accelerated_compositing_active())
+ return scoped_refptr<ui::Texture>();
+
+ 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())
+ return scoped_refptr<ui::Texture>();
+
+ ui::Texture* container = it->second;
+ DCHECK(container);
+ WebKit::WebGLId texture_id =
+ gl_helper->CopyTexture(container->texture_id(), container->size());
+ if (!texture_id)
+ return scoped_refptr<ui::Texture>();
+
+ return scoped_refptr<ui::Texture>(
+ factory->CreateTransportClient(container->size(), texture_id));
+}
+
////////////////////////////////////////////////////////////////////////////////
// RenderWidgetHostViewAura, ui::EventHandler implementation:

Powered by Google App Engine
This is Rietveld 408576698