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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_
8 #include "base/basictypes.h"
9 #include "ui/gfx/geometry/size_f.h"
10 #include "ui/gfx/geometry/vector2d_f.h"
14 class SynchronousCompositor
;
16 class SynchronousCompositorClient
{
18 // Indication to the client that |compositor| is now initialized on the
19 // compositor thread, and open for business.
20 virtual void DidInitializeCompositor(SynchronousCompositor
* compositor
) = 0;
22 // Indication to the client that |compositor| is going out of scope, and
23 // must not be accessed within or after this call.
24 // NOTE if the client goes away before the compositor it must call
25 // SynchronousCompositor::SetClient(nullptr) to release the back pointer.
26 virtual void DidDestroyCompositor(SynchronousCompositor
* compositor
) = 0;
28 // See LayerScrollOffsetDelegate for details.
29 virtual gfx::Vector2dF
GetTotalRootLayerScrollOffset() = 0;
30 virtual void UpdateRootLayerState(const gfx::Vector2dF
& total_scroll_offset
,
31 const gfx::Vector2dF
& max_scroll_offset
,
32 const gfx::SizeF
& scrollable_size
,
33 float page_scale_factor
,
34 float min_page_scale_factor
,
35 float max_page_scale_factor
) = 0;
36 virtual bool IsExternalFlingActive() const = 0;
38 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll
,
39 gfx::Vector2dF latest_overscroll_delta
,
40 gfx::Vector2dF current_fling_velocity
) = 0;
42 // When true, should periodically call
43 // SynchronousCompositorOutputSurface::DemandDrawHw. Note that this value
44 // can change inside DemandDrawHw call.
45 virtual void SetContinuousInvalidate(bool invalidate
) = 0;
47 virtual void DidUpdateContent() = 0;
50 SynchronousCompositorClient() {}
51 virtual ~SynchronousCompositorClient() {}
54 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorClient
);
57 } // namespace content
59 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_