OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1264 void RenderWidgetHostViewAura::OnWindowTargetVisibilityChanged(bool visible) { | 1264 void RenderWidgetHostViewAura::OnWindowTargetVisibilityChanged(bool visible) { |
1265 } | 1265 } |
1266 | 1266 |
1267 bool RenderWidgetHostViewAura::HasHitTestMask() const { | 1267 bool RenderWidgetHostViewAura::HasHitTestMask() const { |
1268 return false; | 1268 return false; |
1269 } | 1269 } |
1270 | 1270 |
1271 void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const { | 1271 void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const { |
1272 } | 1272 } |
1273 | 1273 |
1274 scoped_refptr<ui::Texture> RenderWidgetHostViewAura::CopyTexture() { | |
1275 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | |
1276 GLHelper* gl_helper = factory->GetGLHelper(); | |
1277 if (!gl_helper) | |
1278 return scoped_refptr<ui::Texture>(); | |
1279 | |
1280 std::map<uint64, scoped_refptr<ui::Texture> >::iterator it = | |
1281 image_transport_clients_.find(current_surface_); | |
1282 if (it == image_transport_clients_.end()) | |
piman
2012/09/13 00:19:10
Maybe also check host_->is_accelerated_compositing
| |
1283 return scoped_refptr<ui::Texture>(); | |
1284 | |
1285 ui::Texture* container = it->second; | |
1286 DCHECK(container); | |
1287 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
| |
1288 WebKit::WebGLId surface_handle = | |
piman
2012/09/13 00:19:10
nit: I'd name this texture_id or something. It's r
| |
1289 gl_helper->CopyTexture(container->texture_id(), size_in_pixels); | |
1290 if (!surface_handle) | |
1291 return scoped_refptr<ui::Texture>(); | |
1292 return scoped_refptr<ui::Texture>( | |
1293 factory->CreateTransportClient(size_in_pixels, surface_handle)); | |
1294 } | |
1295 | |
1274 //////////////////////////////////////////////////////////////////////////////// | 1296 //////////////////////////////////////////////////////////////////////////////// |
1275 // RenderWidgetHostViewAura, ui::EventHandler implementation: | 1297 // RenderWidgetHostViewAura, ui::EventHandler implementation: |
1276 | 1298 |
1277 ui::EventResult RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) { | 1299 ui::EventResult RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) { |
1278 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnKeyEvent"); | 1300 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnKeyEvent"); |
1279 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab() && | 1301 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab() && |
1280 popup_child_host_view_->OnKeyEvent(event)) | 1302 popup_child_host_view_->OnKeyEvent(event)) |
1281 return ui::ER_HANDLED; | 1303 return ui::ER_HANDLED; |
1282 | 1304 |
1283 // We need to handle the Escape key for Pepper Flash. | 1305 // We need to handle the Escape key for Pepper Flash. |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1714 RenderWidgetHost* widget) { | 1736 RenderWidgetHost* widget) { |
1715 return new RenderWidgetHostViewAura(widget); | 1737 return new RenderWidgetHostViewAura(widget); |
1716 } | 1738 } |
1717 | 1739 |
1718 // static | 1740 // static |
1719 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 1741 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
1720 GetScreenInfoForWindow(results, NULL); | 1742 GetScreenInfoForWindow(results, NULL); |
1721 } | 1743 } |
1722 | 1744 |
1723 } // namespace content | 1745 } // namespace content |
OLD | NEW |