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: |