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

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

Issue 21052007: aura: Clean up compositor initialization/destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanupcompositor: 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 return; 312 return;
313 PerCompositorData* data = it->second; 313 PerCompositorData* data = it->second;
314 DCHECK(data); 314 DCHECK(data);
315 GpuSurfaceTracker::Get()->RemoveSurface(data->surface_id); 315 GpuSurfaceTracker::Get()->RemoveSurface(data->surface_id);
316 delete data; 316 delete data;
317 per_compositor_data_.erase(it); 317 per_compositor_data_.erase(it);
318 if (per_compositor_data_.empty()) 318 if (per_compositor_data_.empty())
319 gl_helper_.reset(); 319 gl_helper_.reset();
320 } 320 }
321 321
322 bool GpuProcessTransportFactory::UsesTestContexts() { return false; }
323
322 ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() { 324 ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() {
323 return this; 325 return this;
324 } 326 }
325 327
326 gfx::GLSurfaceHandle GpuProcessTransportFactory::CreateSharedSurfaceHandle() { 328 gfx::GLSurfaceHandle GpuProcessTransportFactory::CreateSharedSurfaceHandle() {
327 CreateSharedContextLazy(); 329 CreateSharedContextLazy();
328 if (!shared_contexts_main_thread_ || 330 if (!shared_contexts_main_thread_ ||
329 !shared_contexts_main_thread_->Context3d()) 331 !shared_contexts_main_thread_->Context3d())
330 return gfx::GLSurfaceHandle(); 332 return gfx::GLSurfaceHandle();
331 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( 333 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle(
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 shared_contexts_main_thread_ = NULL; 518 shared_contexts_main_thread_ = NULL;
517 519
518 scoped_ptr<GLHelper> old_helper(gl_helper_.release()); 520 scoped_ptr<GLHelper> old_helper(gl_helper_.release());
519 521
520 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 522 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
521 observer_list_, 523 observer_list_,
522 OnLostResources()); 524 OnLostResources());
523 } 525 }
524 526
525 } // namespace content 527 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698