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

Side by Side Diff: cc/test/test_context_provider.cc

Issue 1412923004: Revert of Move gpu memory calculations to Compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 | « cc/test/test_context_provider.h ('k') | cc/test/test_in_process_context_provider.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/test/test_context_provider.h" 5 #include "cc/test/test_context_provider.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 DCHECK(bound_); 152 DCHECK(bound_);
153 DCHECK(context_thread_checker_.CalledOnValidThread()); 153 DCHECK(context_thread_checker_.CalledOnValidThread());
154 154
155 return context3d_.get(); 155 return context3d_.get();
156 } 156 }
157 157
158 TestWebGraphicsContext3D* TestContextProvider::UnboundTestContext3d() { 158 TestWebGraphicsContext3D* TestContextProvider::UnboundTestContext3d() {
159 return context3d_.get(); 159 return context3d_.get();
160 } 160 }
161 161
162 void TestContextProvider::SetMemoryAllocation(
163 const ManagedMemoryPolicy& policy) {
164 if (memory_policy_changed_callback_.is_null())
165 return;
166 memory_policy_changed_callback_.Run(policy);
167 }
168
162 void TestContextProvider::SetLostContextCallback( 169 void TestContextProvider::SetLostContextCallback(
163 const LostContextCallback& cb) { 170 const LostContextCallback& cb) {
164 DCHECK(context_thread_checker_.CalledOnValidThread()); 171 DCHECK(context_thread_checker_.CalledOnValidThread());
165 DCHECK(lost_context_callback_.is_null() || cb.is_null()); 172 DCHECK(lost_context_callback_.is_null() || cb.is_null());
166 lost_context_callback_ = cb; 173 lost_context_callback_ = cb;
167 } 174 }
168 175
176 void TestContextProvider::SetMemoryPolicyChangedCallback(
177 const MemoryPolicyChangedCallback& cb) {
178 DCHECK(context_thread_checker_.CalledOnValidThread());
179 DCHECK(memory_policy_changed_callback_.is_null() || cb.is_null());
180 memory_policy_changed_callback_ = cb;
181 }
182
169 void TestContextProvider::SetMaxTransferBufferUsageBytes( 183 void TestContextProvider::SetMaxTransferBufferUsageBytes(
170 size_t max_transfer_buffer_usage_bytes) { 184 size_t max_transfer_buffer_usage_bytes) {
171 context3d_->SetMaxTransferBufferUsageBytes(max_transfer_buffer_usage_bytes); 185 context3d_->SetMaxTransferBufferUsageBytes(max_transfer_buffer_usage_bytes);
172 } 186 }
173 187
174 } // namespace cc 188 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_context_provider.h ('k') | cc/test/test_in_process_context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698