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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 if (!host_->is_accelerated_compositing_active())
1276 return scoped_refptr<ui::Texture>();
1277
1278 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
1279 GLHelper* gl_helper = factory->GetGLHelper();
1280 if (!gl_helper)
1281 return scoped_refptr<ui::Texture>();
1282
1283 std::map<uint64, scoped_refptr<ui::Texture> >::iterator it =
1284 image_transport_clients_.find(current_surface_);
1285 if (it == image_transport_clients_.end())
1286 return scoped_refptr<ui::Texture>();
1287
1288 ui::Texture* container = it->second;
1289 DCHECK(container);
1290 WebKit::WebGLId texture_id =
1291 gl_helper->CopyTexture(container->texture_id(), container->size());
1292 if (!texture_id)
1293 return scoped_refptr<ui::Texture>();
1294
1295 return scoped_refptr<ui::Texture>(
1296 factory->CreateTransportClient(container->size(), texture_id));
1297 }
1298
1274 //////////////////////////////////////////////////////////////////////////////// 1299 ////////////////////////////////////////////////////////////////////////////////
1275 // RenderWidgetHostViewAura, ui::EventHandler implementation: 1300 // RenderWidgetHostViewAura, ui::EventHandler implementation:
1276 1301
1277 ui::EventResult RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) { 1302 ui::EventResult RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) {
1278 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnKeyEvent"); 1303 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnKeyEvent");
1279 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab() && 1304 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab() &&
1280 popup_child_host_view_->OnKeyEvent(event)) 1305 popup_child_host_view_->OnKeyEvent(event))
1281 return ui::ER_HANDLED; 1306 return ui::ER_HANDLED;
1282 1307
1283 // We need to handle the Escape key for Pepper Flash. 1308 // We need to handle the Escape key for Pepper Flash.
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 RenderWidgetHost* widget) { 1739 RenderWidgetHost* widget) {
1715 return new RenderWidgetHostViewAura(widget); 1740 return new RenderWidgetHostViewAura(widget);
1716 } 1741 }
1717 1742
1718 // static 1743 // static
1719 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 1744 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
1720 GetScreenInfoForWindow(results, NULL); 1745 GetScreenInfoForWindow(results, NULL);
1721 } 1746 }
1722 1747
1723 } // namespace content 1748 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698