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 "ui/gfx/vector2d_f.h" | 9 #include "ui/gfx/vector2d_f.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 class SynchronousCompositor; | 13 class SynchronousCompositor; |
14 | 14 |
15 class SynchronousCompositorClient { | 15 class SynchronousCompositorClient { |
16 public: | 16 public: |
17 // Indication to the client that |compositor| is now initialized on the | 17 // Indication to the client that |compositor| is now initialized on the |
18 // compositor thread, and open for business. | 18 // compositor thread, and open for business. |
19 virtual void DidInitializeCompositor(SynchronousCompositor* compositor) = 0; | 19 virtual void DidInitializeCompositor(SynchronousCompositor* compositor) = 0; |
20 | 20 |
21 // Indication to the client that |compositor| is going out of scope, and | 21 // Indication to the client that |compositor| is going out of scope, and |
22 // must not be accessed within or after this call. | 22 // must not be accessed within or after this call. |
23 // NOTE if the client goes away before the compositor it must call | 23 // NOTE if the client goes away before the compositor it must call |
24 // SynchronousCompositor::SetClient(NULL) to release the back pointer. | 24 // SynchronousCompositor::SetClient(NULL) to release the back pointer. |
25 virtual void DidDestroyCompositor(SynchronousCompositor* compositor) = 0; | 25 virtual void DidDestroyCompositor(SynchronousCompositor* compositor) = 0; |
26 | 26 |
27 // See LayerScrollOffsetDelegate for details. | 27 // See LayerScrollOffsetDelegate for details. |
| 28 virtual void SetMaxRootLayerScrollOffset( |
| 29 gfx::Vector2dF max_scroll_offset) = 0; |
28 virtual void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value) = 0; | 30 virtual void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value) = 0; |
29 virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() = 0; | 31 virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() = 0; |
| 32 virtual void SetRootLayerPageScaleFactor(float page_scale_factor) = 0; |
| 33 virtual void SetRootLayerScrollableSize(gfx::SizeF scrollable_size) = 0; |
| 34 |
30 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll, | 35 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll, |
31 gfx::Vector2dF latest_overscroll_delta, | 36 gfx::Vector2dF latest_overscroll_delta, |
32 gfx::Vector2dF current_fling_velocity) = 0; | 37 gfx::Vector2dF current_fling_velocity) = 0; |
33 | 38 |
34 // When true, should periodically call | 39 // When true, should periodically call |
35 // SynchronousCompositorOutputSurface::DemandDrawHw. Note that this value | 40 // SynchronousCompositorOutputSurface::DemandDrawHw. Note that this value |
36 // can change inside DemandDrawHw call. | 41 // can change inside DemandDrawHw call. |
37 virtual void SetContinuousInvalidate(bool invalidate) = 0; | 42 virtual void SetContinuousInvalidate(bool invalidate) = 0; |
38 | 43 |
39 virtual void DidUpdateContent() = 0; | 44 virtual void DidUpdateContent() = 0; |
40 | 45 |
41 protected: | 46 protected: |
42 SynchronousCompositorClient() {} | 47 SynchronousCompositorClient() {} |
43 virtual ~SynchronousCompositorClient() {} | 48 virtual ~SynchronousCompositorClient() {} |
44 | 49 |
45 private: | 50 private: |
46 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorClient); | 51 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorClient); |
47 }; | 52 }; |
48 | 53 |
49 } // namespace content | 54 } // namespace content |
50 | 55 |
51 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ | 56 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ |
OLD | NEW |