| 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 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 5 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 6 | 6 |
| 7 #include "third_party/khronos/GLES2/gl2.h" | 7 #include "third_party/khronos/GLES2/gl2.h" |
| 8 #ifndef GL_GLEXT_PROTOTYPES | 8 #ifndef GL_GLEXT_PROTOTYPES |
| 9 #define GL_GLEXT_PROTOTYPES 1 | 9 #define GL_GLEXT_PROTOTYPES 1 |
| 10 #endif | 10 #endif |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 WGC3Dintptr offset) { | 903 WGC3Dintptr offset) { |
| 904 gl_->DrawElements( | 904 gl_->DrawElements( |
| 905 mode, count, type, | 905 mode, count, type, |
| 906 reinterpret_cast<void*>(static_cast<intptr_t>(offset))); | 906 reinterpret_cast<void*>(static_cast<intptr_t>(offset))); |
| 907 } | 907 } |
| 908 | 908 |
| 909 DELEGATE_TO_GL_1(enable, Enable, WGC3Denum) | 909 DELEGATE_TO_GL_1(enable, Enable, WGC3Denum) |
| 910 | 910 |
| 911 DELEGATE_TO_GL_1(enableVertexAttribArray, EnableVertexAttribArray, | 911 DELEGATE_TO_GL_1(enableVertexAttribArray, EnableVertexAttribArray, |
| 912 WGC3Duint) | 912 WGC3Duint) |
| 913 | 913 // |
| 914 void WebGraphicsContext3DCommandBufferImpl::finish() { | 914 //void WebGraphicsContext3DCommandBufferImpl::finish() { |
| 915 gl_->Finish(); | 915 // gl_->Finish(); |
| 916 if (!visible_ && free_command_buffer_when_invisible_) | 916 // if (!visible_ && free_command_buffer_when_invisible_) |
| 917 real_gl_->FreeEverything(); | 917 // real_gl_->FreeEverything(); |
| 918 } | 918 //} |
| 919 | 919 |
| 920 void WebGraphicsContext3DCommandBufferImpl::flush() { | 920 void WebGraphicsContext3DCommandBufferImpl::flush() { |
| 921 gl_->Flush(); | 921 gl_->Flush(); |
| 922 if (!visible_ && free_command_buffer_when_invisible_) | 922 if (!visible_ && free_command_buffer_when_invisible_) |
| 923 real_gl_->FreeEverything(); | 923 real_gl_->FreeEverything(); |
| 924 } | 924 } |
| 925 | 925 |
| 926 DELEGATE_TO_GL_4(framebufferRenderbuffer, FramebufferRenderbuffer, | 926 DELEGATE_TO_GL_4(framebufferRenderbuffer, FramebufferRenderbuffer, |
| 927 WGC3Denum, WGC3Denum, WGC3Denum, WebGLId) | 927 WGC3Denum, WGC3Denum, WGC3Denum, WebGLId) |
| 928 | 928 |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1660 | 1660 |
| 1661 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1661 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
| 1662 const std::string& message, int id) { | 1662 const std::string& message, int id) { |
| 1663 if (error_message_callback_) { | 1663 if (error_message_callback_) { |
| 1664 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1664 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
| 1665 error_message_callback_->onErrorMessage(str, id); | 1665 error_message_callback_->onErrorMessage(str, id); |
| 1666 } | 1666 } |
| 1667 } | 1667 } |
| 1668 | 1668 |
| 1669 } // namespace content | 1669 } // namespace content |
| OLD | NEW |