OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "../client/gles2_implementation.h" | 7 #include "../client/gles2_implementation.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <queue> | 10 #include <queue> |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 } | 730 } |
731 | 731 |
732 void GLES2Implementation::FreeUnusedSharedMemory() { | 732 void GLES2Implementation::FreeUnusedSharedMemory() { |
733 mapped_memory_->FreeUnused(); | 733 mapped_memory_->FreeUnused(); |
734 } | 734 } |
735 | 735 |
736 void GLES2Implementation::FreeEverything() { | 736 void GLES2Implementation::FreeEverything() { |
737 Finish(); | 737 Finish(); |
738 FreeUnusedSharedMemory(); | 738 FreeUnusedSharedMemory(); |
739 transfer_buffer_.Free(); | 739 transfer_buffer_.Free(); |
| 740 helper_->FreeRingBuffer(); |
740 } | 741 } |
741 | 742 |
742 void GLES2Implementation::WaitForCmd() { | 743 void GLES2Implementation::WaitForCmd() { |
743 TRACE_EVENT0("gpu", "GLES2::WaitForCmd"); | 744 TRACE_EVENT0("gpu", "GLES2::WaitForCmd"); |
744 helper_->CommandBufferHelper::Finish(); | 745 helper_->CommandBufferHelper::Finish(); |
745 } | 746 } |
746 | 747 |
747 namespace { | 748 namespace { |
748 bool IsExtensionAvailable(GLES2Implementation* gles2, const char ext[]) { | 749 bool IsExtensionAvailable(GLES2Implementation* gles2, const char ext[]) { |
749 const char* extensions = reinterpret_cast<const char*>( | 750 const char* extensions = reinterpret_cast<const char*>( |
(...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2886 helper_->PostSubBufferCHROMIUM(x, y, width, height); | 2887 helper_->PostSubBufferCHROMIUM(x, y, width, height); |
2887 helper_->CommandBufferHelper::Flush(); | 2888 helper_->CommandBufferHelper::Flush(); |
2888 if (swap_buffers_tokens_.size() > kMaxSwapBuffers + 1) { | 2889 if (swap_buffers_tokens_.size() > kMaxSwapBuffers + 1) { |
2889 helper_->WaitForToken(swap_buffers_tokens_.front()); | 2890 helper_->WaitForToken(swap_buffers_tokens_.front()); |
2890 swap_buffers_tokens_.pop(); | 2891 swap_buffers_tokens_.pop(); |
2891 } | 2892 } |
2892 } | 2893 } |
2893 | 2894 |
2894 } // namespace gles2 | 2895 } // namespace gles2 |
2895 } // namespace gpu | 2896 } // namespace gpu |
OLD | NEW |