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 "cc/blink/context_provider_web_context.h" | 9 #include "cc/blink/context_provider_web_context.h" |
10 #include "content/browser/android/in_process/synchronous_input_event_filter.h" | 10 #include "content/browser/android/in_process/synchronous_input_event_filter.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory { | 33 class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory { |
34 public: | 34 public: |
35 SynchronousCompositorFactoryImpl(); | 35 SynchronousCompositorFactoryImpl(); |
36 ~SynchronousCompositorFactoryImpl() override; | 36 ~SynchronousCompositorFactoryImpl() override; |
37 | 37 |
38 // SynchronousCompositorFactory | 38 // SynchronousCompositorFactory |
39 scoped_refptr<base::SingleThreadTaskRunner> GetCompositorTaskRunner() | 39 scoped_refptr<base::SingleThreadTaskRunner> GetCompositorTaskRunner() |
40 override; | 40 override; |
41 scoped_ptr<cc::OutputSurface> CreateOutputSurface( | 41 scoped_ptr<cc::OutputSurface> CreateOutputSurface( |
42 int routing_id, | 42 int routing_id, |
43 scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) | 43 const scoped_refptr<FrameSwapMessageQueue>& frame_swap_message_queue, |
44 override; | 44 const scoped_refptr<cc::ContextProvider>& onscreen_context, |
| 45 const scoped_refptr<cc::ContextProvider>& worker_context) override; |
45 InputHandlerManagerClient* GetInputHandlerManagerClient() override; | 46 InputHandlerManagerClient* GetInputHandlerManagerClient() override; |
46 scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( | 47 scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( |
47 int routing_id) override; | 48 int routing_id) override; |
48 scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory( | 49 scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory( |
49 int view_id) override; | 50 int view_id) override; |
50 | 51 |
51 SynchronousInputEventFilter* synchronous_input_event_filter() { | 52 SynchronousInputEventFilter* synchronous_input_event_filter() { |
52 return &synchronous_input_event_filter_; | 53 return &synchronous_input_event_filter_; |
53 } | 54 } |
54 | 55 |
55 void SetDeferredGpuService( | 56 void SetDeferredGpuService( |
56 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); | 57 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); |
57 base::Thread* CreateInProcessGpuThread( | 58 base::Thread* CreateInProcessGpuThread( |
58 const InProcessChildThreadParams& params); | 59 const InProcessChildThreadParams& params); |
59 void CompositorInitializedHardwareDraw(); | 60 void CompositorInitializedHardwareDraw(); |
60 void CompositorReleasedHardwareDraw(); | 61 void CompositorReleasedHardwareDraw(); |
61 | 62 |
62 | 63 |
63 private: | 64 private: |
64 scoped_refptr<cc::ContextProvider> CreateContextProviderForCompositor( | |
65 int surface_id, | |
66 CommandBufferContextType type); | |
67 scoped_refptr<cc::ContextProvider> GetSharedWorkerContextProvider(); | 65 scoped_refptr<cc::ContextProvider> GetSharedWorkerContextProvider(); |
68 bool CanCreateMainThreadContext(); | 66 bool CanCreateMainThreadContext(); |
69 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> | 67 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> |
70 TryCreateStreamTextureFactory(); | 68 TryCreateStreamTextureFactory(); |
71 void RestoreContextOnMainThread(); | 69 void RestoreContextOnMainThread(); |
72 | 70 |
73 SynchronousInputEventFilter synchronous_input_event_filter_; | 71 SynchronousInputEventFilter synchronous_input_event_filter_; |
74 | 72 |
75 scoped_refptr<gpu::InProcessCommandBuffer::Service> android_view_service_; | 73 scoped_refptr<gpu::InProcessCommandBuffer::Service> android_view_service_; |
76 | 74 |
77 class VideoContextProvider; | 75 class VideoContextProvider; |
78 scoped_refptr<VideoContextProvider> video_context_provider_; | 76 scoped_refptr<VideoContextProvider> video_context_provider_; |
79 | 77 |
80 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_; | |
81 | |
82 // |num_hardware_compositor_lock_| is updated on UI thread only but can be | 78 // |num_hardware_compositor_lock_| is updated on UI thread only but can be |
83 // read on renderer main thread. | 79 // read on renderer main thread. |
84 base::Lock num_hardware_compositor_lock_; | 80 base::Lock num_hardware_compositor_lock_; |
85 unsigned int num_hardware_compositors_; | 81 unsigned int num_hardware_compositors_; |
86 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 82 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
87 }; | 83 }; |
88 | 84 |
89 } // namespace content | 85 } // namespace content |
90 | 86 |
91 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP
L_H_ | 87 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP
L_H_ |
OLD | NEW |