| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
| 6 | 6 |
| 7 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 7 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #ifndef GL_GLEXT_PROTOTYPES | 10 #ifndef GL_GLEXT_PROTOTYPES |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 } | 901 } |
| 902 | 902 |
| 903 void WebGraphicsContext3DInProcessCommandBufferImpl::unmapTexSubImage2DCHROMIUM( | 903 void WebGraphicsContext3DInProcessCommandBufferImpl::unmapTexSubImage2DCHROMIUM( |
| 904 const void* mem) { | 904 const void* mem) { |
| 905 ClearContext(); | 905 ClearContext(); |
| 906 gl_->UnmapTexSubImage2DCHROMIUM(mem); | 906 gl_->UnmapTexSubImage2DCHROMIUM(mem); |
| 907 } | 907 } |
| 908 | 908 |
| 909 void WebGraphicsContext3DInProcessCommandBufferImpl:: | 909 void WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 910 copyTextureToParentTextureCHROMIUM(WebGLId texture, WebGLId parentTexture) { | 910 copyTextureToParentTextureCHROMIUM(WebGLId texture, WebGLId parentTexture) { |
| 911 // TODO(gmam): See if we can comment this in. | 911 NOTIMPLEMENTED(); |
| 912 // ClearContext(); | |
| 913 copyTextureToCompositor(texture, parentTexture); | |
| 914 } | 912 } |
| 915 | 913 |
| 916 void WebGraphicsContext3DInProcessCommandBufferImpl:: | 914 void WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 917 rateLimitOffscreenContextCHROMIUM() { | 915 rateLimitOffscreenContextCHROMIUM() { |
| 918 // TODO(gmam): See if we can comment this in. | 916 // TODO(gmam): See if we can comment this in. |
| 919 // ClearContext(); | 917 // ClearContext(); |
| 920 gl_->RateLimitOffscreenContextCHROMIUM(); | 918 gl_->RateLimitOffscreenContextCHROMIUM(); |
| 921 } | 919 } |
| 922 | 920 |
| 923 WebKit::WebString WebGraphicsContext3DInProcessCommandBufferImpl:: | 921 WebKit::WebString WebGraphicsContext3DInProcessCommandBufferImpl:: |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 } | 1592 } |
| 1595 | 1593 |
| 1596 void WebGraphicsContext3DInProcessCommandBufferImpl::deleteTexture( | 1594 void WebGraphicsContext3DInProcessCommandBufferImpl::deleteTexture( |
| 1597 WebGLId texture) { | 1595 WebGLId texture) { |
| 1598 ClearContext(); | 1596 ClearContext(); |
| 1599 gl_->DeleteTextures(1, &texture); | 1597 gl_->DeleteTextures(1, &texture); |
| 1600 } | 1598 } |
| 1601 | 1599 |
| 1602 void WebGraphicsContext3DInProcessCommandBufferImpl::copyTextureToCompositor( | 1600 void WebGraphicsContext3DInProcessCommandBufferImpl::copyTextureToCompositor( |
| 1603 WebGLId texture, WebGLId parentTexture) { | 1601 WebGLId texture, WebGLId parentTexture) { |
| 1604 // TODO(gmam): See if we can comment this in. | 1602 NOTIMPLEMENTED(); |
| 1605 // ClearContext(); | |
| 1606 gl_->CopyTextureToParentTextureCHROMIUM(texture, parentTexture); | |
| 1607 gl_->Flush(); | |
| 1608 } | 1603 } |
| 1609 | 1604 |
| 1610 void WebGraphicsContext3DInProcessCommandBufferImpl::OnSwapBuffersComplete() { | 1605 void WebGraphicsContext3DInProcessCommandBufferImpl::OnSwapBuffersComplete() { |
| 1611 } | 1606 } |
| 1612 | 1607 |
| 1613 void WebGraphicsContext3DInProcessCommandBufferImpl::setContextLostCallback( | 1608 void WebGraphicsContext3DInProcessCommandBufferImpl::setContextLostCallback( |
| 1614 WebGraphicsContext3D::WebGraphicsContextLostCallback* cb) | 1609 WebGraphicsContext3D::WebGraphicsContextLostCallback* cb) |
| 1615 { | 1610 { |
| 1616 context_lost_callback_ = cb; | 1611 context_lost_callback_ = cb; |
| 1617 } | 1612 } |
| 1618 | 1613 |
| 1619 WGC3Denum WebGraphicsContext3DInProcessCommandBufferImpl:: | 1614 WGC3Denum WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 1620 getGraphicsResetStatusARB() { | 1615 getGraphicsResetStatusARB() { |
| 1621 return context_lost_reason_; | 1616 return context_lost_reason_; |
| 1622 } | 1617 } |
| 1623 | 1618 |
| 1624 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { | 1619 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { |
| 1625 // TODO(kbr): improve the precision here. | 1620 // TODO(kbr): improve the precision here. |
| 1626 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; | 1621 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; |
| 1627 if (context_lost_callback_) { | 1622 if (context_lost_callback_) { |
| 1628 context_lost_callback_->onContextLost(); | 1623 context_lost_callback_->onContextLost(); |
| 1629 } | 1624 } |
| 1630 } | 1625 } |
| 1631 | 1626 |
| 1632 } // namespace gpu | 1627 } // namespace gpu |
| 1633 } // namespace webkit | 1628 } // namespace webkit |
| 1634 | 1629 |
| 1635 #endif // defined(ENABLE_GPU) | 1630 #endif // defined(ENABLE_GPU) |
| 1636 | 1631 |
| OLD | NEW |