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

Side by Side Diff: blimp/client/support/compositor/blimp_context_provider.cc

Issue 2297933002: blimp: Set up the CompositorDependencies for blimp in Chrome. (Closed)
Patch Set: retry gpu process failures after crbug.com/643282 Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "blimp/client/support/compositor/blimp_context_provider.h" 5 #include "blimp/client/support/compositor/blimp_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 "cc/output/context_cache_controller.h" 10 #include "cc/output/context_cache_controller.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 void BlimpContextProvider::InvalidateGrContext(uint32_t state) { 102 void BlimpContextProvider::InvalidateGrContext(uint32_t state) {
103 DCHECK(context_thread_checker_.CalledOnValidThread()); 103 DCHECK(context_thread_checker_.CalledOnValidThread());
104 104
105 if (gr_context_) 105 if (gr_context_)
106 gr_context_->ResetContext(state); 106 gr_context_->ResetContext(state);
107 } 107 }
108 108
109 base::Lock* BlimpContextProvider::GetLock() { 109 base::Lock* BlimpContextProvider::GetLock() {
110 // This context provider is not used on multiple threads. 110 return &context_lock_;
111 NOTREACHED();
112 return nullptr;
113 } 111 }
114 112
115 void BlimpContextProvider::SetLostContextCallback( 113 void BlimpContextProvider::SetLostContextCallback(
116 const LostContextCallback& lost_context_callback) { 114 const LostContextCallback& lost_context_callback) {
117 DCHECK(context_thread_checker_.CalledOnValidThread()); 115 DCHECK(context_thread_checker_.CalledOnValidThread());
118 lost_context_callback_ = lost_context_callback; 116 lost_context_callback_ = lost_context_callback;
119 } 117 }
120 118
121 void BlimpContextProvider::OnLostContext() { 119 void BlimpContextProvider::OnLostContext() {
122 DCHECK(context_thread_checker_.CalledOnValidThread()); 120 DCHECK(context_thread_checker_.CalledOnValidThread());
123 if (!lost_context_callback_.is_null()) 121 if (!lost_context_callback_.is_null())
124 lost_context_callback_.Run(); 122 lost_context_callback_.Run();
125 if (gr_context_) 123 if (gr_context_)
126 gr_context_->OnLostContext(); 124 gr_context_->OnLostContext();
127 } 125 }
128 126
129 } // namespace client 127 } // namespace client
130 } // namespace blimp 128 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/support/compositor/blimp_context_provider.h ('k') | blimp/client/support/compositor/blimp_layer_tree_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698