OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
6 | 6 |
7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
8 | 8 |
9 #include <GLES2/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 ShallowFlushCHROMIUM(); | 320 ShallowFlushCHROMIUM(); |
321 gpu_control_->SetSurfaceVisible(visible); | 321 gpu_control_->SetSurfaceVisible(visible); |
322 } | 322 } |
323 | 323 |
324 void GLES2Implementation::SetAggressivelyFreeResources( | 324 void GLES2Implementation::SetAggressivelyFreeResources( |
325 bool aggressively_free_resources) { | 325 bool aggressively_free_resources) { |
326 TRACE_EVENT1("gpu", "GLES2Implementation::SetAggressivelyFreeResources", | 326 TRACE_EVENT1("gpu", "GLES2Implementation::SetAggressivelyFreeResources", |
327 "aggressively_free_resources", aggressively_free_resources); | 327 "aggressively_free_resources", aggressively_free_resources); |
328 aggressively_free_resources_ = aggressively_free_resources; | 328 aggressively_free_resources_ = aggressively_free_resources; |
329 | 329 |
330 // ShallowFlushCHROMIUM will free resources if |aggressively_free_resources_| | 330 if (aggressively_free_resources_) { |
piman
2015/07/13 22:48:07
aggressively_free_resources_ && HaveRingBuffer()
piman
2015/07/13 22:48:48
aggressively_free_resources_ && helper_->HaveRingB
ericrk
2015/07/13 23:07:52
ah, good point
| |
331 // is false. | 331 // Ensure that we clean up as much cache memory as possible and fully flush. |
332 ShallowFlushCHROMIUM(); | 332 FlushDriverCachesCHROMIUM(); |
333 | |
334 // Flush will delete transfer buffer resources if | |
335 // |aggressively_free_resources_| is true. | |
336 Flush(); | |
337 } else { | |
338 ShallowFlushCHROMIUM(); | |
339 } | |
333 } | 340 } |
334 | 341 |
335 void GLES2Implementation::WaitForCmd() { | 342 void GLES2Implementation::WaitForCmd() { |
336 TRACE_EVENT0("gpu", "GLES2::WaitForCmd"); | 343 TRACE_EVENT0("gpu", "GLES2::WaitForCmd"); |
337 helper_->CommandBufferHelper::Finish(); | 344 helper_->CommandBufferHelper::Finish(); |
338 } | 345 } |
339 | 346 |
340 bool GLES2Implementation::IsExtensionAvailable(const char* ext) { | 347 bool GLES2Implementation::IsExtensionAvailable(const char* ext) { |
341 const char* extensions = | 348 const char* extensions = |
342 reinterpret_cast<const char*>(GetStringHelper(GL_EXTENSIONS)); | 349 reinterpret_cast<const char*>(GetStringHelper(GL_EXTENSIONS)); |
(...skipping 5437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5780 CheckGLError(); | 5787 CheckGLError(); |
5781 } | 5788 } |
5782 | 5789 |
5783 // Include the auto-generated part of this file. We split this because it means | 5790 // Include the auto-generated part of this file. We split this because it means |
5784 // we can easily edit the non-auto generated parts right here in this file | 5791 // we can easily edit the non-auto generated parts right here in this file |
5785 // instead of having to edit some template or the code generator. | 5792 // instead of having to edit some template or the code generator. |
5786 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 5793 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
5787 | 5794 |
5788 } // namespace gles2 | 5795 } // namespace gles2 |
5789 } // namespace gpu | 5796 } // namespace gpu |
OLD | NEW |