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

Side by Side Diff: blimp/client/feature/compositor/blimp_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: Simplify cc context cleanup 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 | « android_webview/browser/aw_render_thread_context_provider.cc ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/feature/compositor/blimp_context_provider.h" 5 #include "blimp/client/feature/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 "gpu/command_buffer/client/gl_in_process_context.h" 10 #include "gpu/command_buffer/client/gl_in_process_context.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 gr_context_.reset(new skia_bindings::GrContextForGLES2Interface(ContextGL())); 88 gr_context_.reset(new skia_bindings::GrContextForGLES2Interface(ContextGL()));
89 89
90 return gr_context_->get(); 90 return gr_context_->get();
91 } 91 }
92 92
93 void BlimpContextProvider::InvalidateGrContext(uint32_t state) { 93 void BlimpContextProvider::InvalidateGrContext(uint32_t state) {
94 DCHECK(context_thread_checker_.CalledOnValidThread()); 94 DCHECK(context_thread_checker_.CalledOnValidThread());
95 95
96 if (gr_context_) 96 if (gr_context_)
97 gr_context_->ResetContext(state); 97 gr_context_->ResetContext(state);
98
99 ContextSupport()->TrimResources();
danakj 2016/08/24 20:12:49 Did you mean to put this is DeleteCachedResources?
ericrk 2016/08/24 21:58:52 I absolutely did
98 } 100 }
99 101
100 base::Lock* BlimpContextProvider::GetLock() { 102 base::Lock* BlimpContextProvider::GetLock() {
101 // This context provider is not used on multiple threads. 103 // This context provider is not used on multiple threads.
102 NOTREACHED(); 104 NOTREACHED();
103 return nullptr; 105 return nullptr;
104 } 106 }
105 107
106 void BlimpContextProvider::DeleteCachedResources() { 108 void BlimpContextProvider::DeleteCachedResources() {
107 DCHECK(context_thread_checker_.CalledOnValidThread()); 109 DCHECK(context_thread_checker_.CalledOnValidThread());
(...skipping 17 matching lines...) Expand all
125 } 127 }
126 128
127 uint32_t BlimpContextProvider::GetCopyTextureInternalFormat() { 129 uint32_t BlimpContextProvider::GetCopyTextureInternalFormat() {
128 // The attributes used to create the context in the constructor specify 130 // The attributes used to create the context in the constructor specify
129 // an alpha channel. 131 // an alpha channel.
130 return GL_RGBA; 132 return GL_RGBA;
131 } 133 }
132 134
133 } // namespace client 135 } // namespace client
134 } // namespace blimp 136 } // namespace blimp
OLDNEW
« no previous file with comments | « android_webview/browser/aw_render_thread_context_provider.cc ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698