| 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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| 11 #include "base/threading/thread_checker.h" | 11 #include "base/threading/thread_checker.h" |
| 12 #include "cc/blink/context_provider_web_context.h" | 12 #include "cc/blink/context_provider_web_context.h" |
| 13 #include "cc/output/context_provider.h" | 13 #include "cc/output/context_provider.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/common/gpu/client/command_buffer_metrics.h" | 15 #include "content/common/gpu/client/command_buffer_metrics.h" |
| 16 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 16 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 17 | 17 |
| 18 namespace base { |
| 19 class SingleThreadTaskRunner; |
| 20 } |
| 21 |
| 18 namespace content { | 22 namespace content { |
| 19 | 23 |
| 20 class GrContextForWebGraphicsContext3D; | 24 class GrContextForWebGraphicsContext3D; |
| 21 | 25 |
| 22 // Implementation of cc::ContextProvider that provides a | 26 // Implementation of cc::ContextProvider that provides a |
| 23 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. | 27 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. |
| 24 class CONTENT_EXPORT ContextProviderCommandBuffer | 28 class CONTENT_EXPORT ContextProviderCommandBuffer |
| 25 : NON_EXPORTED_BASE(public cc_blink::ContextProviderWebContext) { | 29 : NON_EXPORTED_BASE(public cc_blink::ContextProviderWebContext) { |
| 26 public: | 30 public: |
| 27 static scoped_refptr<ContextProviderCommandBuffer> Create( | 31 static scoped_refptr<ContextProviderCommandBuffer> Create( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 void OnLostContext(); | 65 void OnLostContext(); |
| 62 void OnMemoryAllocationChanged(const gpu::MemoryAllocation& allocation); | 66 void OnMemoryAllocationChanged(const gpu::MemoryAllocation& allocation); |
| 63 | 67 |
| 64 private: | 68 private: |
| 65 void InitializeCapabilities(); | 69 void InitializeCapabilities(); |
| 66 | 70 |
| 67 base::ThreadChecker main_thread_checker_; | 71 base::ThreadChecker main_thread_checker_; |
| 68 base::ThreadChecker context_thread_checker_; | 72 base::ThreadChecker context_thread_checker_; |
| 69 | 73 |
| 70 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; | 74 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; |
| 75 scoped_refptr<base::SingleThreadTaskRunner> context3d_task_runner_; |
| 76 |
| 71 scoped_ptr<GrContextForWebGraphicsContext3D> gr_context_; | 77 scoped_ptr<GrContextForWebGraphicsContext3D> gr_context_; |
| 72 | 78 |
| 73 cc::ContextProvider::Capabilities capabilities_; | 79 cc::ContextProvider::Capabilities capabilities_; |
| 74 CommandBufferContextType context_type_; | 80 CommandBufferContextType context_type_; |
| 75 std::string debug_name_; | 81 std::string debug_name_; |
| 76 | 82 |
| 77 LostContextCallback lost_context_callback_; | 83 LostContextCallback lost_context_callback_; |
| 78 MemoryPolicyChangedCallback memory_policy_changed_callback_; | 84 MemoryPolicyChangedCallback memory_policy_changed_callback_; |
| 79 | 85 |
| 80 base::Lock main_thread_lock_; | 86 base::Lock main_thread_lock_; |
| 81 bool destroyed_; | 87 bool destroyed_; |
| 82 | 88 |
| 83 base::Lock context_lock_; | 89 base::Lock context_lock_; |
| 84 | 90 |
| 85 class LostContextCallbackProxy; | 91 class LostContextCallbackProxy; |
| 86 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 92 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
| 87 }; | 93 }; |
| 88 | 94 |
| 89 } // namespace content | 95 } // namespace content |
| 90 | 96 |
| 91 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 97 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
| OLD | NEW |