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/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback_forward.h" |
| 10 #include "base/time/time.h" |
9 #include "ui/gfx/geometry/size_f.h" | 11 #include "ui/gfx/geometry/size_f.h" |
10 #include "ui/gfx/vector2d_f.h" | 12 #include "ui/gfx/vector2d_f.h" |
11 | 13 |
12 namespace content { | 14 namespace content { |
13 | 15 |
14 class SynchronousCompositor; | 16 class SynchronousCompositor; |
15 | 17 |
16 class SynchronousCompositorClient { | 18 class SynchronousCompositorClient { |
17 public: | 19 public: |
18 // Indication to the client that |compositor| is now initialized on the | 20 // Indication to the client that |compositor| is now initialized on the |
(...skipping 11 matching lines...) Expand all Loading... |
30 gfx::Vector2dF max_scroll_offset) = 0; | 32 gfx::Vector2dF max_scroll_offset) = 0; |
31 virtual void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value) = 0; | 33 virtual void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value) = 0; |
32 virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() = 0; | 34 virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() = 0; |
33 virtual bool IsExternalFlingActive() const = 0; | 35 virtual bool IsExternalFlingActive() const = 0; |
34 virtual void SetRootLayerPageScaleFactorAndLimits( | 36 virtual void SetRootLayerPageScaleFactorAndLimits( |
35 float page_scale_factor, | 37 float page_scale_factor, |
36 float min_page_scale_factor, | 38 float min_page_scale_factor, |
37 float max_page_scale_factor) = 0; | 39 float max_page_scale_factor) = 0; |
38 virtual void SetRootLayerScrollableSize(gfx::SizeF scrollable_size) = 0; | 40 virtual void SetRootLayerScrollableSize(gfx::SizeF scrollable_size) = 0; |
39 | 41 |
| 42 typedef base::Callback<void(base::TimeTicks)> AnimationCallback; |
| 43 virtual void SetNeedsAnimate(const AnimationCallback& animation) = 0; |
| 44 |
40 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll, | 45 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll, |
41 gfx::Vector2dF latest_overscroll_delta, | 46 gfx::Vector2dF latest_overscroll_delta, |
42 gfx::Vector2dF current_fling_velocity) = 0; | 47 gfx::Vector2dF current_fling_velocity) = 0; |
43 | 48 |
44 // When true, should periodically call | 49 // When true, should periodically call |
45 // SynchronousCompositorOutputSurface::DemandDrawHw. Note that this value | 50 // SynchronousCompositorOutputSurface::DemandDrawHw. Note that this value |
46 // can change inside DemandDrawHw call. | 51 // can change inside DemandDrawHw call. |
47 virtual void SetContinuousInvalidate(bool invalidate) = 0; | 52 virtual void SetContinuousInvalidate(bool invalidate) = 0; |
48 | 53 |
49 virtual void DidUpdateContent() = 0; | 54 virtual void DidUpdateContent() = 0; |
50 | 55 |
51 protected: | 56 protected: |
52 SynchronousCompositorClient() {} | 57 SynchronousCompositorClient() {} |
53 virtual ~SynchronousCompositorClient() {} | 58 virtual ~SynchronousCompositorClient() {} |
54 | 59 |
55 private: | 60 private: |
56 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorClient); | 61 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorClient); |
57 }; | 62 }; |
58 | 63 |
59 } // namespace content | 64 } // namespace content |
60 | 65 |
61 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ | 66 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ |
OLD | NEW |