OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 class WebSelection; | 47 class WebSelection; |
48 class WebWidget; | 48 class WebWidget; |
49 | 49 |
50 class WebLayerTreeView { | 50 class WebLayerTreeView { |
51 public: | 51 public: |
52 virtual ~WebLayerTreeView() { } | 52 virtual ~WebLayerTreeView() { } |
53 | 53 |
54 // Initialization and lifecycle -------------------------------------- | 54 // Initialization and lifecycle -------------------------------------- |
55 | 55 |
56 // Sets the root of the tree. The root is set by way of the constructor. | 56 // Sets the root of the tree. The root is set by way of the constructor. |
57 virtual void setRootLayer(const WebLayer&) = 0; | 57 virtual void setRootLayer(const WebLayer&) { } |
58 virtual void clearRootLayer() = 0; | 58 virtual void clearRootLayer() { } |
59 | 59 |
60 virtual void attachCompositorAnimationTimeline(WebCompositorAnimationTimelin
e*) { } | 60 virtual void attachCompositorAnimationTimeline(WebCompositorAnimationTimelin
e*) { } |
61 virtual void detachCompositorAnimationTimeline(WebCompositorAnimationTimelin
e*) { } | 61 virtual void detachCompositorAnimationTimeline(WebCompositorAnimationTimelin
e*) { } |
62 | 62 |
63 // View properties --------------------------------------------------- | 63 // View properties --------------------------------------------------- |
64 | 64 |
65 virtual void setViewportSize(const WebSize& deviceViewportSize) = 0; | 65 virtual void setViewportSize(const WebSize& deviceViewportSize) { } |
66 // Gives the viewport size in physical device pixels. | 66 // Gives the viewport size in physical device pixels. |
67 virtual WebSize deviceViewportSize() const = 0; | 67 virtual WebSize deviceViewportSize() const { return WebSize(); } |
68 | 68 |
69 virtual void setDeviceScaleFactor(float) = 0; | 69 virtual void setDeviceScaleFactor(float) { } |
70 virtual float deviceScaleFactor() const = 0; | 70 virtual float deviceScaleFactor() const { return 0; } |
71 | 71 |
72 // Sets the background color for the viewport. | 72 // Sets the background color for the viewport. |
73 virtual void setBackgroundColor(WebColor) = 0; | 73 virtual void setBackgroundColor(WebColor) { } |
74 | 74 |
75 // Sets the background transparency for the viewport. The default is 'false'
. | 75 // Sets the background transparency for the viewport. The default is 'false'
. |
76 virtual void setHasTransparentBackground(bool) = 0; | 76 virtual void setHasTransparentBackground(bool) { } |
77 | 77 |
78 // Sets whether this view is visible. In threaded mode, a view that is not v
isible will not | 78 // Sets whether this view is visible. In threaded mode, a view that is not v
isible will not |
79 // composite or trigger updateAnimations() or layout() calls until it become
s visible. | 79 // composite or trigger updateAnimations() or layout() calls until it become
s visible. |
80 virtual void setVisible(bool) = 0; | 80 virtual void setVisible(bool) { } |
81 | 81 |
82 // Sets the current page scale factor and minimum / maximum limits. Both lim
its are initially 1 (no page scale allowed). | 82 // Sets the current page scale factor and minimum / maximum limits. Both lim
its are initially 1 (no page scale allowed). |
83 virtual void setPageScaleFactorAndLimits(float pageScaleFactor, float minimu
m, float maximum) = 0; | 83 virtual void setPageScaleFactorAndLimits(float pageScaleFactor, float minimu
m, float maximum) { } |
84 | 84 |
85 // Starts an animation of the page scale to a target scale factor and scroll
offset. | 85 // Starts an animation of the page scale to a target scale factor and scroll
offset. |
86 // If useAnchor is true, destination is a point on the screen that will rema
in fixed for the duration of the animation. | 86 // If useAnchor is true, destination is a point on the screen that will rema
in fixed for the duration of the animation. |
87 // If useAnchor is false, destination is the final top-left scroll position. | 87 // If useAnchor is false, destination is the final top-left scroll position. |
88 virtual void startPageScaleAnimation(const WebPoint& destination, bool useAn
chor, float newPageScale, double durationSec) = 0; | 88 virtual void startPageScaleAnimation(const WebPoint& destination, bool useAn
chor, float newPageScale, double durationSec) { } |
89 | 89 |
90 virtual void heuristicsForGpuRasterizationUpdated(bool) { } | 90 virtual void heuristicsForGpuRasterizationUpdated(bool) { } |
91 | 91 |
92 // Sets the amount that the top controls are showing, from 0 (hidden) to 1 | 92 // Sets the amount that the top controls are showing, from 0 (hidden) to 1 |
93 // (fully shown). | 93 // (fully shown). |
94 virtual void setTopControlsShownRatio(float) { } | 94 virtual void setTopControlsShownRatio(float) { } |
95 | 95 |
96 // Update top controls permitted and current states | 96 // Update top controls permitted and current states |
97 virtual void updateTopControlsState(WebTopControlsState constraints, WebTopC
ontrolsState current, bool animate) { } | 97 virtual void updateTopControlsState(WebTopControlsState constraints, WebTopC
ontrolsState current, bool animate) { } |
98 | 98 |
(...skipping 24 matching lines...) Expand all Loading... |
123 // The caller is resposible for keeping the WebLayoutAndPaintAsyncCallback o
bject | 123 // The caller is resposible for keeping the WebLayoutAndPaintAsyncCallback o
bject |
124 // alive until it is called. | 124 // alive until it is called. |
125 virtual void layoutAndPaintAsync(WebLayoutAndPaintAsyncCallback*) { } | 125 virtual void layoutAndPaintAsync(WebLayoutAndPaintAsyncCallback*) { } |
126 | 126 |
127 // The caller is responsible for keeping the WebCompositeAndReadbackAsyncCal
lback | 127 // The caller is responsible for keeping the WebCompositeAndReadbackAsyncCal
lback |
128 // object alive until it is called. | 128 // object alive until it is called. |
129 virtual void compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback*
) { } | 129 virtual void compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback*
) { } |
130 | 130 |
131 // Blocks until the most recently composited frame has finished rendering on
the GPU. | 131 // Blocks until the most recently composited frame has finished rendering on
the GPU. |
132 // This can have a significant performance impact and should be used with ca
re. | 132 // This can have a significant performance impact and should be used with ca
re. |
133 virtual void finishAllRendering() = 0; | 133 virtual void finishAllRendering() { } |
134 | 134 |
135 // Prevents updates to layer tree from becoming visible. | 135 // Prevents updates to layer tree from becoming visible. |
136 virtual void setDeferCommits(bool deferCommits) { } | 136 virtual void setDeferCommits(bool deferCommits) { } |
137 | 137 |
138 // Take responsiblity for this layer's animations, even if this layer hasn't
yet | 138 // Take responsiblity for this layer's animations, even if this layer hasn't
yet |
139 // been added to the tree. | 139 // been added to the tree. |
140 virtual void registerForAnimations(WebLayer* layer) { } | 140 virtual void registerForAnimations(WebLayer* layer) { } |
141 | 141 |
142 // Identify key layers to the compositor when using the pinch virtual viewpo
rt. | 142 // Identify key layers to the compositor when using the pinch virtual viewpo
rt. |
143 virtual void registerViewportLayers( | 143 virtual void registerViewportLayers( |
(...skipping 25 matching lines...) Expand all Loading... |
169 // Toggles continuous painting | 169 // Toggles continuous painting |
170 virtual void setContinuousPaintingEnabled(bool) { } | 170 virtual void setContinuousPaintingEnabled(bool) { } |
171 | 171 |
172 // Toggles scroll bottleneck rects on the HUD layer | 172 // Toggles scroll bottleneck rects on the HUD layer |
173 virtual void setShowScrollBottleneckRects(bool) { } | 173 virtual void setShowScrollBottleneckRects(bool) { } |
174 }; | 174 }; |
175 | 175 |
176 } // namespace blink | 176 } // namespace blink |
177 | 177 |
178 #endif // WebLayerTreeView_h | 178 #endif // WebLayerTreeView_h |
OLD | NEW |