| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
| 16 #include "cc/blink/context_provider_web_context.h" | |
| 17 #include "cc/output/context_provider.h" | 16 #include "cc/output/context_provider.h" |
| 18 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 19 #include "content/common/gpu/client/command_buffer_metrics.h" | 18 #include "content/common/gpu/client/command_buffer_metrics.h" |
| 20 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 19 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 21 #include "gpu/command_buffer/client/shared_memory_limits.h" | 20 #include "gpu/command_buffer/client/shared_memory_limits.h" |
| 22 | 21 |
| 23 namespace gpu { | 22 namespace gpu { |
| 24 class CommandBufferProxyImpl; | 23 class CommandBufferProxyImpl; |
| 25 namespace gles2 { | 24 namespace gles2 { |
| 26 class GLES2TraceImplementation; | 25 class GLES2TraceImplementation; |
| 27 } | 26 } |
| 28 } | 27 } |
| 29 | 28 |
| 30 namespace skia_bindings { | 29 namespace skia_bindings { |
| 31 class GrContextForGLES2Interface; | 30 class GrContextForGLES2Interface; |
| 32 } | 31 } |
| 33 | 32 |
| 34 namespace content { | 33 namespace content { |
| 35 | 34 |
| 36 // Implementation of cc::ContextProvider that provides a | 35 // Implementation of cc::ContextProvider that provides a |
| 37 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. | 36 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. |
| 38 class CONTENT_EXPORT ContextProviderCommandBuffer | 37 class CONTENT_EXPORT ContextProviderCommandBuffer |
| 39 : NON_EXPORTED_BASE(public cc_blink::ContextProviderWebContext) { | 38 : NON_EXPORTED_BASE(public cc::ContextProvider) { |
| 40 public: | 39 public: |
| 41 ContextProviderCommandBuffer( | 40 ContextProviderCommandBuffer( |
| 42 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, | 41 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, |
| 43 const gpu::SharedMemoryLimits& memory_limits, | 42 const gpu::SharedMemoryLimits& memory_limits, |
| 44 ContextProviderCommandBuffer* shared_context_provider, | 43 ContextProviderCommandBuffer* shared_context_provider, |
| 45 CommandBufferContextType type); | 44 CommandBufferContextType type); |
| 46 | 45 |
| 47 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); | 46 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
| 48 | 47 |
| 49 // cc_blink::ContextProviderWebContext implementation. | |
| 50 WebGraphicsContext3DCommandBufferImpl* WebContext3D() override; | |
| 51 | |
| 52 // cc::ContextProvider implementation. | 48 // cc::ContextProvider implementation. |
| 53 bool BindToCurrentThread() override; | 49 bool BindToCurrentThread() override; |
| 54 void DetachFromThread() override; | 50 void DetachFromThread() override; |
| 55 gpu::gles2::GLES2Interface* ContextGL() override; | 51 gpu::gles2::GLES2Interface* ContextGL() override; |
| 56 gpu::ContextSupport* ContextSupport() override; | 52 gpu::ContextSupport* ContextSupport() override; |
| 57 class GrContext* GrContext() override; | 53 class GrContext* GrContext() override; |
| 58 void InvalidateGrContext(uint32_t state) override; | 54 void InvalidateGrContext(uint32_t state) override; |
| 59 void SetupLock() override; | 55 void SetupLock() override; |
| 60 base::Lock* GetLock() override; | 56 base::Lock* GetLock() override; |
| 61 gpu::Capabilities ContextCapabilities() override; | 57 gpu::Capabilities ContextCapabilities() override; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 93 |
| 98 base::Lock context_lock_; | 94 base::Lock context_lock_; |
| 99 | 95 |
| 100 class LostContextCallbackProxy; | 96 class LostContextCallbackProxy; |
| 101 std::unique_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 97 std::unique_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
| 102 }; | 98 }; |
| 103 | 99 |
| 104 } // namespace content | 100 } // namespace content |
| 105 | 101 |
| 106 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 102 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
| OLD | NEW |