OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "content/browser/android/synchronous_compositor_base.h" | 13 #include "content/browser/android/synchronous_compositor_base.h" |
14 #include "content/renderer/android/synchronous_compositor_external_begin_frame_s ource.h" | 14 #include "content/renderer/android/synchronous_compositor_external_begin_frame_s ource.h" |
15 #include "content/renderer/android/synchronous_compositor_output_surface.h" | 15 #include "content/renderer/android/synchronous_compositor_output_surface.h" |
16 #include "content/renderer/input/synchronous_input_handler_proxy.h" | |
17 #include "ipc/ipc_message.h" | 16 #include "ipc/ipc_message.h" |
17 #include "ui/events/blink/synchronous_input_handler_proxy.h" | |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 class InputHandler; | 20 class InputHandler; |
21 } | 21 } |
22 | 22 |
23 namespace ui { | |
boliu
2015/11/16 19:12:12
Not needed
Khushal
2015/11/16 21:12:49
Done.
| |
24 class SynchronousInputHandler; | |
25 class SynchronousInputHandlerProxy; | |
26 } | |
27 | |
23 namespace content { | 28 namespace content { |
24 class InputHandlerManager; | 29 class InputHandlerManager; |
25 class RenderWidgetHostViewAndroid; | 30 class RenderWidgetHostViewAndroid; |
26 class SynchronousCompositorExternalBeginFrameSource; | 31 class SynchronousCompositorExternalBeginFrameSource; |
27 struct DidOverscrollParams; | 32 struct DidOverscrollParams; |
28 | 33 |
29 // The purpose of this class is to act as the intermediary between the various | 34 // The purpose of this class is to act as the intermediary between the various |
30 // components that make up the 'synchronous compositor mode' implementation and | 35 // components that make up the 'synchronous compositor mode' implementation and |
31 // expose their functionality via the SynchronousCompositor interface. | 36 // expose their functionality via the SynchronousCompositor interface. |
32 // This class is created on the main thread but most of the APIs are called | 37 // This class is created on the main thread but most of the APIs are called |
33 // from the Compositor thread. | 38 // from the Compositor thread. |
34 class SynchronousCompositorImpl | 39 class SynchronousCompositorImpl |
35 : public SynchronousInputHandler, | 40 : public ui::SynchronousInputHandler, |
36 public SynchronousCompositorBase, | 41 public SynchronousCompositorBase, |
37 public SynchronousCompositorExternalBeginFrameSourceClient, | 42 public SynchronousCompositorExternalBeginFrameSourceClient, |
38 public SynchronousCompositorOutputSurfaceClient { | 43 public SynchronousCompositorOutputSurfaceClient { |
39 public: | 44 public: |
40 // For handling upcalls from renderer code; the process id | 45 // For handling upcalls from renderer code; the process id |
41 // is implicitly that of the in-process renderer. | 46 // is implicitly that of the in-process renderer. |
42 static SynchronousCompositorImpl* FromRoutingID(int routing_id); | 47 static SynchronousCompositorImpl* FromRoutingID(int routing_id); |
43 | 48 |
44 static void SetGpuServiceInProc( | 49 static void SetGpuServiceInProc( |
45 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); | 50 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); |
46 | 51 |
47 ~SynchronousCompositorImpl() override; | 52 ~SynchronousCompositorImpl() override; |
48 | 53 |
49 // Called by SynchronousCompositorRegistry. | 54 // Called by SynchronousCompositorRegistry. |
50 void DidInitializeRendererObjects( | 55 void DidInitializeRendererObjects( |
51 SynchronousCompositorOutputSurface* output_surface, | 56 SynchronousCompositorOutputSurface* output_surface, |
52 SynchronousCompositorExternalBeginFrameSource* begin_frame_source, | 57 SynchronousCompositorExternalBeginFrameSource* begin_frame_source, |
53 SynchronousInputHandlerProxy* synchronous_input_handler_proxy); | 58 ui::SynchronousInputHandlerProxy* synchronous_input_handler_proxy); |
54 void DidDestroyRendererObjects(); | 59 void DidDestroyRendererObjects(); |
55 | 60 |
56 // SynchronousCompositorExternalBeginFrameSourceClient overrides. | 61 // SynchronousCompositorExternalBeginFrameSourceClient overrides. |
57 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; | 62 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; |
58 | 63 |
59 // SynchronousCompositorOutputSurfaceClient overrides. | 64 // SynchronousCompositorOutputSurfaceClient overrides. |
60 void Invalidate() override; | 65 void Invalidate() override; |
61 | 66 |
62 // SynchronousCompositor overrides. | 67 // SynchronousCompositor overrides. |
63 scoped_ptr<cc::CompositorFrame> DemandDrawHw( | 68 scoped_ptr<cc::CompositorFrame> DemandDrawHw( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 void DidActivatePendingTree(); | 107 void DidActivatePendingTree(); |
103 void DeliverMessages(); | 108 void DeliverMessages(); |
104 bool CalledOnValidThread() const; | 109 bool CalledOnValidThread() const; |
105 void UpdateNeedsBeginFrames(); | 110 void UpdateNeedsBeginFrames(); |
106 | 111 |
107 RenderWidgetHostViewAndroid* const rwhva_; | 112 RenderWidgetHostViewAndroid* const rwhva_; |
108 const int routing_id_; | 113 const int routing_id_; |
109 SynchronousCompositorClient* const compositor_client_; | 114 SynchronousCompositorClient* const compositor_client_; |
110 SynchronousCompositorOutputSurface* output_surface_; | 115 SynchronousCompositorOutputSurface* output_surface_; |
111 SynchronousCompositorExternalBeginFrameSource* begin_frame_source_; | 116 SynchronousCompositorExternalBeginFrameSource* begin_frame_source_; |
112 SynchronousInputHandlerProxy* synchronous_input_handler_proxy_; | 117 ui::SynchronousInputHandlerProxy* synchronous_input_handler_proxy_; |
113 bool registered_with_client_; | 118 bool registered_with_client_; |
114 bool is_active_; | 119 bool is_active_; |
115 bool renderer_needs_begin_frames_; | 120 bool renderer_needs_begin_frames_; |
116 bool need_animate_input_; | 121 bool need_animate_input_; |
117 | 122 |
118 base::WeakPtrFactory<SynchronousCompositorImpl> weak_ptr_factory_; | 123 base::WeakPtrFactory<SynchronousCompositorImpl> weak_ptr_factory_; |
119 | 124 |
120 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); | 125 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); |
121 }; | 126 }; |
122 | 127 |
123 } // namespace content | 128 } // namespace content |
124 | 129 |
125 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 130 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
OLD | NEW |