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

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

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/common/child_thread.h" 9 #include "content/common/child_thread.h"
10 #include "content/common/gpu/gpu_channel.h" 10 #include "content/common/gpu/gpu_channel.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 uint64 messages_processed = 0; 271 uint64 messages_processed = 0;
272 272
273 for (GpuChannelMap::iterator iter = gpu_channels_.begin(); 273 for (GpuChannelMap::iterator iter = gpu_channels_.begin();
274 iter != gpu_channels_.end(); ++iter) { 274 iter != gpu_channels_.end(); ++iter) {
275 messages_processed += iter->second->messages_processed(); 275 messages_processed += iter->second->messages_processed();
276 } 276 }
277 return messages_processed; 277 return messages_processed;
278 } 278 }
279 279
280 void GpuChannelManager::LoseAllContexts() { 280 void GpuChannelManager::LoseAllContexts() {
281 MessageLoop::current()->PostTask( 281 base::MessageLoop::current()->PostTask(
282 FROM_HERE, 282 FROM_HERE,
283 base::Bind(&GpuChannelManager::OnLoseAllContexts, 283 base::Bind(&GpuChannelManager::OnLoseAllContexts,
284 weak_factory_.GetWeakPtr())); 284 weak_factory_.GetWeakPtr()));
285 } 285 }
286 286
287 void GpuChannelManager::OnLoseAllContexts() { 287 void GpuChannelManager::OnLoseAllContexts() {
288 gpu_channels_.clear(); 288 gpu_channels_.clear();
289 } 289 }
290 290
291 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { 291 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() {
292 if (!default_offscreen_surface_) { 292 if (!default_offscreen_surface_) {
293 default_offscreen_surface_ = gfx::GLSurface::CreateOffscreenGLSurface( 293 default_offscreen_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(
294 false, gfx::Size(1, 1)); 294 false, gfx::Size(1, 1));
295 } 295 }
296 return default_offscreen_surface_.get(); 296 return default_offscreen_surface_.get();
297 } 297 }
298 298
299 } // namespace content 299 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698