| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_ |
| 6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_ | 6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/web_input/synchronous_input_handler_proxy.h" |
| 9 #include "content/common/input/input_event_ack_state.h" | 10 #include "content/common/input/input_event_ack_state.h" |
| 10 #include "content/renderer/android/synchronous_compositor_external_begin_frame_s
ource.h" | 11 #include "content/renderer/android/synchronous_compositor_external_begin_frame_s
ource.h" |
| 11 #include "content/renderer/android/synchronous_compositor_output_surface.h" | 12 #include "content/renderer/android/synchronous_compositor_output_surface.h" |
| 12 #include "content/renderer/input/input_handler_manager_client.h" | 13 #include "content/renderer/input/input_handler_manager_client.h" |
| 13 #include "content/renderer/input/synchronous_input_handler_proxy.h" | |
| 14 #include "ui/gfx/geometry/scroll_offset.h" | 14 #include "ui/gfx/geometry/scroll_offset.h" |
| 15 #include "ui/gfx/geometry/size_f.h" | 15 #include "ui/gfx/geometry/size_f.h" |
| 16 | 16 |
| 17 namespace IPC { | 17 namespace IPC { |
| 18 class Message; | 18 class Message; |
| 19 class Sender; | 19 class Sender; |
| 20 } // namespace IPC | 20 } // namespace IPC |
| 21 | 21 |
| 22 namespace blink { | 22 namespace blink { |
| 23 class WebInputEvent; | 23 class WebInputEvent; |
| 24 } // namespace blink | 24 } // namespace blink |
| 25 | 25 |
| 26 namespace cc { | 26 namespace cc { |
| 27 class CompositorFrame; | 27 class CompositorFrame; |
| 28 } // namespace cc | 28 } // namespace cc |
| 29 | 29 |
| 30 namespace web_input { |
| 31 class SynchronousInputHandler; |
| 32 class SynchronousInputHandlerProxy; |
| 33 } // namespace web_input |
| 34 |
| 30 namespace content { | 35 namespace content { |
| 31 | 36 |
| 32 class SynchronousCompositorOutputSurface; | 37 class SynchronousCompositorOutputSurface; |
| 33 struct SyncCompositorCommonBrowserParams; | 38 struct SyncCompositorCommonBrowserParams; |
| 34 struct SyncCompositorCommonRendererParams; | 39 struct SyncCompositorCommonRendererParams; |
| 35 struct SyncCompositorDemandDrawHwParams; | 40 struct SyncCompositorDemandDrawHwParams; |
| 36 | 41 |
| 37 class SynchronousCompositorProxy | 42 class SynchronousCompositorProxy |
| 38 : public SynchronousInputHandler, | 43 : public web_input::SynchronousInputHandler, |
| 39 public SynchronousCompositorExternalBeginFrameSourceClient, | 44 public SynchronousCompositorExternalBeginFrameSourceClient, |
| 40 public SynchronousCompositorOutputSurfaceClient { | 45 public SynchronousCompositorOutputSurfaceClient { |
| 41 public: | 46 public: |
| 42 SynchronousCompositorProxy( | 47 SynchronousCompositorProxy( |
| 43 int routing_id, | 48 int routing_id, |
| 44 IPC::Sender* sender, | 49 IPC::Sender* sender, |
| 45 SynchronousCompositorOutputSurface* output_surface, | 50 SynchronousCompositorOutputSurface* output_surface, |
| 46 SynchronousCompositorExternalBeginFrameSource* begin_frame_source, | 51 SynchronousCompositorExternalBeginFrameSource* begin_frame_source, |
| 47 SynchronousInputHandlerProxy* input_handler_proxy, | 52 web_input::SynchronousInputHandlerProxy* input_handler_proxy, |
| 48 InputHandlerManagerClient::Handler* handler); | 53 InputHandlerManagerClient::Handler* handler); |
| 49 ~SynchronousCompositorProxy() override; | 54 ~SynchronousCompositorProxy() override; |
| 50 | 55 |
| 51 // SynchronousInputHandler overrides. | 56 // web_input::SynchronousInputHandler overrides. |
| 52 void SetNeedsSynchronousAnimateInput() override; | 57 void SetNeedsSynchronousAnimateInput() override; |
| 53 void UpdateRootLayerState(const gfx::ScrollOffset& total_scroll_offset, | 58 void UpdateRootLayerState(const gfx::ScrollOffset& total_scroll_offset, |
| 54 const gfx::ScrollOffset& max_scroll_offset, | 59 const gfx::ScrollOffset& max_scroll_offset, |
| 55 const gfx::SizeF& scrollable_size, | 60 const gfx::SizeF& scrollable_size, |
| 56 float page_scale_factor, | 61 float page_scale_factor, |
| 57 float min_page_scale_factor, | 62 float min_page_scale_factor, |
| 58 float max_page_scale_factor) override; | 63 float max_page_scale_factor) override; |
| 59 | 64 |
| 60 // SynchronousCompositorExternalBeginFrameSourceClient overrides. | 65 // SynchronousCompositorExternalBeginFrameSourceClient overrides. |
| 61 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; | 66 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 90 cc::CompositorFrame* frame); | 95 cc::CompositorFrame* frame); |
| 91 | 96 |
| 92 void DidActivatePendingTree(); | 97 void DidActivatePendingTree(); |
| 93 void DeliverMessages(); | 98 void DeliverMessages(); |
| 94 void SendAsyncRendererStateIfNeeded(); | 99 void SendAsyncRendererStateIfNeeded(); |
| 95 | 100 |
| 96 const int routing_id_; | 101 const int routing_id_; |
| 97 IPC::Sender* const sender_; | 102 IPC::Sender* const sender_; |
| 98 SynchronousCompositorOutputSurface* const output_surface_; | 103 SynchronousCompositorOutputSurface* const output_surface_; |
| 99 SynchronousCompositorExternalBeginFrameSource* const begin_frame_source_; | 104 SynchronousCompositorExternalBeginFrameSource* const begin_frame_source_; |
| 100 SynchronousInputHandlerProxy* const input_handler_proxy_; | 105 web_input::SynchronousInputHandlerProxy* const input_handler_proxy_; |
| 101 InputHandlerManagerClient::Handler* const input_handler_; | 106 InputHandlerManagerClient::Handler* const input_handler_; |
| 102 bool inside_receive_; | 107 bool inside_receive_; |
| 103 | 108 |
| 104 // From browser. | 109 // From browser. |
| 105 size_t bytes_limit_; | 110 size_t bytes_limit_; |
| 106 | 111 |
| 107 uint32_t version_; | 112 uint32_t version_; |
| 108 gfx::ScrollOffset total_scroll_offset_; // Modified by both. | 113 gfx::ScrollOffset total_scroll_offset_; // Modified by both. |
| 109 gfx::ScrollOffset max_scroll_offset_; | 114 gfx::ScrollOffset max_scroll_offset_; |
| 110 gfx::SizeF scrollable_size_; | 115 gfx::SizeF scrollable_size_; |
| 111 float page_scale_factor_; | 116 float page_scale_factor_; |
| 112 float min_page_scale_factor_; | 117 float min_page_scale_factor_; |
| 113 float max_page_scale_factor_; | 118 float max_page_scale_factor_; |
| 114 bool need_animate_scroll_; | 119 bool need_animate_scroll_; |
| 115 bool need_invalidate_; | 120 bool need_invalidate_; |
| 116 bool need_begin_frame_; | 121 bool need_begin_frame_; |
| 117 bool did_activate_pending_tree_; | 122 bool did_activate_pending_tree_; |
| 118 | 123 |
| 119 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorProxy); | 124 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorProxy); |
| 120 }; | 125 }; |
| 121 | 126 |
| 122 } // namespace content | 127 } // namespace content |
| 123 | 128 |
| 124 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_ | 129 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_ |
| OLD | NEW |