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

Side by Side Diff: content/common/gpu/gpu_channel_manager.cc

Issue 10510013: GPU: Adding sync points for cross-channel synchronization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: protected destructor Created 8 years, 6 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/common/gpu/gpu_channel_manager.h" 5 #include "content/common/gpu/gpu_channel_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/common/child_thread.h" 8 #include "content/common/child_thread.h"
9 #include "content/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 #include "content/common/gpu/gpu_memory_manager.h" 10 #include "content/common/gpu/gpu_memory_manager.h"
11 #include "content/common/gpu/gpu_messages.h" 11 #include "content/common/gpu/gpu_messages.h"
12 #include "content/common/gpu/sync_point_manager.h"
12 #include "ui/gl/gl_share_group.h" 13 #include "ui/gl/gl_share_group.h"
13 14
14 GpuChannelManager::GpuChannelManager(ChildThread* gpu_child_thread, 15 GpuChannelManager::GpuChannelManager(ChildThread* gpu_child_thread,
15 GpuWatchdog* watchdog, 16 GpuWatchdog* watchdog,
16 base::MessageLoopProxy* io_message_loop, 17 base::MessageLoopProxy* io_message_loop,
17 base::WaitableEvent* shutdown_event) 18 base::WaitableEvent* shutdown_event)
18 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), 19 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
19 io_message_loop_(io_message_loop), 20 io_message_loop_(io_message_loop),
20 shutdown_event_(shutdown_event), 21 shutdown_event_(shutdown_event),
21 gpu_child_thread_(gpu_child_thread), 22 gpu_child_thread_(gpu_child_thread),
22 ALLOW_THIS_IN_INITIALIZER_LIST(gpu_memory_manager_(this, 23 ALLOW_THIS_IN_INITIALIZER_LIST(gpu_memory_manager_(this,
23 GpuMemoryManager::kDefaultMaxSurfacesWithFrontbufferSoftLimit)), 24 GpuMemoryManager::kDefaultMaxSurfacesWithFrontbufferSoftLimit)),
24 watchdog_(watchdog) { 25 watchdog_(watchdog),
26 sync_point_manager_(new SyncPointManager) {
25 DCHECK(gpu_child_thread); 27 DCHECK(gpu_child_thread);
26 DCHECK(io_message_loop); 28 DCHECK(io_message_loop);
27 DCHECK(shutdown_event); 29 DCHECK(shutdown_event);
28 } 30 }
29 31
30 GpuChannelManager::~GpuChannelManager() { 32 GpuChannelManager::~GpuChannelManager() {
31 gpu_channels_.clear(); 33 gpu_channels_.clear();
32 } 34 }
33 35
34 void GpuChannelManager::RemoveChannel(int client_id) { 36 void GpuChannelManager::RemoveChannel(int client_id) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 void GpuChannelManager::LoseAllContexts() { 147 void GpuChannelManager::LoseAllContexts() {
146 MessageLoop::current()->PostTask( 148 MessageLoop::current()->PostTask(
147 FROM_HERE, 149 FROM_HERE,
148 base::Bind(&GpuChannelManager::OnLoseAllContexts, 150 base::Bind(&GpuChannelManager::OnLoseAllContexts,
149 weak_factory_.GetWeakPtr())); 151 weak_factory_.GetWeakPtr()));
150 } 152 }
151 153
152 void GpuChannelManager::OnLoseAllContexts() { 154 void GpuChannelManager::OnLoseAllContexts() {
153 gpu_channels_.clear(); 155 gpu_channels_.clear();
154 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698