| 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 scoped_ptr< |
| 1630 WebKit::WebGraphicsContext3D::WebGraphicsSyncPointCallback> callback) { |
| 1631 callback->onSyncPointReached(); |
| 1632 } |
| 1633 |
| 1634 void WebGraphicsContext3DCommandBufferImpl::signalSyncPoint( |
| 1635 unsigned sync_point, |
| 1636 WebGraphicsSyncPointCallback* callback) { |
| 1637 // Take ownership of the callback. |
| 1638 scoped_ptr<WebGraphicsSyncPointCallback> own_callback(callback); |
| 1639 command_buffer_->SignalSyncPoint( |
| 1640 sync_point, |
| 1641 base::Bind(&SignalSyncPointCallback, base::Passed(&own_callback))); |
| 1642 } |
| 1643 |
| 1628 void WebGraphicsContext3DCommandBufferImpl::genMailboxCHROMIUM( | 1644 void WebGraphicsContext3DCommandBufferImpl::genMailboxCHROMIUM( |
| 1629 WGC3Dbyte* name) { | 1645 WGC3Dbyte* name) { |
| 1630 std::vector<gpu::Mailbox> names(1); | 1646 std::vector<gpu::Mailbox> names(1); |
| 1631 if (command_buffer_->GenerateMailboxNames(1, &names)) | 1647 if (command_buffer_->GenerateMailboxNames(1, &names)) |
| 1632 memcpy(name, names[0].name, GL_MAILBOX_SIZE_CHROMIUM); | 1648 memcpy(name, names[0].name, GL_MAILBOX_SIZE_CHROMIUM); |
| 1633 else | 1649 else |
| 1634 synthesizeGLError(GL_OUT_OF_MEMORY); | 1650 synthesizeGLError(GL_OUT_OF_MEMORY); |
| 1635 } | 1651 } |
| 1636 | 1652 |
| 1637 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, | 1653 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1757 | 1773 |
| 1758 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1774 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
| 1759 const std::string& message, int id) { | 1775 const std::string& message, int id) { |
| 1760 if (error_message_callback_) { | 1776 if (error_message_callback_) { |
| 1761 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1777 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
| 1762 error_message_callback_->onErrorMessage(str, id); | 1778 error_message_callback_->onErrorMessage(str, id); |
| 1763 } | 1779 } |
| 1764 } | 1780 } |
| 1765 | 1781 |
| 1766 } // namespace content | 1782 } // namespace content |
| OLD | NEW |