OLD | NEW |
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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 base::Bind(&TestContextProvider::OnLostContext, | 79 base::Bind(&TestContextProvider::OnLostContext, |
80 base::Unretained(this))); | 80 base::Unretained(this))); |
81 | 81 |
82 return true; | 82 return true; |
83 } | 83 } |
84 | 84 |
85 void TestContextProvider::DetachFromThread() { | 85 void TestContextProvider::DetachFromThread() { |
86 context_thread_checker_.DetachFromThread(); | 86 context_thread_checker_.DetachFromThread(); |
87 } | 87 } |
88 | 88 |
89 ContextProvider::Capabilities TestContextProvider::ContextCapabilities() { | 89 gpu::Capabilities TestContextProvider::ContextCapabilities() { |
90 DCHECK(bound_); | 90 DCHECK(bound_); |
91 DCHECK(context_thread_checker_.CalledOnValidThread()); | 91 DCHECK(context_thread_checker_.CalledOnValidThread()); |
92 | |
93 return context3d_->test_capabilities(); | 92 return context3d_->test_capabilities(); |
94 } | 93 } |
95 | 94 |
96 gpu::gles2::GLES2Interface* TestContextProvider::ContextGL() { | 95 gpu::gles2::GLES2Interface* TestContextProvider::ContextGL() { |
97 DCHECK(context3d_); | 96 DCHECK(context3d_); |
98 DCHECK(bound_); | 97 DCHECK(bound_); |
99 DCHECK(context_thread_checker_.CalledOnValidThread()); | 98 DCHECK(context_thread_checker_.CalledOnValidThread()); |
100 | 99 |
101 return context_gl_.get(); | 100 return context_gl_.get(); |
102 } | 101 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return context3d_.get(); | 161 return context3d_.get(); |
163 } | 162 } |
164 | 163 |
165 void TestContextProvider::SetLostContextCallback( | 164 void TestContextProvider::SetLostContextCallback( |
166 const LostContextCallback& cb) { | 165 const LostContextCallback& cb) { |
167 DCHECK(context_thread_checker_.CalledOnValidThread()); | 166 DCHECK(context_thread_checker_.CalledOnValidThread()); |
168 DCHECK(lost_context_callback_.is_null() || cb.is_null()); | 167 DCHECK(lost_context_callback_.is_null() || cb.is_null()); |
169 lost_context_callback_ = cb; | 168 lost_context_callback_ = cb; |
170 } | 169 } |
171 | 170 |
172 void TestContextProvider::SetMaxTransferBufferUsageBytes( | |
173 size_t max_transfer_buffer_usage_bytes) { | |
174 context3d_->SetMaxTransferBufferUsageBytes(max_transfer_buffer_usage_bytes); | |
175 } | |
176 | |
177 } // namespace cc | 171 } // namespace cc |
OLD | NEW |