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 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
15 #include "cc/blink/context_provider_web_context.h" | 15 #include "cc/blink/context_provider_web_context.h" |
16 #include "cc/output/context_provider.h" | 16 #include "cc/output/context_provider.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
18 #include "content/common/gpu/client/command_buffer_metrics.h" | 18 #include "content/common/gpu/client/command_buffer_metrics.h" |
19 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 19 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
20 #include "gpu/command_buffer/client/shared_memory_limits.h" | 20 #include "gpu/command_buffer/client/shared_memory_limits.h" |
21 | 21 |
| 22 namespace gpu { |
| 23 class CommandBufferProxyImpl; |
| 24 namespace gles2 { |
| 25 class GLES2TraceImplementation; |
| 26 } |
| 27 } |
| 28 |
22 namespace skia_bindings { | 29 namespace skia_bindings { |
23 class GrContextForGLES2Interface; | 30 class GrContextForGLES2Interface; |
24 } // namespace skia_bindings | 31 } |
25 | 32 |
26 namespace content { | 33 namespace content { |
27 | 34 |
28 // Implementation of cc::ContextProvider that provides a | 35 // Implementation of cc::ContextProvider that provides a |
29 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. | 36 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. |
30 class CONTENT_EXPORT ContextProviderCommandBuffer | 37 class CONTENT_EXPORT ContextProviderCommandBuffer |
31 : NON_EXPORTED_BASE(public cc_blink::ContextProviderWebContext) { | 38 : NON_EXPORTED_BASE(public cc_blink::ContextProviderWebContext) { |
32 public: | 39 public: |
33 ContextProviderCommandBuffer( | 40 ContextProviderCommandBuffer( |
34 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, | 41 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, |
(...skipping 22 matching lines...) Expand all Loading... |
57 protected: | 64 protected: |
58 ~ContextProviderCommandBuffer() override; | 65 ~ContextProviderCommandBuffer() override; |
59 | 66 |
60 void OnLostContext(); | 67 void OnLostContext(); |
61 | 68 |
62 private: | 69 private: |
63 base::ThreadChecker main_thread_checker_; | 70 base::ThreadChecker main_thread_checker_; |
64 base::ThreadChecker context_thread_checker_; | 71 base::ThreadChecker context_thread_checker_; |
65 | 72 |
66 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; | 73 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; |
| 74 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; |
67 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; | 75 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
68 | 76 |
69 gpu::SharedMemoryLimits memory_limits_; | 77 gpu::SharedMemoryLimits memory_limits_; |
70 CommandBufferContextType context_type_; | 78 CommandBufferContextType context_type_; |
71 std::string debug_name_; | 79 std::string debug_name_; |
72 | 80 |
73 LostContextCallback lost_context_callback_; | 81 LostContextCallback lost_context_callback_; |
74 | 82 |
75 base::Lock context_lock_; | 83 base::Lock context_lock_; |
76 | 84 |
77 class LostContextCallbackProxy; | 85 class LostContextCallbackProxy; |
78 std::unique_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 86 std::unique_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
79 }; | 87 }; |
80 | 88 |
81 } // namespace content | 89 } // namespace content |
82 | 90 |
83 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 91 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
OLD | NEW |