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_BROWSER_ANDROID_IN_PROCESS_CONTEXT_PROVIDER_IN_PROCESS_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_CONTEXT_PROVIDER_IN_PROCESS_H_ |
6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_CONTEXT_PROVIDER_IN_PROCESS_H_ | 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_CONTEXT_PROVIDER_IN_PROCESS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.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" | 16 #include "cc/blink/context_provider_web_context.h" |
17 | 17 |
18 namespace blink { class WebGraphicsContext3D; } | 18 namespace blink { class WebGraphicsContext3D; } |
19 | 19 |
20 namespace gpu_blink { | 20 namespace gpu_blink { |
21 class WebGraphicsContext3DInProcessCommandBufferImpl; | 21 class WebGraphicsContext3DInProcessCommandBufferImpl; |
22 } | 22 } |
23 | 23 |
| 24 namespace skia_bindings { |
| 25 class GrContextForGLES2Interface; |
| 26 } |
| 27 |
24 namespace content { | 28 namespace content { |
25 | 29 |
26 class GrContextForGLES2Interface; | |
27 | |
28 class ContextProviderInProcess | 30 class ContextProviderInProcess |
29 : NON_EXPORTED_BASE(public cc_blink::ContextProviderWebContext) { | 31 : NON_EXPORTED_BASE(public cc_blink::ContextProviderWebContext) { |
30 public: | 32 public: |
31 static scoped_refptr<ContextProviderInProcess> Create( | 33 static scoped_refptr<ContextProviderInProcess> Create( |
32 std::unique_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl> | 34 std::unique_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl> |
33 context3d, | 35 context3d, |
34 const std::string& debug_name); | 36 const std::string& debug_name); |
35 | 37 |
36 private: | 38 private: |
37 ContextProviderInProcess( | 39 ContextProviderInProcess( |
(...skipping 20 matching lines...) Expand all Loading... |
58 const LostContextCallback& lost_context_callback) override; | 60 const LostContextCallback& lost_context_callback) override; |
59 | 61 |
60 void OnLostContext(); | 62 void OnLostContext(); |
61 void InitializeCapabilities(); | 63 void InitializeCapabilities(); |
62 | 64 |
63 base::ThreadChecker main_thread_checker_; | 65 base::ThreadChecker main_thread_checker_; |
64 base::ThreadChecker context_thread_checker_; | 66 base::ThreadChecker context_thread_checker_; |
65 | 67 |
66 std::unique_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl> | 68 std::unique_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl> |
67 context3d_; | 69 context3d_; |
68 std::unique_ptr<GrContextForGLES2Interface> gr_context_; | 70 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
69 | 71 |
70 LostContextCallback lost_context_callback_; | 72 LostContextCallback lost_context_callback_; |
71 | 73 |
72 base::Lock context_lock_; | 74 base::Lock context_lock_; |
73 std::string debug_name_; | 75 std::string debug_name_; |
74 class LostContextCallbackProxy; | 76 class LostContextCallbackProxy; |
75 std::unique_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 77 std::unique_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
76 | 78 |
77 cc::ContextProvider::Capabilities capabilities_; | 79 cc::ContextProvider::Capabilities capabilities_; |
78 | 80 |
79 DISALLOW_COPY_AND_ASSIGN(ContextProviderInProcess); | 81 DISALLOW_COPY_AND_ASSIGN(ContextProviderInProcess); |
80 }; | 82 }; |
81 | 83 |
82 } // namespace content | 84 } // namespace content |
83 | 85 |
84 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_CONTEXT_PROVIDER_IN_PROCESS_H_ | 86 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_CONTEXT_PROVIDER_IN_PROCESS_H_ |
OLD | NEW |