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