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

Side by Side Diff: content/browser/aura/gpu_process_transport_factory.cc

Issue 22293003: Clean up compositor initialization/destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanupcompositor: UseRealGLBindings in NetInternalsTest Created 7 years, 4 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/aura/gpu_process_transport_factory.h" 5 #include "content/browser/aura/gpu_process_transport_factory.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return; 301 return;
302 PerCompositorData* data = it->second; 302 PerCompositorData* data = it->second;
303 DCHECK(data); 303 DCHECK(data);
304 GpuSurfaceTracker::Get()->RemoveSurface(data->surface_id); 304 GpuSurfaceTracker::Get()->RemoveSurface(data->surface_id);
305 delete data; 305 delete data;
306 per_compositor_data_.erase(it); 306 per_compositor_data_.erase(it);
307 if (per_compositor_data_.empty()) 307 if (per_compositor_data_.empty())
308 gl_helper_.reset(); 308 gl_helper_.reset();
309 } 309 }
310 310
311 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; }
312
311 ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() { 313 ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() {
312 return this; 314 return this;
313 } 315 }
314 316
315 gfx::GLSurfaceHandle GpuProcessTransportFactory::CreateSharedSurfaceHandle() { 317 gfx::GLSurfaceHandle GpuProcessTransportFactory::CreateSharedSurfaceHandle() {
316 CreateSharedContextLazy(); 318 CreateSharedContextLazy();
317 if (!shared_contexts_main_thread_ || 319 if (!shared_contexts_main_thread_ ||
318 !shared_contexts_main_thread_->Context3d()) 320 !shared_contexts_main_thread_->Context3d())
319 return gfx::GLSurfaceHandle(); 321 return gfx::GLSurfaceHandle();
320 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( 322 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle(
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 shared_contexts_main_thread_ = NULL; 508 shared_contexts_main_thread_ = NULL;
507 509
508 scoped_ptr<GLHelper> old_helper(gl_helper_.release()); 510 scoped_ptr<GLHelper> old_helper(gl_helper_.release());
509 511
510 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 512 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
511 observer_list_, 513 observer_list_,
512 OnLostResources()); 514 OnLostResources());
513 } 515 }
514 516
515 } // namespace content 517 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698