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 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2656 return *result; | 2656 return *result; |
2657 } | 2657 } |
2658 | 2658 |
2659 void GLES2Implementation::DestroyStreamTextureCHROMIUM(GLuint texture) { | 2659 void GLES2Implementation::DestroyStreamTextureCHROMIUM(GLuint texture) { |
2660 GPU_CLIENT_LOG("[" << this << "] DestroyStreamTextureCHROMIUM(" | 2660 GPU_CLIENT_LOG("[" << this << "] DestroyStreamTextureCHROMIUM(" |
2661 << texture << ")"); | 2661 << texture << ")"); |
2662 TRACE_EVENT0("gpu", "GLES2::DestroyStreamTextureCHROMIUM"); | 2662 TRACE_EVENT0("gpu", "GLES2::DestroyStreamTextureCHROMIUM"); |
2663 helper_->DestroyStreamTextureCHROMIUM(texture); | 2663 helper_->DestroyStreamTextureCHROMIUM(texture); |
2664 } | 2664 } |
2665 | 2665 |
| 2666 void GLES2Implementation::PostSubBufferCHROMIUM( |
| 2667 GLint x, GLint y, GLint width, GLint height) { |
| 2668 GPU_CLIENT_LOG("[" << this << "] PostSubBufferCHROMIUM(" |
| 2669 << x << ", " << y << ", " << width << ", " << height << ")"); |
| 2670 TRACE_EVENT0("gpu", "GLES2::PostSubBufferCHROMIUM"); |
| 2671 |
| 2672 // Same flow control as GLES2Implementation::SwapBuffers (see comments there). |
| 2673 swap_buffers_tokens_.push(helper_->InsertToken()); |
| 2674 helper_->PostSubBufferCHROMIUM(x, y, width, height); |
| 2675 helper_->CommandBufferHelper::Flush(); |
| 2676 if (swap_buffers_tokens_.size() > kMaxSwapBuffers + 1) { |
| 2677 helper_->WaitForToken(swap_buffers_tokens_.front()); |
| 2678 swap_buffers_tokens_.pop(); |
| 2679 } |
| 2680 } |
| 2681 |
2666 } // namespace gles2 | 2682 } // namespace gles2 |
2667 } // namespace gpu | 2683 } // namespace gpu |
OLD | NEW |