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

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

Issue 1324413003: Move gpu memory calculations to Compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment + android_arm64_dbg_recipe bot issue. Created 5 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
« 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 DCHECK(bound_); 178 DCHECK(bound_);
179 DCHECK(context_thread_checker_.CalledOnValidThread()); 179 DCHECK(context_thread_checker_.CalledOnValidThread());
180 180
181 return context3d_.get(); 181 return context3d_.get();
182 } 182 }
183 183
184 TestWebGraphicsContext3D* TestContextProvider::UnboundTestContext3d() { 184 TestWebGraphicsContext3D* TestContextProvider::UnboundTestContext3d() {
185 return context3d_.get(); 185 return context3d_.get();
186 } 186 }
187 187
188 void TestContextProvider::SetMemoryAllocation(
189 const ManagedMemoryPolicy& policy) {
190 if (memory_policy_changed_callback_.is_null())
191 return;
192 memory_policy_changed_callback_.Run(policy);
193 }
194
195 void TestContextProvider::SetLostContextCallback( 188 void TestContextProvider::SetLostContextCallback(
196 const LostContextCallback& cb) { 189 const LostContextCallback& cb) {
197 DCHECK(context_thread_checker_.CalledOnValidThread()); 190 DCHECK(context_thread_checker_.CalledOnValidThread());
198 DCHECK(lost_context_callback_.is_null() || cb.is_null()); 191 DCHECK(lost_context_callback_.is_null() || cb.is_null());
199 lost_context_callback_ = cb; 192 lost_context_callback_ = cb;
200 } 193 }
201 194
202 void TestContextProvider::SetMemoryPolicyChangedCallback(
203 const MemoryPolicyChangedCallback& cb) {
204 DCHECK(context_thread_checker_.CalledOnValidThread());
205 DCHECK(memory_policy_changed_callback_.is_null() || cb.is_null());
206 memory_policy_changed_callback_ = cb;
207 }
208
209 void TestContextProvider::SetMaxTransferBufferUsageBytes( 195 void TestContextProvider::SetMaxTransferBufferUsageBytes(
210 size_t max_transfer_buffer_usage_bytes) { 196 size_t max_transfer_buffer_usage_bytes) {
211 context3d_->SetMaxTransferBufferUsageBytes(max_transfer_buffer_usage_bytes); 197 context3d_->SetMaxTransferBufferUsageBytes(max_transfer_buffer_usage_bytes);
212 } 198 }
213 199
214 } // namespace cc 200 } // 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