Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: content/public/browser/android/synchronous_compositor_client.h

Issue 274323004: NOT FOR LANDING - [WebView] Allow fling animation via the LayerScrollOffsetDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/geometry/vector2d_f.h" 12 #include "ui/gfx/geometry/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
19 // compositor thread, and open for business. 21 // compositor thread, and open for business.
20 virtual void DidInitializeCompositor(SynchronousCompositor* compositor) = 0; 22 virtual void DidInitializeCompositor(SynchronousCompositor* compositor) = 0;
21 23
22 // Indication to the client that |compositor| is going out of scope, and 24 // Indication to the client that |compositor| is going out of scope, and
23 // must not be accessed within or after this call. 25 // must not be accessed within or after this call.
24 // NOTE if the client goes away before the compositor it must call 26 // NOTE if the client goes away before the compositor it must call
25 // SynchronousCompositor::SetClient(nullptr) to release the back pointer. 27 // SynchronousCompositor::SetClient(nullptr) to release the back pointer.
26 virtual void DidDestroyCompositor(SynchronousCompositor* compositor) = 0; 28 virtual void DidDestroyCompositor(SynchronousCompositor* compositor) = 0;
27 29
28 // See LayerScrollOffsetDelegate for details. 30 // See LayerScrollOffsetDelegate for details.
29 virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() = 0; 31 virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() = 0;
30 virtual void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset, 32 virtual void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset,
31 const gfx::Vector2dF& max_scroll_offset, 33 const gfx::Vector2dF& max_scroll_offset,
32 const gfx::SizeF& scrollable_size, 34 const gfx::SizeF& scrollable_size,
33 float page_scale_factor, 35 float page_scale_factor,
34 float min_page_scale_factor, 36 float min_page_scale_factor,
35 float max_page_scale_factor) = 0; 37 float max_page_scale_factor) = 0;
36 virtual bool IsExternalFlingActive() const = 0; 38 virtual bool IsExternalFlingActive() const = 0;
37 39
40 typedef base::Callback<void(base::TimeTicks)> AnimationCallback;
41 virtual void SetNeedsAnimateFling(const AnimationCallback& animation) = 0;
42
38 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll, 43 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll,
39 gfx::Vector2dF latest_overscroll_delta, 44 gfx::Vector2dF latest_overscroll_delta,
40 gfx::Vector2dF current_fling_velocity) = 0; 45 gfx::Vector2dF current_fling_velocity) = 0;
41 46
42 // When true, should periodically call 47 // When true, should periodically call
43 // SynchronousCompositorOutputSurface::DemandDrawHw. Note that this value 48 // SynchronousCompositorOutputSurface::DemandDrawHw. Note that this value
44 // can change inside DemandDrawHw call. 49 // can change inside DemandDrawHw call.
45 virtual void SetContinuousInvalidate(bool invalidate) = 0; 50 virtual void SetContinuousInvalidate(bool invalidate) = 0;
46 51
47 virtual void DidUpdateContent() = 0; 52 virtual void DidUpdateContent() = 0;
48 53
49 protected: 54 protected:
50 SynchronousCompositorClient() {} 55 SynchronousCompositorClient() {}
51 virtual ~SynchronousCompositorClient() {} 56 virtual ~SynchronousCompositorClient() {}
52 57
53 private: 58 private:
54 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorClient); 59 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorClient);
55 }; 60 };
56 61
57 } // namespace content 62 } // namespace content
58 63
59 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ 64 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_
OLDNEW
« no previous file with comments | « content/browser/android/in_process/synchronous_compositor_impl.cc ('k') | content/renderer/input/input_handler_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698