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

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: nits and use best_resource_format for now Created 5 years, 5 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 (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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 capabilities_.gpu = context_->GetImplementation()->capabilities(); 121 capabilities_.gpu = context_->GetImplementation()->capabilities();
122 122
123 std::string unique_context_name = 123 std::string unique_context_name =
124 base::StringPrintf("%s-%p", debug_name_.c_str(), context_.get()); 124 base::StringPrintf("%s-%p", debug_name_.c_str(), context_.get());
125 context_->GetImplementation()->TraceBeginCHROMIUM( 125 context_->GetImplementation()->TraceBeginCHROMIUM(
126 "gpu_toplevel", unique_context_name.c_str()); 126 "gpu_toplevel", unique_context_name.c_str());
127 127
128 return true; 128 return true;
129 } 129 }
130 130
131 void InProcessContextProvider::DetachFromThread() {
132 context_thread_checker_.DetachFromThread();
133 }
134
131 cc::ContextProvider::Capabilities 135 cc::ContextProvider::Capabilities
132 InProcessContextProvider::ContextCapabilities() { 136 InProcessContextProvider::ContextCapabilities() {
133 DCHECK(context_thread_checker_.CalledOnValidThread()); 137 DCHECK(context_thread_checker_.CalledOnValidThread());
134 return capabilities_; 138 return capabilities_;
135 } 139 }
136 140
137 gpu::gles2::GLES2Interface* InProcessContextProvider::ContextGL() { 141 gpu::gles2::GLES2Interface* InProcessContextProvider::ContextGL() {
138 DCHECK(context_thread_checker_.CalledOnValidThread()); 142 DCHECK(context_thread_checker_.CalledOnValidThread());
139 143
140 return context_->GetImplementation(); 144 return context_->GetImplementation();
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 return; 231 return;
228 destroyed_ = true; 232 destroyed_ = true;
229 } 233 }
230 if (!lost_context_callback_.is_null()) 234 if (!lost_context_callback_.is_null())
231 base::ResetAndReturn(&lost_context_callback_).Run(); 235 base::ResetAndReturn(&lost_context_callback_).Run();
232 if (gr_context_) 236 if (gr_context_)
233 gr_context_->abandonContext(); 237 gr_context_->abandonContext();
234 } 238 }
235 239
236 } // namespace ui 240 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698