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

Side by Side Diff: cc/trees/layer_tree_host_client.h

Issue 2337913003: Fork cc::OutputSurface into cc::CompositorFrameSink. (Closed)
Patch Set: cfsfork: rebase Created 4 years, 3 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 2012 The Chromium Authors. All rights reserved. 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 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 CC_TREES_LAYER_TREE_HOST_CLIENT_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_CLIENT_H_
6 #define CC_TREES_LAYER_TREE_HOST_CLIENT_H_ 6 #define CC_TREES_LAYER_TREE_HOST_CLIENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 11
12 namespace gfx { 12 namespace gfx {
13 class Vector2d; 13 class Vector2d;
14 class Vector2dF; 14 class Vector2dF;
15 } 15 }
16 16
17 namespace cc { 17 namespace cc {
18 class ContextProvider; 18 class ContextProvider;
19 class InputHandlerClient; 19 class InputHandlerClient;
20 class OutputSurface; 20 class CompositorFrameSink;
21 struct BeginFrameArgs; 21 struct BeginFrameArgs;
22 22
23 class LayerTreeHostClient { 23 class LayerTreeHostClient {
24 public: 24 public:
25 virtual void WillBeginMainFrame() = 0; 25 virtual void WillBeginMainFrame() = 0;
26 // Marks finishing compositing-related tasks on the main thread. In threaded 26 // Marks finishing compositing-related tasks on the main thread. In threaded
27 // mode, this corresponds to DidCommit(). 27 // mode, this corresponds to DidCommit().
28 virtual void BeginMainFrame(const BeginFrameArgs& args) = 0; 28 virtual void BeginMainFrame(const BeginFrameArgs& args) = 0;
29 virtual void BeginMainFrameNotExpectedSoon() = 0; 29 virtual void BeginMainFrameNotExpectedSoon() = 0;
30 virtual void DidBeginMainFrame() = 0; 30 virtual void DidBeginMainFrame() = 0;
31 // A LayerTreeHost is bound to a LayerTreeHostClient. Visual frame-based 31 // A LayerTreeHost is bound to a LayerTreeHostClient. Visual frame-based
32 // updates to the state of the LayerTreeHost are expected to happen only in 32 // updates to the state of the LayerTreeHost are expected to happen only in
33 // calls to LayerTreeHostClient::UpdateLayerTreeHost, which should 33 // calls to LayerTreeHostClient::UpdateLayerTreeHost, which should
34 // mutate/invalidate the layer tree or other page parameters as appropriate. 34 // mutate/invalidate the layer tree or other page parameters as appropriate.
35 // 35 //
36 // An example of a LayerTreeHostClient is (via additional indirections) Blink, 36 // An example of a LayerTreeHostClient is (via additional indirections) Blink,
37 // which inside of LayerTreeHostClient::UpdateLayerTreeHost will update 37 // which inside of LayerTreeHostClient::UpdateLayerTreeHost will update
38 // (Blink's notions of) style, layout, paint invalidation and compositing 38 // (Blink's notions of) style, layout, paint invalidation and compositing
39 // state. (The "compositing state" will result in a mutated layer tree on the 39 // state. (The "compositing state" will result in a mutated layer tree on the
40 // LayerTreeHost via additional interface indirections which lead back to 40 // LayerTreeHost via additional interface indirections which lead back to
41 // mutations on the LayerTreeHost.) 41 // mutations on the LayerTreeHost.)
42 virtual void UpdateLayerTreeHost() = 0; 42 virtual void UpdateLayerTreeHost() = 0;
43 virtual void ApplyViewportDeltas( 43 virtual void ApplyViewportDeltas(
44 const gfx::Vector2dF& inner_delta, 44 const gfx::Vector2dF& inner_delta,
45 const gfx::Vector2dF& outer_delta, 45 const gfx::Vector2dF& outer_delta,
46 const gfx::Vector2dF& elastic_overscroll_delta, 46 const gfx::Vector2dF& elastic_overscroll_delta,
47 float page_scale, 47 float page_scale,
48 float top_controls_delta) = 0; 48 float top_controls_delta) = 0;
49 // Request an OutputSurface from the client. When the client has one it should 49 // Request an CompositorFrameSink from the client. When the client has one it
50 // call LayerTreeHost::SetOutputSurface. This will result in either 50 // should
enne (OOO) 2016/09/14 00:35:45 Comment formatting part #infinity
51 // DidFailToInitializeOutputSurface or DidInitializeOutputSurface being 51 // call LayerTreeHost::SetCompositorFrameSink. This will result in either
52 // DidFailToInitializeCompositorFrameSink or DidInitializeCompositorFrameSink
53 // being
52 // called. 54 // called.
53 virtual void RequestNewOutputSurface() = 0; 55 virtual void RequestNewCompositorFrameSink() = 0;
54 virtual void DidInitializeOutputSurface() = 0; 56 virtual void DidInitializeCompositorFrameSink() = 0;
55 virtual void DidFailToInitializeOutputSurface() = 0; 57 virtual void DidFailToInitializeCompositorFrameSink() = 0;
56 virtual void WillCommit() = 0; 58 virtual void WillCommit() = 0;
57 virtual void DidCommit() = 0; 59 virtual void DidCommit() = 0;
58 virtual void DidCommitAndDrawFrame() = 0; 60 virtual void DidCommitAndDrawFrame() = 0;
59 virtual void DidCompleteSwapBuffers() = 0; 61 virtual void DidCompleteSwapBuffers() = 0;
60 virtual void DidCompletePageScaleAnimation() = 0; 62 virtual void DidCompletePageScaleAnimation() = 0;
61 63
62 protected: 64 protected:
63 virtual ~LayerTreeHostClient() {} 65 virtual ~LayerTreeHostClient() {}
64 }; 66 };
65 67
66 } // namespace cc 68 } // namespace cc
67 69
68 #endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_ 70 #endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698