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 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1627 } | 1627 } |
1628 | 1628 |
1629 DELEGATE_TO_GL_1R(isVertexArrayOES, IsVertexArrayOES, WebGLId, WGC3Dboolean) | 1629 DELEGATE_TO_GL_1R(isVertexArrayOES, IsVertexArrayOES, WebGLId, WGC3Dboolean) |
1630 DELEGATE_TO_GL_1(bindVertexArrayOES, BindVertexArrayOES, WebGLId) | 1630 DELEGATE_TO_GL_1(bindVertexArrayOES, BindVertexArrayOES, WebGLId) |
1631 | 1631 |
1632 DELEGATE_TO_GL_2(bindTexImage2DCHROMIUM, BindTexImage2DCHROMIUM, | 1632 DELEGATE_TO_GL_2(bindTexImage2DCHROMIUM, BindTexImage2DCHROMIUM, |
1633 WGC3Denum, WGC3Dint) | 1633 WGC3Denum, WGC3Dint) |
1634 DELEGATE_TO_GL_2(releaseTexImage2DCHROMIUM, ReleaseTexImage2DCHROMIUM, | 1634 DELEGATE_TO_GL_2(releaseTexImage2DCHROMIUM, ReleaseTexImage2DCHROMIUM, |
1635 WGC3Denum, WGC3Dint) | 1635 WGC3Denum, WGC3Dint) |
1636 | 1636 |
| 1637 void* WebGraphicsContext3DCommandBufferImpl::mapBufferCHROMIUM( |
| 1638 WGC3Denum target, WGC3Denum access) { |
| 1639 return gl_->MapBufferCHROMIUM(target, access); |
| 1640 } |
| 1641 |
| 1642 WGC3Dboolean WebGraphicsContext3DCommandBufferImpl::unmapBufferCHROMIUM( |
| 1643 WGC3Denum target) { |
| 1644 return gl_->UnmapBufferCHROMIUM(target); |
| 1645 } |
| 1646 |
1637 GrGLInterface* WebGraphicsContext3DCommandBufferImpl::onCreateGrGLInterface() { | 1647 GrGLInterface* WebGraphicsContext3DCommandBufferImpl::onCreateGrGLInterface() { |
1638 return webkit_glue::CreateCommandBufferSkiaGLBinding(); | 1648 return webkit_glue::CreateCommandBufferSkiaGLBinding(); |
1639 } | 1649 } |
1640 | 1650 |
1641 namespace { | 1651 namespace { |
1642 | 1652 |
1643 WGC3Denum convertReason(gpu::error::ContextLostReason reason) { | 1653 WGC3Denum convertReason(gpu::error::ContextLostReason reason) { |
1644 switch (reason) { | 1654 switch (reason) { |
1645 case gpu::error::kGuilty: | 1655 case gpu::error::kGuilty: |
1646 return GL_GUILTY_CONTEXT_RESET_ARB; | 1656 return GL_GUILTY_CONTEXT_RESET_ARB; |
(...skipping 23 matching lines...) Expand all Loading... |
1670 | 1680 |
1671 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1681 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1672 const std::string& message, int id) { | 1682 const std::string& message, int id) { |
1673 if (error_message_callback_) { | 1683 if (error_message_callback_) { |
1674 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1684 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
1675 error_message_callback_->onErrorMessage(str, id); | 1685 error_message_callback_->onErrorMessage(str, id); |
1676 } | 1686 } |
1677 } | 1687 } |
1678 | 1688 |
1679 } // namespace content | 1689 } // namespace content |
OLD | NEW |