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 2631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2642 return *result; | 2642 return *result; |
2643 } | 2643 } |
2644 | 2644 |
2645 void GLES2Implementation::DestroyStreamTextureCHROMIUM(GLuint texture) { | 2645 void GLES2Implementation::DestroyStreamTextureCHROMIUM(GLuint texture) { |
2646 GPU_CLIENT_LOG("[" << this << "] DestroyStreamTextureCHROMIUM(" | 2646 GPU_CLIENT_LOG("[" << this << "] DestroyStreamTextureCHROMIUM(" |
2647 << texture << ")"); | 2647 << texture << ")"); |
2648 TRACE_EVENT0("gpu", "GLES2::DestroyStreamTextureCHROMIUM"); | 2648 TRACE_EVENT0("gpu", "GLES2::DestroyStreamTextureCHROMIUM"); |
2649 helper_->DestroyStreamTextureCHROMIUM(texture); | 2649 helper_->DestroyStreamTextureCHROMIUM(texture); |
2650 } | 2650 } |
2651 | 2651 |
| 2652 void GLES2Implementation::PostSubBufferCHROMIUM( |
| 2653 GLint x, GLint y, GLint width, GLint height) { |
| 2654 GPU_CLIENT_LOG("[" << this << "] PostSubBufferCHROMIUM(" |
| 2655 << x << ", " << y << ", " << width << ", " << height << ")"); |
| 2656 TRACE_EVENT0("gpu", "GLES2::PostSubBufferCHROMIUM"); |
| 2657 |
| 2658 // Same flow control as GLES2Implementation::SwapBuffers (see comments there). |
| 2659 swap_buffers_tokens_.push(helper_->InsertToken()); |
| 2660 helper_->PostSubBufferCHROMIUM(x, y, width, height); |
| 2661 helper_->CommandBufferHelper::Flush(); |
| 2662 if (swap_buffers_tokens_.size() > kMaxSwapBuffers + 1) { |
| 2663 helper_->WaitForToken(swap_buffers_tokens_.front()); |
| 2664 swap_buffers_tokens_.pop(); |
| 2665 } |
| 2666 } |
| 2667 |
2652 } // namespace gles2 | 2668 } // namespace gles2 |
2653 } // namespace gpu | 2669 } // namespace gpu |
OLD | NEW |