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 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 GL_UNSIGNED_BYTE); | 1618 GL_UNSIGNED_BYTE); |
1619 } | 1619 } |
1620 | 1620 |
1621 DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM, | 1621 DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM, |
1622 WebGLId, WGC3Dint, const WGC3Dchar*) | 1622 WebGLId, WGC3Dint, const WGC3Dchar*) |
1623 | 1623 |
1624 DELEGATE_TO_GL(shallowFlushCHROMIUM,ShallowFlushCHROMIUM); | 1624 DELEGATE_TO_GL(shallowFlushCHROMIUM,ShallowFlushCHROMIUM); |
1625 | 1625 |
1626 DELEGATE_TO_GL_1(waitSyncPoint, WaitSyncPointCHROMIUM, GLuint) | 1626 DELEGATE_TO_GL_1(waitSyncPoint, WaitSyncPointCHROMIUM, GLuint) |
1627 | 1627 |
| 1628 static void SignalSyncPointCallback( |
| 1629 WebKit::WebGraphicsContext3D::WebGraphicsSyncPointCallback* callback) { |
| 1630 callback->onSyncPointReached(); |
| 1631 } |
| 1632 |
| 1633 void WebGraphicsContext3DCommandBufferImpl::signalSyncPoint( |
| 1634 unsigned sync_point, |
| 1635 WebGraphicsSyncPointCallback* callback) { |
| 1636 command_buffer_->SignalSyncPoint( |
| 1637 sync_point, base::Bind(&SignalSyncPointCallback, callback)); |
| 1638 } |
| 1639 |
1628 void WebGraphicsContext3DCommandBufferImpl::genMailboxCHROMIUM( | 1640 void WebGraphicsContext3DCommandBufferImpl::genMailboxCHROMIUM( |
1629 WGC3Dbyte* name) { | 1641 WGC3Dbyte* name) { |
1630 std::vector<gpu::Mailbox> names(1); | 1642 std::vector<gpu::Mailbox> names(1); |
1631 if (command_buffer_->GenerateMailboxNames(1, &names)) | 1643 if (command_buffer_->GenerateMailboxNames(1, &names)) |
1632 memcpy(name, names[0].name, GL_MAILBOX_SIZE_CHROMIUM); | 1644 memcpy(name, names[0].name, GL_MAILBOX_SIZE_CHROMIUM); |
1633 else | 1645 else |
1634 synthesizeGLError(GL_OUT_OF_MEMORY); | 1646 synthesizeGLError(GL_OUT_OF_MEMORY); |
1635 } | 1647 } |
1636 | 1648 |
1637 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, | 1649 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1757 | 1769 |
1758 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1770 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1759 const std::string& message, int id) { | 1771 const std::string& message, int id) { |
1760 if (error_message_callback_) { | 1772 if (error_message_callback_) { |
1761 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1773 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
1762 error_message_callback_->onErrorMessage(str, id); | 1774 error_message_callback_->onErrorMessage(str, id); |
1763 } | 1775 } |
1764 } | 1776 } |
1765 | 1777 |
1766 } // namespace content | 1778 } // namespace content |
OLD | NEW |