| 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 class RenderWidgetHostViewAndroid; | 35 class RenderWidgetHostViewAndroid; |
| 36 class SynchronousCompositorClient; | 36 class SynchronousCompositorClient; |
| 37 class SynchronousCompositorBrowserFilter; | 37 class SynchronousCompositorBrowserFilter; |
| 38 class WebContents; | 38 class WebContents; |
| 39 struct SyncCompositorCommonRendererParams; | 39 struct SyncCompositorCommonRendererParams; |
| 40 | 40 |
| 41 class SynchronousCompositorHost : public SynchronousCompositor { | 41 class SynchronousCompositorHost : public SynchronousCompositor { |
| 42 public: | 42 public: |
| 43 static std::unique_ptr<SynchronousCompositorHost> Create( | 43 static std::unique_ptr<SynchronousCompositorHost> Create( |
| 44 RenderWidgetHostViewAndroid* rwhva); | 44 RenderWidgetHostViewAndroid* rwhva, |
| 45 WebContents* web_contents); |
| 45 | 46 |
| 46 ~SynchronousCompositorHost() override; | 47 ~SynchronousCompositorHost() override; |
| 47 | 48 |
| 48 // SynchronousCompositor overrides. | 49 // SynchronousCompositor overrides. |
| 49 SynchronousCompositor::Frame DemandDrawHw( | 50 SynchronousCompositor::Frame DemandDrawHw( |
| 50 const gfx::Size& viewport_size, | 51 const gfx::Size& viewport_size, |
| 51 const gfx::Rect& viewport_rect_for_tile_priority, | 52 const gfx::Rect& viewport_rect_for_tile_priority, |
| 52 const gfx::Transform& transform_for_tile_priority) override; | 53 const gfx::Transform& transform_for_tile_priority) override; |
| 53 scoped_refptr<FrameFuture> DemandDrawHwAsync( | 54 scoped_refptr<FrameFuture> DemandDrawHwAsync( |
| 54 const gfx::Size& viewport_size, | 55 const gfx::Size& viewport_size, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 74 | 75 |
| 75 SynchronousCompositorClient* client() { return client_; } | 76 SynchronousCompositorClient* client() { return client_; } |
| 76 | 77 |
| 77 private: | 78 private: |
| 78 class ScopedSendZeroMemory; | 79 class ScopedSendZeroMemory; |
| 79 struct SharedMemoryWithSize; | 80 struct SharedMemoryWithSize; |
| 80 friend class ScopedSetZeroMemory; | 81 friend class ScopedSetZeroMemory; |
| 81 friend class SynchronousCompositorBase; | 82 friend class SynchronousCompositorBase; |
| 82 | 83 |
| 83 SynchronousCompositorHost(RenderWidgetHostViewAndroid* rwhva, | 84 SynchronousCompositorHost(RenderWidgetHostViewAndroid* rwhva, |
| 85 SynchronousCompositorClient* client, |
| 84 bool use_in_proc_software_draw); | 86 bool use_in_proc_software_draw); |
| 85 void CompositorFrameSinkCreated(); | 87 void CompositorFrameSinkCreated(); |
| 86 bool DemandDrawSwInProc(SkCanvas* canvas); | 88 bool DemandDrawSwInProc(SkCanvas* canvas); |
| 87 void SetSoftwareDrawSharedMemoryIfNeeded(size_t stride, size_t buffer_size); | 89 void SetSoftwareDrawSharedMemoryIfNeeded(size_t stride, size_t buffer_size); |
| 88 void SendZeroMemory(); | 90 void SendZeroMemory(); |
| 89 SynchronousCompositorBrowserFilter* GetFilter(); | 91 SynchronousCompositorBrowserFilter* GetFilter(); |
| 90 | 92 |
| 91 RenderWidgetHostViewAndroid* const rwhva_; | 93 RenderWidgetHostViewAndroid* const rwhva_; |
| 92 SynchronousCompositorClient* const client_; | 94 SynchronousCompositorClient* const client_; |
| 93 const scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 95 const scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 112 bool need_animate_scroll_; | 114 bool need_animate_scroll_; |
| 113 uint32_t need_invalidate_count_; | 115 uint32_t need_invalidate_count_; |
| 114 uint32_t did_activate_pending_tree_count_; | 116 uint32_t did_activate_pending_tree_count_; |
| 115 | 117 |
| 116 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorHost); | 118 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorHost); |
| 117 }; | 119 }; |
| 118 | 120 |
| 119 } // namespace content | 121 } // namespace content |
| 120 | 122 |
| 121 #endif // CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ | 123 #endif // CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ |
| OLD | NEW |