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

Side by Side Diff: ui/compositor/test/in_process_context_provider.cc

Issue 1230203007: Re-land: cc: Use worker context for one-copy tile initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 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 | « ui/compositor/test/in_process_context_provider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/compositor/test/in_process_context_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698