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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 111063003: Aura: Don't create GL context for CreateSharedSurfaceHandle() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try to make tests happy by still creating shared context Created 6 years, 11 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 3e4d6e74db7e831af1ef5f13e7b5415c3ff2357b..ed380e1c69e2ecdd93bdffe6ccad9a3a8de699e1 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -490,6 +490,7 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host)
#if defined(OS_WIN)
plugin_parent_window_ = NULL;
#endif
+ ImageTransportFactory::GetInstance()->AddObserver(this);
}
////////////////////////////////////////////////////////////////////////////////
@@ -2185,13 +2186,7 @@ void RenderWidgetHostViewAura::CreateBrowserAccessibilityManagerIfNeeded() {
}
gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() {
- if (shared_surface_handle_.is_null()) {
- ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
- shared_surface_handle_ = factory->CreateSharedSurfaceHandle();
- if (!shared_surface_handle_.is_null())
- factory->AddObserver(this);
- }
- return shared_surface_handle_;
+ return ImageTransportFactory::GetInstance()->GetSharedSurfaceHandle();
}
bool RenderWidgetHostViewAura::LockMouse() {
@@ -3261,12 +3256,6 @@ void RenderWidgetHostViewAura::OnLostResources() {
// are using is becoming invalid. This sends pending ACKs and needs to happen
// after calling UpdateExternalTexture() which syncs with the impl thread.
RunOnCommitCallbacks();
-
- DCHECK(!shared_surface_handle_.is_null());
- ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
- factory->DestroySharedSurfaceHandle(shared_surface_handle_);
- shared_surface_handle_ = factory->CreateSharedSurfaceHandle();
- host_->CompositingSurfaceUpdated();
host_->ScheduleComposite();
}
@@ -3278,11 +3267,9 @@ RenderWidgetHostViewAura::~RenderWidgetHostViewAura() {
paint_observer_->OnViewDestroyed();
if (touch_editing_client_)
touch_editing_client_->OnViewDestroyed();
- if (!shared_surface_handle_.is_null()) {
- ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
- factory->DestroySharedSurfaceHandle(shared_surface_handle_);
- factory->RemoveObserver(this);
- }
+
+ ImageTransportFactory::GetInstance()->RemoveObserver(this);
+
window_observer_.reset();
if (window_->GetDispatcher())
window_->GetDispatcher()->RemoveRootWindowObserver(this);

Powered by Google App Engine
This is Rietveld 408576698