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

Side by Side Diff: gpu/command_buffer/service/gl_context_virtual.cc

Issue 1420533009: Cleanup GpuMemoryManager and helpers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more cleanup. Created 5 years, 1 month 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
« no previous file with comments | « gpu/command_buffer/service/gl_context_virtual.h ('k') | ui/gl/gl_context.h » ('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 "gpu/command_buffer/service/gl_context_virtual.h" 5 #include "gpu/command_buffer/service/gl_context_virtual.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "gpu/command_buffer/service/gl_state_restorer_impl.h" 8 #include "gpu/command_buffer/service/gl_state_restorer_impl.h"
9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
10 #include "ui/gl/gl_gl_api_implementation.h" 10 #include "ui/gl/gl_gl_api_implementation.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 void GLContextVirtual::OnSetSwapInterval(int interval) { 86 void GLContextVirtual::OnSetSwapInterval(int interval) {
87 shared_context_->SetSwapInterval(interval); 87 shared_context_->SetSwapInterval(interval);
88 } 88 }
89 89
90 std::string GLContextVirtual::GetExtensions() { 90 std::string GLContextVirtual::GetExtensions() {
91 return shared_context_->GetExtensions(); 91 return shared_context_->GetExtensions();
92 } 92 }
93 93
94 bool GLContextVirtual::GetTotalGpuMemory(size_t* bytes) {
95 return shared_context_->GetTotalGpuMemory(bytes);
96 }
97
98 void GLContextVirtual::SetSafeToForceGpuSwitch() { 94 void GLContextVirtual::SetSafeToForceGpuSwitch() {
99 // TODO(ccameron): This will not work if two contexts that disagree 95 // TODO(ccameron): This will not work if two contexts that disagree
100 // about whether or not forced gpu switching may be done both share 96 // about whether or not forced gpu switching may be done both share
101 // the same underlying shared_context_. 97 // the same underlying shared_context_.
102 return shared_context_->SetSafeToForceGpuSwitch(); 98 return shared_context_->SetSafeToForceGpuSwitch();
103 } 99 }
104 100
105 bool GLContextVirtual::WasAllocatedUsingRobustnessExtension() { 101 bool GLContextVirtual::WasAllocatedUsingRobustnessExtension() {
106 return shared_context_->WasAllocatedUsingRobustnessExtension(); 102 return shared_context_->WasAllocatedUsingRobustnessExtension();
107 } 103 }
(...skipping 15 matching lines...) Expand all
123 gfx::ScopedSetGLToRealGLApi scoped_set_gl_api; 119 gfx::ScopedSetGLToRealGLApi scoped_set_gl_api;
124 GetGLStateRestorer()->RestoreState(NULL); 120 GetGLStateRestorer()->RestoreState(NULL);
125 shared_context_->SetStateWasDirtiedExternally(false); 121 shared_context_->SetStateWasDirtiedExternally(false);
126 } 122 }
127 123
128 GLContextVirtual::~GLContextVirtual() { 124 GLContextVirtual::~GLContextVirtual() {
129 Destroy(); 125 Destroy();
130 } 126 }
131 127
132 } // namespace gpu 128 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gl_context_virtual.h ('k') | ui/gl/gl_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698