1 // Copyright 2012 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 CC_LAYER_TREE_HOST_CLIENT_H_
6 #define CC_LAYER_TREE_HOST_CLIENT_H_
8 #include "base/memory/scoped_ptr.h"
15 class WebCompositorOutputSurface
;
21 class LayerTreeHostClient
{
23 virtual void willBeginFrame() = 0;
24 // Marks finishing compositing-related tasks on the main thread. In threaded mode, this corresponds to didCommit().
25 virtual void didBeginFrame() = 0;
26 virtual void animate(double frameBeginTime
) = 0;
27 virtual void layout() = 0;
28 virtual void applyScrollAndScale(gfx::Vector2d scrollDelta
, float pageScale
) = 0;
29 virtual scoped_ptr
<WebKit::WebCompositorOutputSurface
> createOutputSurface() = 0;
30 virtual void didRecreateOutputSurface(bool success
) = 0;
31 virtual scoped_ptr
<InputHandler
> createInputHandler() = 0;
32 virtual void willCommit() = 0;
33 virtual void didCommit() = 0;
34 virtual void didCommitAndDrawFrame() = 0;
35 virtual void didCompleteSwapBuffers() = 0;
37 // Used only in the single-threaded path.
38 virtual void scheduleComposite() = 0;
41 virtual ~LayerTreeHostClient() { }
46 #endif // CC_LAYER_TREE_HOST_CLIENT_H_