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

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

Issue 2383613005: Android: Second attempt at freeing GLHelper ashmem (Closed)
Patch Set: doh Created 4 years, 2 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() {
123 if (bind_succeeded_)
124 gles2_impl_->FreeUnusedSharedMemory();
125 }
126
127 bool ContextProviderCommandBuffer::BindToCurrentThread() { 122 bool ContextProviderCommandBuffer::BindToCurrentThread() {
128 // This is called on the thread the context will be used. 123 // This is called on the thread the context will be used.
129 DCHECK(context_thread_checker_.CalledOnValidThread()); 124 DCHECK(context_thread_checker_.CalledOnValidThread());
130 125
131 if (bind_failed_) 126 if (bind_failed_)
132 return false; 127 return false;
133 if (bind_succeeded_) 128 if (bind_succeeded_)
134 return true; 129 return true;
135 130
136 // Early outs should report failure. 131 // Early outs should report failure.
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 336
342 void ContextProviderCommandBuffer::SetLostContextCallback( 337 void ContextProviderCommandBuffer::SetLostContextCallback(
343 const LostContextCallback& lost_context_callback) { 338 const LostContextCallback& lost_context_callback) {
344 DCHECK(context_thread_checker_.CalledOnValidThread()); 339 DCHECK(context_thread_checker_.CalledOnValidThread());
345 DCHECK(lost_context_callback_.is_null() || 340 DCHECK(lost_context_callback_.is_null() ||
346 lost_context_callback.is_null()); 341 lost_context_callback.is_null());
347 lost_context_callback_ = lost_context_callback; 342 lost_context_callback_ = lost_context_callback;
348 } 343 }
349 344
350 } // namespace content 345 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698