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

Side by Side Diff: content/common/gpu/client/context_provider_command_buffer.cc

Issue 2336043004: Android: Free GLHelper context ashmem when it makes sense (Closed)
Patch Set: Android: Free GLHelper context ashmem when it makes sense 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 (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 "content/common/gpu/client/context_provider_command_buffer.h" 5 #include "content/common/gpu/client/context_provider_command_buffer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 uint32_t ContextProviderCommandBuffer::GetCopyTextureInternalFormat() { 113 uint32_t ContextProviderCommandBuffer::GetCopyTextureInternalFormat() {
114 if (attributes_.alpha_size > 0) 114 if (attributes_.alpha_size > 0)
115 return GL_RGBA; 115 return GL_RGBA;
116 DCHECK_NE(attributes_.red_size, 0); 116 DCHECK_NE(attributes_.red_size, 0);
117 DCHECK_NE(attributes_.green_size, 0); 117 DCHECK_NE(attributes_.green_size, 0);
118 DCHECK_NE(attributes_.blue_size, 0); 118 DCHECK_NE(attributes_.blue_size, 0);
119 return GL_RGB; 119 return GL_RGB;
120 } 120 }
121 121
122 void ContextProviderCommandBuffer::FreeUnusedSharedMemory() {
danakj 2016/09/13 22:44:58 Hm, idk about adding another way to free memory. W
123 if (bind_succeeded_)
124 gles2_impl_->FreeUnusedSharedMemory();
125 }
126
122 bool ContextProviderCommandBuffer::BindToCurrentThread() { 127 bool ContextProviderCommandBuffer::BindToCurrentThread() {
123 // This is called on the thread the context will be used. 128 // This is called on the thread the context will be used.
124 DCHECK(context_thread_checker_.CalledOnValidThread()); 129 DCHECK(context_thread_checker_.CalledOnValidThread());
125 130
126 if (bind_failed_) 131 if (bind_failed_)
127 return false; 132 return false;
128 if (bind_succeeded_) 133 if (bind_succeeded_)
129 return true; 134 return true;
130 135
131 // Early outs should report failure. 136 // Early outs should report failure.
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 338
334 void ContextProviderCommandBuffer::SetLostContextCallback( 339 void ContextProviderCommandBuffer::SetLostContextCallback(
335 const LostContextCallback& lost_context_callback) { 340 const LostContextCallback& lost_context_callback) {
336 DCHECK(context_thread_checker_.CalledOnValidThread()); 341 DCHECK(context_thread_checker_.CalledOnValidThread());
337 DCHECK(lost_context_callback_.is_null() || 342 DCHECK(lost_context_callback_.is_null() ||
338 lost_context_callback.is_null()); 343 lost_context_callback.is_null());
339 lost_context_callback_ = lost_context_callback; 344 lost_context_callback_ = lost_context_callback;
340 } 345 }
341 346
342 } // namespace content 347 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698