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

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

Issue 1365563002: Make channel preemption not require view contexts for hookup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wakeup_gpu
Patch Set: . Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/compositor/gpu_process_transport_factory.h" 5 #include "content/browser/compositor/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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 435 }
436 436
437 cc::TaskGraphRunner* GpuProcessTransportFactory::GetTaskGraphRunner() { 437 cc::TaskGraphRunner* GpuProcessTransportFactory::GetTaskGraphRunner() {
438 return task_graph_runner_.get(); 438 return task_graph_runner_.get();
439 } 439 }
440 440
441 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() { 441 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() {
442 return this; 442 return this;
443 } 443 }
444 444
445 gfx::GLSurfaceHandle GpuProcessTransportFactory::GetSharedSurfaceHandle() {
446 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle(
447 gfx::kNullPluginWindow, gfx::NULL_TRANSPORT);
448 handle.parent_client_id =
449 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId();
450 return handle;
451 }
452
453 scoped_ptr<cc::SurfaceIdAllocator> 445 scoped_ptr<cc::SurfaceIdAllocator>
454 GpuProcessTransportFactory::CreateSurfaceIdAllocator() { 446 GpuProcessTransportFactory::CreateSurfaceIdAllocator() {
455 scoped_ptr<cc::SurfaceIdAllocator> allocator = 447 scoped_ptr<cc::SurfaceIdAllocator> allocator =
456 make_scoped_ptr(new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); 448 make_scoped_ptr(new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
457 if (GetSurfaceManager()) 449 if (GetSurfaceManager())
458 allocator->RegisterSurfaceIdNamespace(GetSurfaceManager()); 450 allocator->RegisterSurfaceIdNamespace(GetSurfaceManager());
459 return allocator; 451 return allocator;
460 } 452 }
461 453
462 void GpuProcessTransportFactory::ResizeDisplay(ui::Compositor* compositor, 454 void GpuProcessTransportFactory::ResizeDisplay(ui::Compositor* compositor,
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 618 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
627 observer_list_, 619 observer_list_,
628 OnLostResources()); 620 OnLostResources());
629 621
630 // Kill things that use the shared context before killing the shared context. 622 // Kill things that use the shared context before killing the shared context.
631 lost_gl_helper.reset(); 623 lost_gl_helper.reset();
632 lost_shared_main_thread_contexts = NULL; 624 lost_shared_main_thread_contexts = NULL;
633 } 625 }
634 626
635 } // namespace content 627 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698