| 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 "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 5 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <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 15 matching lines...) Expand all Loading... |
| 26 #include "base/string_tokenizer.h" | 26 #include "base/string_tokenizer.h" |
| 27 #include "base/synchronization/lock.h" | 27 #include "base/synchronization/lock.h" |
| 28 #include "gpu/command_buffer/client/gles2_implementation.h" | 28 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 29 #include "gpu/command_buffer/client/gles2_lib.h" | 29 #include "gpu/command_buffer/client/gles2_lib.h" |
| 30 #include "gpu/command_buffer/client/transfer_buffer.h" | 30 #include "gpu/command_buffer/client/transfer_buffer.h" |
| 31 #include "gpu/command_buffer/common/constants.h" | 31 #include "gpu/command_buffer/common/constants.h" |
| 32 #include "gpu/command_buffer/service/command_buffer_service.h" | 32 #include "gpu/command_buffer/service/command_buffer_service.h" |
| 33 #include "gpu/command_buffer/service/context_group.h" | 33 #include "gpu/command_buffer/service/context_group.h" |
| 34 #include "gpu/command_buffer/service/transfer_buffer_manager.h" | 34 #include "gpu/command_buffer/service/transfer_buffer_manager.h" |
| 35 #include "gpu/command_buffer/service/gpu_scheduler.h" | 35 #include "gpu/command_buffer/service/gpu_scheduler.h" |
| 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | |
| 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | |
| 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | |
| 39 #include "ui/gl/gl_context.h" | 36 #include "ui/gl/gl_context.h" |
| 40 #include "ui/gl/gl_share_group.h" | 37 #include "ui/gl/gl_share_group.h" |
| 41 #include "ui/gl/gl_surface.h" | 38 #include "ui/gl/gl_surface.h" |
| 42 #include "webkit/glue/gl_bindings_skia_cmd_buffer.h" | 39 #include "webkit/gpu/gl_bindings_skia_cmd_buffer.h" |
| 43 | 40 |
| 44 using gpu::Buffer; | 41 using gpu::Buffer; |
| 45 using gpu::CommandBuffer; | 42 using gpu::CommandBuffer; |
| 46 using gpu::CommandBufferService; | 43 using gpu::CommandBufferService; |
| 47 using gpu::gles2::GLES2CmdHelper; | 44 using gpu::gles2::GLES2CmdHelper; |
| 48 using gpu::gles2::GLES2Implementation; | 45 using gpu::gles2::GLES2Implementation; |
| 49 using gpu::GpuScheduler; | 46 using gpu::GpuScheduler; |
| 50 using gpu::TransferBuffer; | 47 using gpu::TransferBuffer; |
| 51 using gpu::TransferBufferManager; | 48 using gpu::TransferBufferManager; |
| 52 using gpu::TransferBufferManagerInterface; | 49 using gpu::TransferBufferManagerInterface; |
| (...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1650 } | 1647 } |
| 1651 | 1648 |
| 1652 WGC3Dboolean WebGraphicsContext3DInProcessCommandBufferImpl:: | 1649 WGC3Dboolean WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 1653 unmapBufferCHROMIUM(WGC3Denum target) { | 1650 unmapBufferCHROMIUM(WGC3Denum target) { |
| 1654 ClearContext(); | 1651 ClearContext(); |
| 1655 return gl_->UnmapBufferCHROMIUM(target); | 1652 return gl_->UnmapBufferCHROMIUM(target); |
| 1656 } | 1653 } |
| 1657 | 1654 |
| 1658 GrGLInterface* WebGraphicsContext3DInProcessCommandBufferImpl:: | 1655 GrGLInterface* WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 1659 onCreateGrGLInterface() { | 1656 onCreateGrGLInterface() { |
| 1660 return webkit_glue::CreateCommandBufferSkiaGLBinding(); | 1657 return CreateCommandBufferSkiaGLBinding(); |
| 1661 } | 1658 } |
| 1662 | 1659 |
| 1663 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { | 1660 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { |
| 1664 // TODO(kbr): improve the precision here. | 1661 // TODO(kbr): improve the precision here. |
| 1665 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; | 1662 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; |
| 1666 if (context_lost_callback_) { | 1663 if (context_lost_callback_) { |
| 1667 context_lost_callback_->onContextLost(); | 1664 context_lost_callback_->onContextLost(); |
| 1668 } | 1665 } |
| 1669 } | 1666 } |
| 1670 | 1667 |
| 1671 DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM, | 1668 DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM, |
| 1672 WebGLId, WGC3Dint, const WGC3Dchar*) | 1669 WebGLId, WGC3Dint, const WGC3Dchar*) |
| 1673 | 1670 |
| 1674 DELEGATE_TO_GL(shallowFlushCHROMIUM, ShallowFlushCHROMIUM) | 1671 DELEGATE_TO_GL(shallowFlushCHROMIUM, ShallowFlushCHROMIUM) |
| 1675 | 1672 |
| 1676 DELEGATE_TO_GL_1(genMailboxCHROMIUM, GenMailboxCHROMIUM, WGC3Dbyte*) | 1673 DELEGATE_TO_GL_1(genMailboxCHROMIUM, GenMailboxCHROMIUM, WGC3Dbyte*) |
| 1677 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, | 1674 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, |
| 1678 WGC3Denum, const WGC3Dbyte*) | 1675 WGC3Denum, const WGC3Dbyte*) |
| 1679 DELEGATE_TO_GL_2(consumeTextureCHROMIUM, ConsumeTextureCHROMIUM, | 1676 DELEGATE_TO_GL_2(consumeTextureCHROMIUM, ConsumeTextureCHROMIUM, |
| 1680 WGC3Denum, const WGC3Dbyte*) | 1677 WGC3Denum, const WGC3Dbyte*) |
| 1681 | 1678 |
| 1682 } // namespace gpu | 1679 } // namespace gpu |
| 1683 } // namespace webkit | 1680 } // namespace webkit |
| OLD | NEW |