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

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

Issue 2252163003: Update Context Client Visibility to use Scoped Pattern (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix webview 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
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('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/macros.h" 10 #include "base/macros.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 base::Lock* InProcessContextProvider::GetLock() { 145 base::Lock* InProcessContextProvider::GetLock() {
146 return &context_lock_; 146 return &context_lock_;
147 } 147 }
148 148
149 void InProcessContextProvider::DeleteCachedResources() { 149 void InProcessContextProvider::DeleteCachedResources() {
150 DCHECK(context_thread_checker_.CalledOnValidThread()); 150 DCHECK(context_thread_checker_.CalledOnValidThread());
151 151
152 if (gr_context_) 152 if (gr_context_)
153 gr_context_->FreeGpuResources(); 153 gr_context_->FreeGpuResources();
154
155 ContextSupport()->TrimResources();
154 } 156 }
155 157
156 void InProcessContextProvider::SetLostContextCallback( 158 void InProcessContextProvider::SetLostContextCallback(
157 const LostContextCallback& lost_context_callback) { 159 const LostContextCallback& lost_context_callback) {
158 // Pixel tests do not test lost context. 160 // Pixel tests do not test lost context.
159 } 161 }
160 162
161 uint32_t InProcessContextProvider::GetCopyTextureInternalFormat() { 163 uint32_t InProcessContextProvider::GetCopyTextureInternalFormat() {
162 if (attribs_.alpha_size > 0) 164 if (attribs_.alpha_size > 0)
163 return GL_RGBA; 165 return GL_RGBA;
164 DCHECK_NE(attribs_.red_size, 0); 166 DCHECK_NE(attribs_.red_size, 0);
165 DCHECK_NE(attribs_.green_size, 0); 167 DCHECK_NE(attribs_.green_size, 0);
166 DCHECK_NE(attribs_.blue_size, 0); 168 DCHECK_NE(attribs_.blue_size, 0);
167 return GL_RGB; 169 return GL_RGB;
168 } 170 }
169 171
170 } // namespace ui 172 } // namespace ui
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698