| 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_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ | 6 #define CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace blink { | 27 namespace blink { |
| 28 class WebInputEvent; | 28 class WebInputEvent; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace cc { | 31 namespace cc { |
| 32 struct BeginFrameArgs; | 32 struct BeginFrameArgs; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace ui { | 35 namespace ui { |
| 36 class WindowAndroid; | 36 class WindowAndroid; |
| 37 struct DidOverscrollParams; |
| 37 } | 38 } |
| 38 | 39 |
| 39 namespace content { | 40 namespace content { |
| 40 | 41 |
| 41 class RenderWidgetHostViewAndroid; | 42 class RenderWidgetHostViewAndroid; |
| 42 class SynchronousCompositorClient; | 43 class SynchronousCompositorClient; |
| 43 class SynchronousCompositorObserver; | 44 class SynchronousCompositorObserver; |
| 44 class WebContents; | 45 class WebContents; |
| 45 struct DidOverscrollParams; | |
| 46 struct SyncCompositorCommonRendererParams; | 46 struct SyncCompositorCommonRendererParams; |
| 47 | 47 |
| 48 class SynchronousCompositorHost : public SynchronousCompositor { | 48 class SynchronousCompositorHost : public SynchronousCompositor { |
| 49 public: | 49 public: |
| 50 static std::unique_ptr<SynchronousCompositorHost> Create( | 50 static std::unique_ptr<SynchronousCompositorHost> Create( |
| 51 RenderWidgetHostViewAndroid* rwhva, | 51 RenderWidgetHostViewAndroid* rwhva, |
| 52 WebContents* web_contents); | 52 WebContents* web_contents); |
| 53 | 53 |
| 54 ~SynchronousCompositorHost() override; | 54 ~SynchronousCompositorHost() override; |
| 55 | 55 |
| 56 // SynchronousCompositor overrides. | 56 // SynchronousCompositor overrides. |
| 57 SynchronousCompositor::Frame DemandDrawHw( | 57 SynchronousCompositor::Frame DemandDrawHw( |
| 58 const gfx::Size& viewport_size, | 58 const gfx::Size& viewport_size, |
| 59 const gfx::Rect& viewport_rect_for_tile_priority, | 59 const gfx::Rect& viewport_rect_for_tile_priority, |
| 60 const gfx::Transform& transform_for_tile_priority) override; | 60 const gfx::Transform& transform_for_tile_priority) override; |
| 61 bool DemandDrawSw(SkCanvas* canvas) override; | 61 bool DemandDrawSw(SkCanvas* canvas) override; |
| 62 void ReturnResources(uint32_t output_surface_id, | 62 void ReturnResources(uint32_t output_surface_id, |
| 63 const cc::ReturnedResourceArray& resources) override; | 63 const cc::ReturnedResourceArray& resources) override; |
| 64 void SetMemoryPolicy(size_t bytes_limit) override; | 64 void SetMemoryPolicy(size_t bytes_limit) override; |
| 65 void DidChangeRootLayerScrollOffset( | 65 void DidChangeRootLayerScrollOffset( |
| 66 const gfx::ScrollOffset& root_offset) override; | 66 const gfx::ScrollOffset& root_offset) override; |
| 67 void SynchronouslyZoomBy(float zoom_delta, const gfx::Point& anchor) override; | 67 void SynchronouslyZoomBy(float zoom_delta, const gfx::Point& anchor) override; |
| 68 void OnComputeScroll(base::TimeTicks animation_time) override; | 68 void OnComputeScroll(base::TimeTicks animation_time) override; |
| 69 | 69 |
| 70 void DidOverscroll(const DidOverscrollParams& over_scroll_params); | 70 void DidOverscroll(const ui::DidOverscrollParams& over_scroll_params); |
| 71 void DidSendBeginFrame(ui::WindowAndroid* window_android); | 71 void DidSendBeginFrame(ui::WindowAndroid* window_android); |
| 72 bool OnMessageReceived(const IPC::Message& message); | 72 bool OnMessageReceived(const IPC::Message& message); |
| 73 | 73 |
| 74 // Called by SynchronousCompositorObserver. | 74 // Called by SynchronousCompositorObserver. |
| 75 int routing_id() const { return routing_id_; } | 75 int routing_id() const { return routing_id_; } |
| 76 void ProcessCommonParams(const SyncCompositorCommonRendererParams& params); | 76 void ProcessCommonParams(const SyncCompositorCommonRendererParams& params); |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 class ScopedSendZeroMemory; | 79 class ScopedSendZeroMemory; |
| 80 struct SharedMemoryWithSize; | 80 struct SharedMemoryWithSize; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 110 bool need_animate_scroll_; | 110 bool need_animate_scroll_; |
| 111 uint32_t need_invalidate_count_; | 111 uint32_t need_invalidate_count_; |
| 112 uint32_t did_activate_pending_tree_count_; | 112 uint32_t did_activate_pending_tree_count_; |
| 113 | 113 |
| 114 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorHost); | 114 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorHost); |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // namespace content | 117 } // namespace content |
| 118 | 118 |
| 119 #endif // CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ | 119 #endif // CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ |
| OLD | NEW |