| 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 <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2827 void GLES2Implementation::SetSwapBuffersCompleteCallback( | 2827 void GLES2Implementation::SetSwapBuffersCompleteCallback( |
| 2828 const base::Closure& swap_buffers_complete_callback) { | 2828 const base::Closure& swap_buffers_complete_callback) { |
| 2829 swap_buffers_complete_callback_ = swap_buffers_complete_callback; | 2829 swap_buffers_complete_callback_ = swap_buffers_complete_callback; |
| 2830 } | 2830 } |
| 2831 | 2831 |
| 2832 void GLES2Implementation::ScheduleOverlayPlane(int plane_z_order, | 2832 void GLES2Implementation::ScheduleOverlayPlane(int plane_z_order, |
| 2833 unsigned plane_transform, | 2833 unsigned plane_transform, |
| 2834 unsigned overlay_texture_id, | 2834 unsigned overlay_texture_id, |
| 2835 const gfx::Rect& display_bounds, | 2835 const gfx::Rect& display_bounds, |
| 2836 const gfx::RectF& uv_rect) { | 2836 const gfx::RectF& uv_rect) { |
| 2837 NOTREACHED() << "Overlay supported isn't finished."; | 2837 ScheduleOverlayPlaneCHROMIUM(plane_z_order, |
| 2838 plane_transform, |
| 2839 overlay_texture_id, |
| 2840 display_bounds.x(), |
| 2841 display_bounds.y(), |
| 2842 display_bounds.width(), |
| 2843 display_bounds.height(), |
| 2844 uv_rect.x(), |
| 2845 uv_rect.y(), |
| 2846 uv_rect.width(), |
| 2847 uv_rect.height()); |
| 2838 } | 2848 } |
| 2839 | 2849 |
| 2840 void GLES2Implementation::OnSwapBuffersComplete() { | 2850 void GLES2Implementation::OnSwapBuffersComplete() { |
| 2841 if (!swap_buffers_complete_callback_.is_null()) | 2851 if (!swap_buffers_complete_callback_.is_null()) |
| 2842 swap_buffers_complete_callback_.Run(); | 2852 swap_buffers_complete_callback_.Run(); |
| 2843 } | 2853 } |
| 2844 | 2854 |
| 2845 GLboolean GLES2Implementation::EnableFeatureCHROMIUM( | 2855 GLboolean GLES2Implementation::EnableFeatureCHROMIUM( |
| 2846 const char* feature) { | 2856 const char* feature) { |
| 2847 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 2857 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3264 // Same flow control as GLES2Implementation::SwapBuffers (see comments there). | 3274 // Same flow control as GLES2Implementation::SwapBuffers (see comments there). |
| 3265 swap_buffers_tokens_.push(helper_->InsertToken()); | 3275 swap_buffers_tokens_.push(helper_->InsertToken()); |
| 3266 helper_->PostSubBufferCHROMIUM(x, y, width, height); | 3276 helper_->PostSubBufferCHROMIUM(x, y, width, height); |
| 3267 helper_->CommandBufferHelper::Flush(); | 3277 helper_->CommandBufferHelper::Flush(); |
| 3268 if (swap_buffers_tokens_.size() > kMaxSwapBuffers + 1) { | 3278 if (swap_buffers_tokens_.size() > kMaxSwapBuffers + 1) { |
| 3269 helper_->WaitForToken(swap_buffers_tokens_.front()); | 3279 helper_->WaitForToken(swap_buffers_tokens_.front()); |
| 3270 swap_buffers_tokens_.pop(); | 3280 swap_buffers_tokens_.pop(); |
| 3271 } | 3281 } |
| 3272 } | 3282 } |
| 3273 | 3283 |
| 3284 void GLES2Implementation::ScheduleOverlayPlaneCHROMIUM( |
| 3285 GLint plane_z_order, |
| 3286 GLenum plane_transform, |
| 3287 GLuint overlay_texture_id, |
| 3288 GLint bounds_x, |
| 3289 GLint bounds_y, |
| 3290 GLint bounds_width, |
| 3291 GLint bounds_height, |
| 3292 GLfloat uv_x, |
| 3293 GLfloat uv_y, |
| 3294 GLfloat uv_width, |
| 3295 GLfloat uv_height) { |
| 3296 helper_->ScheduleOverlayPlaneCHROMIUM(plane_z_order, |
| 3297 plane_transform, |
| 3298 overlay_texture_id, |
| 3299 bounds_x, |
| 3300 bounds_y, |
| 3301 bounds_width, |
| 3302 bounds_height, |
| 3303 uv_x, |
| 3304 uv_y, |
| 3305 uv_width, |
| 3306 uv_height); |
| 3307 } |
| 3308 |
| 3274 void GLES2Implementation::DeleteQueriesEXTHelper( | 3309 void GLES2Implementation::DeleteQueriesEXTHelper( |
| 3275 GLsizei n, const GLuint* queries) { | 3310 GLsizei n, const GLuint* queries) { |
| 3276 // TODO(gman): Remove this as queries are not shared resources. | 3311 // TODO(gman): Remove this as queries are not shared resources. |
| 3277 if (!GetIdHandler(id_namespaces::kQueries)->FreeIds( | 3312 if (!GetIdHandler(id_namespaces::kQueries)->FreeIds( |
| 3278 this, n, queries, &GLES2Implementation::DeleteQueriesStub)) { | 3313 this, n, queries, &GLES2Implementation::DeleteQueriesStub)) { |
| 3279 SetGLError( | 3314 SetGLError( |
| 3280 GL_INVALID_VALUE, | 3315 GL_INVALID_VALUE, |
| 3281 "glDeleteTextures", "id not created by this context."); | 3316 "glDeleteTextures", "id not created by this context."); |
| 3282 return; | 3317 return; |
| 3283 } | 3318 } |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4055 CheckGLError(); | 4090 CheckGLError(); |
| 4056 } | 4091 } |
| 4057 | 4092 |
| 4058 // Include the auto-generated part of this file. We split this because it means | 4093 // Include the auto-generated part of this file. We split this because it means |
| 4059 // we can easily edit the non-auto generated parts right here in this file | 4094 // we can easily edit the non-auto generated parts right here in this file |
| 4060 // instead of having to edit some template or the code generator. | 4095 // instead of having to edit some template or the code generator. |
| 4061 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 4096 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 4062 | 4097 |
| 4063 } // namespace gles2 | 4098 } // namespace gles2 |
| 4064 } // namespace gpu | 4099 } // namespace gpu |
| OLD | NEW |