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

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

Issue 916723002: cc: Add threaded GPU rasterization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement ContextProviderInProcess::DetachFromThread(). Created 5 years, 10 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
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 bound_ = true; 63 bound_ = true;
64 64
65 context3d_->set_context_lost_callback( 65 context3d_->set_context_lost_callback(
66 base::Bind(&TestContextProvider::OnLostContext, 66 base::Bind(&TestContextProvider::OnLostContext,
67 base::Unretained(this))); 67 base::Unretained(this)));
68 68
69 return true; 69 return true;
70 } 70 }
71 71
72 void TestContextProvider::DetachFromThread() {
73 context_thread_checker_.DetachFromThread();
74 }
75
72 ContextProvider::Capabilities TestContextProvider::ContextCapabilities() { 76 ContextProvider::Capabilities TestContextProvider::ContextCapabilities() {
73 DCHECK(bound_); 77 DCHECK(bound_);
74 DCHECK(context_thread_checker_.CalledOnValidThread()); 78 DCHECK(context_thread_checker_.CalledOnValidThread());
75 79
76 return context3d_->test_capabilities(); 80 return context3d_->test_capabilities();
77 } 81 }
78 82
79 gpu::gles2::GLES2Interface* TestContextProvider::ContextGL() { 83 gpu::gles2::GLES2Interface* TestContextProvider::ContextGL() {
80 DCHECK(context3d_); 84 DCHECK(context3d_);
81 DCHECK(bound_); 85 DCHECK(bound_);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 DCHECK(memory_policy_changed_callback_.is_null() || cb.is_null()); 184 DCHECK(memory_policy_changed_callback_.is_null() || cb.is_null());
181 memory_policy_changed_callback_ = cb; 185 memory_policy_changed_callback_ = cb;
182 } 186 }
183 187
184 void TestContextProvider::SetMaxTransferBufferUsageBytes( 188 void TestContextProvider::SetMaxTransferBufferUsageBytes(
185 size_t max_transfer_buffer_usage_bytes) { 189 size_t max_transfer_buffer_usage_bytes) {
186 context3d_->SetMaxTransferBufferUsageBytes(max_transfer_buffer_usage_bytes); 190 context3d_->SetMaxTransferBufferUsageBytes(max_transfer_buffer_usage_bytes);
187 } 191 }
188 192
189 } // namespace cc 193 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698