| 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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 } | 910 } |
| 911 | 911 |
| 912 void WebGraphicsContext3DInProcessCommandBufferImpl::unmapTexSubImage2DCHROMIUM( | 912 void WebGraphicsContext3DInProcessCommandBufferImpl::unmapTexSubImage2DCHROMIUM( |
| 913 const void* mem) { | 913 const void* mem) { |
| 914 ClearContext(); | 914 ClearContext(); |
| 915 gl_->UnmapTexSubImage2DCHROMIUM(mem); | 915 gl_->UnmapTexSubImage2DCHROMIUM(mem); |
| 916 } | 916 } |
| 917 | 917 |
| 918 void WebGraphicsContext3DInProcessCommandBufferImpl:: | 918 void WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 919 copyTextureToParentTextureCHROMIUM(WebGLId texture, WebGLId parentTexture) { | 919 copyTextureToParentTextureCHROMIUM(WebGLId texture, WebGLId parentTexture) { |
| 920 // TODO(gmam): See if we can comment this in. | 920 NOTIMPLEMENTED(); |
| 921 // ClearContext(); | |
| 922 copyTextureToCompositor(texture, parentTexture); | |
| 923 } | 921 } |
| 924 | 922 |
| 925 void WebGraphicsContext3DInProcessCommandBufferImpl:: | 923 void WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 926 rateLimitOffscreenContextCHROMIUM() { | 924 rateLimitOffscreenContextCHROMIUM() { |
| 927 // TODO(gmam): See if we can comment this in. | 925 // TODO(gmam): See if we can comment this in. |
| 928 // ClearContext(); | 926 // ClearContext(); |
| 929 gl_->RateLimitOffscreenContextCHROMIUM(); | 927 gl_->RateLimitOffscreenContextCHROMIUM(); |
| 930 } | 928 } |
| 931 | 929 |
| 932 WebKit::WebString WebGraphicsContext3DInProcessCommandBufferImpl:: | 930 WebKit::WebString WebGraphicsContext3DInProcessCommandBufferImpl:: |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 } | 1601 } |
| 1604 | 1602 |
| 1605 void WebGraphicsContext3DInProcessCommandBufferImpl::deleteTexture( | 1603 void WebGraphicsContext3DInProcessCommandBufferImpl::deleteTexture( |
| 1606 WebGLId texture) { | 1604 WebGLId texture) { |
| 1607 ClearContext(); | 1605 ClearContext(); |
| 1608 gl_->DeleteTextures(1, &texture); | 1606 gl_->DeleteTextures(1, &texture); |
| 1609 } | 1607 } |
| 1610 | 1608 |
| 1611 void WebGraphicsContext3DInProcessCommandBufferImpl::copyTextureToCompositor( | 1609 void WebGraphicsContext3DInProcessCommandBufferImpl::copyTextureToCompositor( |
| 1612 WebGLId texture, WebGLId parentTexture) { | 1610 WebGLId texture, WebGLId parentTexture) { |
| 1613 // TODO(gmam): See if we can comment this in. | 1611 NOTIMPLEMENTED(); |
| 1614 // ClearContext(); | |
| 1615 gl_->CopyTextureToParentTextureCHROMIUM(texture, parentTexture); | |
| 1616 gl_->Flush(); | |
| 1617 } | 1612 } |
| 1618 | 1613 |
| 1619 void WebGraphicsContext3DInProcessCommandBufferImpl::OnSwapBuffersComplete() { | 1614 void WebGraphicsContext3DInProcessCommandBufferImpl::OnSwapBuffersComplete() { |
| 1620 } | 1615 } |
| 1621 | 1616 |
| 1622 void WebGraphicsContext3DInProcessCommandBufferImpl::setContextLostCallback( | 1617 void WebGraphicsContext3DInProcessCommandBufferImpl::setContextLostCallback( |
| 1623 WebGraphicsContext3D::WebGraphicsContextLostCallback* cb) | 1618 WebGraphicsContext3D::WebGraphicsContextLostCallback* cb) |
| 1624 { | 1619 { |
| 1625 context_lost_callback_ = cb; | 1620 context_lost_callback_ = cb; |
| 1626 } | 1621 } |
| 1627 | 1622 |
| 1628 WGC3Denum WebGraphicsContext3DInProcessCommandBufferImpl:: | 1623 WGC3Denum WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 1629 getGraphicsResetStatusARB() { | 1624 getGraphicsResetStatusARB() { |
| 1630 return context_lost_reason_; | 1625 return context_lost_reason_; |
| 1631 } | 1626 } |
| 1632 | 1627 |
| 1633 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { | 1628 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { |
| 1634 // TODO(kbr): improve the precision here. | 1629 // TODO(kbr): improve the precision here. |
| 1635 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; | 1630 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; |
| 1636 if (context_lost_callback_) { | 1631 if (context_lost_callback_) { |
| 1637 context_lost_callback_->onContextLost(); | 1632 context_lost_callback_->onContextLost(); |
| 1638 } | 1633 } |
| 1639 } | 1634 } |
| 1640 | 1635 |
| 1641 } // namespace gpu | 1636 } // namespace gpu |
| 1642 } // namespace webkit | 1637 } // namespace webkit |
| 1643 | 1638 |
| 1644 #endif // defined(ENABLE_GPU) | 1639 #endif // defined(ENABLE_GPU) |
| 1645 | 1640 |
| OLD | NEW |