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

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

Issue 2392623003: Revert of Android: Free GLHelper context ashmem when it makes sense (Closed)
Patch Set: 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
« no previous file with comments | « content/common/gpu/client/context_provider_command_buffer.h ('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 "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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 334
340 void ContextProviderCommandBuffer::SetLostContextCallback( 335 void ContextProviderCommandBuffer::SetLostContextCallback(
341 const LostContextCallback& lost_context_callback) { 336 const LostContextCallback& lost_context_callback) {
342 DCHECK(context_thread_checker_.CalledOnValidThread()); 337 DCHECK(context_thread_checker_.CalledOnValidThread());
343 DCHECK(lost_context_callback_.is_null() || 338 DCHECK(lost_context_callback_.is_null() ||
344 lost_context_callback.is_null()); 339 lost_context_callback.is_null());
345 lost_context_callback_ = lost_context_callback; 340 lost_context_callback_ = lost_context_callback;
346 } 341 }
347 342
348 } // namespace content 343 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/context_provider_command_buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698