| 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 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2774 CheckGLError(); | 2774 CheckGLError(); |
| 2775 } | 2775 } |
| 2776 | 2776 |
| 2777 void GLES2Implementation::Swap() { | 2777 void GLES2Implementation::Swap() { |
| 2778 SwapBuffers(); | 2778 SwapBuffers(); |
| 2779 gpu_control_->Echo( | 2779 gpu_control_->Echo( |
| 2780 base::Bind(&GLES2Implementation::OnSwapBuffersComplete, | 2780 base::Bind(&GLES2Implementation::OnSwapBuffersComplete, |
| 2781 weak_ptr_factory_.GetWeakPtr())); | 2781 weak_ptr_factory_.GetWeakPtr())); |
| 2782 } | 2782 } |
| 2783 | 2783 |
| 2784 void GLES2Implementation::PartialSwapBuffers(gfx::Rect sub_buffer) { | 2784 void GLES2Implementation::PartialSwapBuffers(const gfx::Rect& sub_buffer) { |
| 2785 PostSubBufferCHROMIUM(sub_buffer.x(), | 2785 PostSubBufferCHROMIUM(sub_buffer.x(), |
| 2786 sub_buffer.y(), | 2786 sub_buffer.y(), |
| 2787 sub_buffer.width(), | 2787 sub_buffer.width(), |
| 2788 sub_buffer.height()); | 2788 sub_buffer.height()); |
| 2789 gpu_control_->Echo(base::Bind(&GLES2Implementation::OnSwapBuffersComplete, | 2789 gpu_control_->Echo(base::Bind(&GLES2Implementation::OnSwapBuffersComplete, |
| 2790 weak_ptr_factory_.GetWeakPtr())); | 2790 weak_ptr_factory_.GetWeakPtr())); |
| 2791 } | 2791 } |
| 2792 | 2792 |
| 2793 void GLES2Implementation::SetSwapBuffersCompleteCallback( | 2793 void GLES2Implementation::SetSwapBuffersCompleteCallback( |
| 2794 const base::Closure& swap_buffers_complete_callback) { | 2794 const base::Closure& swap_buffers_complete_callback) { |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3917 CheckGLError(); | 3917 CheckGLError(); |
| 3918 } | 3918 } |
| 3919 | 3919 |
| 3920 // Include the auto-generated part of this file. We split this because it means | 3920 // Include the auto-generated part of this file. We split this because it means |
| 3921 // we can easily edit the non-auto generated parts right here in this file | 3921 // we can easily edit the non-auto generated parts right here in this file |
| 3922 // instead of having to edit some template or the code generator. | 3922 // instead of having to edit some template or the code generator. |
| 3923 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 3923 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 3924 | 3924 |
| 3925 } // namespace gles2 | 3925 } // namespace gles2 |
| 3926 } // namespace gpu | 3926 } // namespace gpu |
| OLD | NEW |