OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |