Chromium Code Reviews| 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: |