OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H _ | 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H _ |
6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H _ | 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H _ |
7 | 7 |
8 #include "base/synchronization/lock.h" | 8 #include "base/synchronization/lock.h" |
9 #include "content/browser/android/in_process/synchronous_input_event_filter.h" | 9 #include "content/browser/android/in_process/synchronous_input_event_filter.h" |
10 #include "content/renderer/android/synchronous_compositor_factory.h" | 10 #include "content/renderer/android/synchronous_compositor_factory.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 virtual ~SynchronousCompositorFactoryImpl(); | 34 virtual ~SynchronousCompositorFactoryImpl(); |
35 | 35 |
36 // SynchronousCompositorFactory | 36 // SynchronousCompositorFactory |
37 virtual scoped_refptr<base::MessageLoopProxy> GetCompositorMessageLoop() | 37 virtual scoped_refptr<base::MessageLoopProxy> GetCompositorMessageLoop() |
38 OVERRIDE; | 38 OVERRIDE; |
39 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(int routing_id) | 39 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(int routing_id) |
40 OVERRIDE; | 40 OVERRIDE; |
41 virtual InputHandlerManagerClient* GetInputHandlerManagerClient() OVERRIDE; | 41 virtual InputHandlerManagerClient* GetInputHandlerManagerClient() OVERRIDE; |
42 virtual scoped_refptr<webkit::gpu::ContextProviderWebContext> | 42 virtual scoped_refptr<webkit::gpu::ContextProviderWebContext> |
43 GetSharedOffscreenContextProviderForMainThread() OVERRIDE; | 43 GetSharedOffscreenContextProviderForMainThread() OVERRIDE; |
44 // This is called on both renderer main thread (offscreen context creation | 44 // This is called on the renderer compositor impl thread (InitializeHwDraw) in |
45 // path shared between cross-process and in-process platforms) and renderer | 45 // order to support Android WebView synchronously enable and disable hardware |
46 // compositor impl thread (InitializeHwDraw) in order to support Android | 46 // mode multiple times in the same task. |
47 // WebView synchronously enable and disable hardware mode multiple times in | |
48 // the same task. This is ok because in-process WGC3D creation may happen on | |
49 // any thread and is lightweight. | |
50 virtual scoped_refptr<cc::ContextProvider> | 47 virtual scoped_refptr<cc::ContextProvider> |
51 GetOffscreenContextProviderForCompositorThread() OVERRIDE; | 48 GetOffscreenContextProviderForCompositorThread() OVERRIDE; |
boliu
2014/04/24 00:28:57
Can remove virtual and OVERRIDE, otherwise clang w
danakj
2014/04/24 15:01:32
This method is still in the SynchronousCompositorF
danakj
2014/04/24 15:02:42
But it looks like I could remoev it from the inter
danakj
2014/04/24 15:04:07
This was me looking at my file without refreshing
| |
52 virtual scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory( | 49 virtual scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory( |
53 int view_id) OVERRIDE; | 50 int view_id) OVERRIDE; |
54 virtual blink::WebGraphicsContext3D* CreateOffscreenGraphicsContext3D( | 51 virtual blink::WebGraphicsContext3D* CreateOffscreenGraphicsContext3D( |
55 const blink::WebGraphicsContext3D::Attributes& attributes) OVERRIDE; | 52 const blink::WebGraphicsContext3D::Attributes& attributes) OVERRIDE; |
56 | 53 |
57 SynchronousInputEventFilter* synchronous_input_event_filter() { | 54 SynchronousInputEventFilter* synchronous_input_event_filter() { |
58 return &synchronous_input_event_filter_; | 55 return &synchronous_input_event_filter_; |
59 } | 56 } |
60 | 57 |
61 void SetDeferredGpuService( | 58 void SetDeferredGpuService( |
62 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); | 59 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); |
63 void CompositorInitializedHardwareDraw(); | 60 void CompositorInitializedHardwareDraw(); |
64 void CompositorReleasedHardwareDraw(); | 61 void CompositorReleasedHardwareDraw(); |
65 | 62 |
66 scoped_refptr<cc::ContextProvider> | 63 scoped_refptr<cc::ContextProvider> |
67 CreateOnscreenContextProviderForCompositorThread( | 64 CreateOnscreenContextProviderForCompositorThread( |
68 scoped_refptr<gfx::GLSurface> surface); | 65 scoped_refptr<gfx::GLSurface> surface); |
69 | 66 |
70 private: | 67 private: |
71 bool CanCreateMainThreadContext(); | 68 bool CanCreateMainThreadContext(); |
72 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> | 69 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> |
73 TryCreateStreamTextureFactory(); | 70 TryCreateStreamTextureFactory(); |
74 | 71 |
75 SynchronousInputEventFilter synchronous_input_event_filter_; | 72 SynchronousInputEventFilter synchronous_input_event_filter_; |
76 | 73 |
77 // Only guards construction and destruction of | |
78 // |offscreen_context_for_compositor_thread_|, not usage. | |
79 base::Lock offscreen_context_for_compositor_thread_lock_; | |
80 scoped_refptr<webkit::gpu::ContextProviderWebContext> | 74 scoped_refptr<webkit::gpu::ContextProviderWebContext> |
81 offscreen_context_for_main_thread_; | 75 offscreen_context_for_main_thread_; |
82 // This is a pointer to the context owned by | 76 // This is a pointer to the context owned by |
83 // |offscreen_context_for_main_thread_|. | 77 // |offscreen_context_for_main_thread_|. |
84 gpu::GLInProcessContext* wrapped_gl_context_for_compositor_thread_; | 78 gpu::GLInProcessContext* wrapped_gl_context_for_compositor_thread_; |
85 scoped_refptr<cc::ContextProvider> offscreen_context_for_compositor_thread_; | 79 scoped_refptr<cc::ContextProvider> offscreen_context_for_compositor_thread_; |
86 | 80 |
87 scoped_refptr<gpu::InProcessCommandBuffer::Service> service_; | 81 scoped_refptr<gpu::InProcessCommandBuffer::Service> service_; |
88 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> | 82 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> |
89 video_context_provider_; | 83 video_context_provider_; |
90 | 84 |
91 // |num_hardware_compositor_lock_| is updated on UI thread only but can be | 85 // |num_hardware_compositor_lock_| is updated on UI thread only but can be |
92 // read on renderer main thread. | 86 // read on renderer main thread. |
93 base::Lock num_hardware_compositor_lock_; | 87 base::Lock num_hardware_compositor_lock_; |
94 unsigned int num_hardware_compositors_; | 88 unsigned int num_hardware_compositors_; |
95 }; | 89 }; |
96 | 90 |
97 } // namespace content | 91 } // namespace content |
98 | 92 |
99 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP L_H_ | 93 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP L_H_ |
OLD | NEW |