| 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_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "ui/gfx/geometry/size_f.h" | 11 #include "ui/gfx/geometry/size_f.h" |
| 12 #include "ui/gfx/geometry/vector2d_f.h" | 12 #include "ui/gfx/geometry/vector2d_f.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 class SynchronousCompositor; | 16 class SynchronousCompositor; |
| 17 | 17 |
| 18 class SynchronousCompositorClient { | 18 class SynchronousCompositorClient { |
| 19 public: | 19 public: |
| 20 // Indication to the client that |compositor| is now initialized on the | 20 // Indication to the client that |compositor| is now initialized on the |
| 21 // compositor thread, and open for business. | 21 // compositor thread, and open for business. |process_id| and |routing_id| |
| 22 virtual void DidInitializeCompositor(SynchronousCompositor* compositor) = 0; | 22 // belong to the RVH that owns the compositor. |
| 23 virtual void DidInitializeCompositor(SynchronousCompositor* compositor, |
| 24 int process_id, |
| 25 int routing_id) = 0; |
| 23 | 26 |
| 24 // Indication to the client that |compositor| is going out of scope, and | 27 // Indication to the client that |compositor| is going out of scope, and |
| 25 // must not be accessed within or after this call. | 28 // must not be accessed within or after this call. |
| 26 // NOTE if the client goes away before the compositor it must call | 29 // NOTE if the client goes away before the compositor it must call |
| 27 // SynchronousCompositor::SetClient(nullptr) to release the back pointer. | 30 // SynchronousCompositor::SetClient(nullptr) to release the back pointer. |
| 28 virtual void DidDestroyCompositor(SynchronousCompositor* compositor) = 0; | 31 virtual void DidDestroyCompositor(SynchronousCompositor* compositor, |
| 29 | 32 int process_id, |
| 30 // Indication to the client that |compositor| just became the current one. | 33 int routing_id) = 0; |
| 31 // The compositor has to be initialized first. An initialized compositor may | |
| 32 // not become current immediately. | |
| 33 virtual void DidBecomeCurrent(SynchronousCompositor* compositor) = 0; | |
| 34 | 34 |
| 35 // See LayerScrollOffsetDelegate for details. | 35 // See LayerScrollOffsetDelegate for details. |
| 36 virtual void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset, | 36 virtual void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset, |
| 37 const gfx::Vector2dF& max_scroll_offset, | 37 const gfx::Vector2dF& max_scroll_offset, |
| 38 const gfx::SizeF& scrollable_size, | 38 const gfx::SizeF& scrollable_size, |
| 39 float page_scale_factor, | 39 float page_scale_factor, |
| 40 float min_page_scale_factor, | 40 float min_page_scale_factor, |
| 41 float max_page_scale_factor) = 0; | 41 float max_page_scale_factor) = 0; |
| 42 | 42 |
| 43 virtual void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll, | 43 virtual void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll, |
| 44 const gfx::Vector2dF& latest_overscroll_delta, | 44 const gfx::Vector2dF& latest_overscroll_delta, |
| 45 const gfx::Vector2dF& current_fling_velocity) = 0; | 45 const gfx::Vector2dF& current_fling_velocity) = 0; |
| 46 | 46 |
| 47 virtual void PostInvalidate() = 0; | 47 virtual void PostInvalidate() = 0; |
| 48 | 48 |
| 49 virtual void DidUpdateContent() = 0; | 49 virtual void DidUpdateContent() = 0; |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 SynchronousCompositorClient() {} | 52 SynchronousCompositorClient() {} |
| 53 virtual ~SynchronousCompositorClient() {} | 53 virtual ~SynchronousCompositorClient() {} |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorClient); | 56 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorClient); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace content | 59 } // namespace content |
| 60 | 60 |
| 61 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ | 61 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ |
| OLD | NEW |