OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/compositor/test/in_process_context_provider.h" | 5 #include "ui/compositor/test/in_process_context_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 capabilities_.gpu = context_->GetImplementation()->capabilities(); | 115 capabilities_.gpu = context_->GetImplementation()->capabilities(); |
116 | 116 |
117 std::string unique_context_name = | 117 std::string unique_context_name = |
118 base::StringPrintf("%s-%p", debug_name_.c_str(), context_.get()); | 118 base::StringPrintf("%s-%p", debug_name_.c_str(), context_.get()); |
119 context_->GetImplementation()->TraceBeginCHROMIUM( | 119 context_->GetImplementation()->TraceBeginCHROMIUM( |
120 "gpu_toplevel", unique_context_name.c_str()); | 120 "gpu_toplevel", unique_context_name.c_str()); |
121 | 121 |
122 return true; | 122 return true; |
123 } | 123 } |
124 | 124 |
| 125 void InProcessContextProvider::DetachFromThread() { |
| 126 context_thread_checker_.DetachFromThread(); |
| 127 } |
| 128 |
125 cc::ContextProvider::Capabilities | 129 cc::ContextProvider::Capabilities |
126 InProcessContextProvider::ContextCapabilities() { | 130 InProcessContextProvider::ContextCapabilities() { |
127 DCHECK(context_thread_checker_.CalledOnValidThread()); | 131 DCHECK(context_thread_checker_.CalledOnValidThread()); |
128 return capabilities_; | 132 return capabilities_; |
129 } | 133 } |
130 | 134 |
131 gpu::gles2::GLES2Interface* InProcessContextProvider::ContextGL() { | 135 gpu::gles2::GLES2Interface* InProcessContextProvider::ContextGL() { |
132 DCHECK(context_thread_checker_.CalledOnValidThread()); | 136 DCHECK(context_thread_checker_.CalledOnValidThread()); |
133 | 137 |
134 return context_->GetImplementation(); | 138 return context_->GetImplementation(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 return; | 225 return; |
222 destroyed_ = true; | 226 destroyed_ = true; |
223 } | 227 } |
224 if (!lost_context_callback_.is_null()) | 228 if (!lost_context_callback_.is_null()) |
225 base::ResetAndReturn(&lost_context_callback_).Run(); | 229 base::ResetAndReturn(&lost_context_callback_).Run(); |
226 if (gr_context_) | 230 if (gr_context_) |
227 gr_context_->abandonContext(); | 231 gr_context_->abandonContext(); |
228 } | 232 } |
229 | 233 |
230 } // namespace ui | 234 } // namespace ui |
OLD | NEW |