| 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 | 20 |
| 21 namespace skia_bindings { |
| 22 class GrContextForGLES2Interface; |
| 23 } // namespace skia_bindings |
| 24 |
| 21 namespace content { | 25 namespace content { |
| 22 | 26 |
| 23 class GrContextForGLES2Interface; | |
| 24 | |
| 25 // Implementation of cc::ContextProvider that provides a | 27 // Implementation of cc::ContextProvider that provides a |
| 26 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. | 28 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. |
| 27 class CONTENT_EXPORT ContextProviderCommandBuffer | 29 class CONTENT_EXPORT ContextProviderCommandBuffer |
| 28 : NON_EXPORTED_BASE(public cc_blink::ContextProviderWebContext) { | 30 : NON_EXPORTED_BASE(public cc_blink::ContextProviderWebContext) { |
| 29 public: | 31 public: |
| 30 static scoped_refptr<ContextProviderCommandBuffer> Create( | 32 static scoped_refptr<ContextProviderCommandBuffer> Create( |
| 31 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, | 33 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, |
| 32 CommandBufferContextType type); | 34 CommandBufferContextType type); |
| 33 | 35 |
| 34 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); | 36 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 58 | 60 |
| 59 void OnLostContext(); | 61 void OnLostContext(); |
| 60 | 62 |
| 61 private: | 63 private: |
| 62 void InitializeCapabilities(); | 64 void InitializeCapabilities(); |
| 63 | 65 |
| 64 base::ThreadChecker main_thread_checker_; | 66 base::ThreadChecker main_thread_checker_; |
| 65 base::ThreadChecker context_thread_checker_; | 67 base::ThreadChecker context_thread_checker_; |
| 66 | 68 |
| 67 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; | 69 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; |
| 68 std::unique_ptr<GrContextForGLES2Interface> gr_context_; | 70 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
| 69 | 71 |
| 70 cc::ContextProvider::Capabilities capabilities_; | 72 cc::ContextProvider::Capabilities capabilities_; |
| 71 CommandBufferContextType context_type_; | 73 CommandBufferContextType context_type_; |
| 72 std::string debug_name_; | 74 std::string debug_name_; |
| 73 | 75 |
| 74 LostContextCallback lost_context_callback_; | 76 LostContextCallback lost_context_callback_; |
| 75 | 77 |
| 76 base::Lock context_lock_; | 78 base::Lock context_lock_; |
| 77 | 79 |
| 78 class LostContextCallbackProxy; | 80 class LostContextCallbackProxy; |
| 79 std::unique_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 81 std::unique_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 } // namespace content | 84 } // namespace content |
| 83 | 85 |
| 84 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 86 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
| OLD | NEW |