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 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 void* WebGraphicsContext3DCommandBufferImpl::mapBufferCHROMIUM( | 1637 void* WebGraphicsContext3DCommandBufferImpl::mapBufferCHROMIUM( |
1638 WGC3Denum target, WGC3Denum access) { | 1638 WGC3Denum target, WGC3Denum access) { |
1639 return gl_->MapBufferCHROMIUM(target, access); | 1639 return gl_->MapBufferCHROMIUM(target, access); |
1640 } | 1640 } |
1641 | 1641 |
1642 WGC3Dboolean WebGraphicsContext3DCommandBufferImpl::unmapBufferCHROMIUM( | 1642 WGC3Dboolean WebGraphicsContext3DCommandBufferImpl::unmapBufferCHROMIUM( |
1643 WGC3Denum target) { | 1643 WGC3Denum target) { |
1644 return gl_->UnmapBufferCHROMIUM(target); | 1644 return gl_->UnmapBufferCHROMIUM(target); |
1645 } | 1645 } |
1646 | 1646 |
| 1647 void WebGraphicsContext3DCommandBufferImpl::asyncTexImage2DCHROMIUM( |
| 1648 WGC3Denum target, |
| 1649 WGC3Dint level, |
| 1650 WGC3Denum internalformat, |
| 1651 WGC3Dsizei width, |
| 1652 WGC3Dsizei height, |
| 1653 WGC3Dint border, |
| 1654 WGC3Denum format, |
| 1655 WGC3Denum type, |
| 1656 const void* pixels) { |
| 1657 return gl_->AsyncTexImage2DCHROMIUM( |
| 1658 target, level, internalformat, |
| 1659 width, height, border, format, type, pixels); |
| 1660 } |
| 1661 |
| 1662 void WebGraphicsContext3DCommandBufferImpl::asyncTexSubImage2DCHROMIUM( |
| 1663 WGC3Denum target, |
| 1664 WGC3Dint level, |
| 1665 WGC3Dint xoffset, |
| 1666 WGC3Dint yoffset, |
| 1667 WGC3Dsizei width, |
| 1668 WGC3Dsizei height, |
| 1669 WGC3Denum format, |
| 1670 WGC3Denum type, |
| 1671 const void *pixels) { |
| 1672 return gl_->AsyncTexSubImage2DCHROMIUM( |
| 1673 target, level, xoffset, yoffset, |
| 1674 width, height, format, type, pixels); |
| 1675 } |
| 1676 |
1647 GrGLInterface* WebGraphicsContext3DCommandBufferImpl::onCreateGrGLInterface() { | 1677 GrGLInterface* WebGraphicsContext3DCommandBufferImpl::onCreateGrGLInterface() { |
1648 return webkit::gpu::CreateCommandBufferSkiaGLBinding(); | 1678 return webkit::gpu::CreateCommandBufferSkiaGLBinding(); |
1649 } | 1679 } |
1650 | 1680 |
1651 namespace { | 1681 namespace { |
1652 | 1682 |
1653 WGC3Denum convertReason(gpu::error::ContextLostReason reason) { | 1683 WGC3Denum convertReason(gpu::error::ContextLostReason reason) { |
1654 switch (reason) { | 1684 switch (reason) { |
1655 case gpu::error::kGuilty: | 1685 case gpu::error::kGuilty: |
1656 return GL_GUILTY_CONTEXT_RESET_ARB; | 1686 return GL_GUILTY_CONTEXT_RESET_ARB; |
(...skipping 23 matching lines...) Expand all Loading... |
1680 | 1710 |
1681 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1711 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1682 const std::string& message, int id) { | 1712 const std::string& message, int id) { |
1683 if (error_message_callback_) { | 1713 if (error_message_callback_) { |
1684 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1714 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
1685 error_message_callback_->onErrorMessage(str, id); | 1715 error_message_callback_->onErrorMessage(str, id); |
1686 } | 1716 } |
1687 } | 1717 } |
1688 | 1718 |
1689 } // namespace content | 1719 } // namespace content |
OLD | NEW |