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

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

Issue 11266023: Make GL calls go through subclassable class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « no previous file | gpu/command_buffer/service/program_manager.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 gpu_channels_.clear(); 51 gpu_channels_.clear();
52 if (default_offscreen_surface_.get()) { 52 if (default_offscreen_surface_.get()) {
53 default_offscreen_surface_->Destroy(); 53 default_offscreen_surface_->Destroy();
54 default_offscreen_surface_ = NULL; 54 default_offscreen_surface_ = NULL;
55 } 55 }
56 DCHECK(image_operations_.empty()); 56 DCHECK(image_operations_.empty());
57 } 57 }
58 58
59 gpu::gles2::ProgramCache* GpuChannelManager::program_cache() { 59 gpu::gles2::ProgramCache* GpuChannelManager::program_cache() {
60 if (!program_cache_.get() && 60 if (!program_cache_.get() &&
61 (gfx::g_ARB_get_program_binary || gfx::g_OES_get_program_binary) && 61 (gfx::g_driver_gl.ext.b_ARB_get_program_binary ||
62 gfx::g_driver_gl.ext.b_OES_get_program_binary) &&
62 !CommandLine::ForCurrentProcess()->HasSwitch( 63 !CommandLine::ForCurrentProcess()->HasSwitch(
63 switches::kDisableGpuProgramCache)) { 64 switches::kDisableGpuProgramCache)) {
64 program_cache_.reset(new gpu::gles2::MemoryProgramCache()); 65 program_cache_.reset(new gpu::gles2::MemoryProgramCache());
65 } 66 }
66 return program_cache_.get(); 67 return program_cache_.get();
67 } 68 }
68 69
69 void GpuChannelManager::RemoveChannel(int client_id) { 70 void GpuChannelManager::RemoveChannel(int client_id) {
70 gpu_channels_.erase(client_id); 71 gpu_channels_.erase(client_id);
71 } 72 }
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 272
272 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { 273 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() {
273 if (!default_offscreen_surface_.get()) { 274 if (!default_offscreen_surface_.get()) {
274 default_offscreen_surface_ = gfx::GLSurface::CreateOffscreenGLSurface( 275 default_offscreen_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(
275 false, gfx::Size(1, 1)); 276 false, gfx::Size(1, 1));
276 } 277 }
277 return default_offscreen_surface_.get(); 278 return default_offscreen_surface_.get();
278 } 279 }
279 280
280 } // namespace content 281 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/program_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698