OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef PaintLayerCompositor_h | 26 #ifndef PaintLayerCompositor_h |
27 #define PaintLayerCompositor_h | 27 #define PaintLayerCompositor_h |
28 | 28 |
29 #include <memory> | 29 #include <memory> |
30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
| 31 #include "core/dom/DocumentLifecycle.h" |
31 #include "core/layout/compositing/CompositingReasonFinder.h" | 32 #include "core/layout/compositing/CompositingReasonFinder.h" |
32 #include "platform/graphics/GraphicsLayerClient.h" | 33 #include "platform/graphics/GraphicsLayerClient.h" |
33 #include "platform/wtf/HashMap.h" | 34 #include "platform/wtf/HashMap.h" |
34 | 35 |
35 namespace blink { | 36 namespace blink { |
36 | 37 |
37 class PaintLayer; | 38 class PaintLayer; |
38 class DocumentLifecycle; | |
39 class GraphicsLayer; | 39 class GraphicsLayer; |
40 class IntPoint; | 40 class IntPoint; |
41 class JSONObject; | 41 class JSONObject; |
42 class Page; | 42 class Page; |
43 class LayoutPart; | 43 class LayoutPart; |
44 class Scrollbar; | 44 class Scrollbar; |
45 class ScrollingCoordinator; | 45 class ScrollingCoordinator; |
46 class VisualViewport; | 46 class VisualViewport; |
47 | 47 |
48 enum CompositingUpdateType { | 48 enum CompositingUpdateType { |
(...skipping 21 matching lines...) Expand all Loading... |
70 // In Slimming Paint v2, PaintLayerCompositor will be eventually replaced by | 70 // In Slimming Paint v2, PaintLayerCompositor will be eventually replaced by |
71 // PaintArtifactCompositor. | 71 // PaintArtifactCompositor. |
72 | 72 |
73 class CORE_EXPORT PaintLayerCompositor final : public GraphicsLayerClient { | 73 class CORE_EXPORT PaintLayerCompositor final : public GraphicsLayerClient { |
74 USING_FAST_MALLOC(PaintLayerCompositor); | 74 USING_FAST_MALLOC(PaintLayerCompositor); |
75 | 75 |
76 public: | 76 public: |
77 explicit PaintLayerCompositor(LayoutView&); | 77 explicit PaintLayerCompositor(LayoutView&); |
78 ~PaintLayerCompositor() override; | 78 ~PaintLayerCompositor() override; |
79 | 79 |
80 void UpdateIfNeededRecursive(); | 80 void UpdateIfNeededRecursive(DocumentLifecycle::LifecycleState target_state); |
81 | 81 |
82 // Return true if this LayoutView is in "compositing mode" (i.e. has one or | 82 // Return true if this LayoutView is in "compositing mode" (i.e. has one or |
83 // more composited Layers) | 83 // more composited Layers) |
84 bool InCompositingMode() const; | 84 bool InCompositingMode() const; |
85 // FIXME: Replace all callers with inCompositingMode and remove this function. | 85 // FIXME: Replace all callers with inCompositingMode and remove this function. |
86 bool StaleInCompositingMode() const; | 86 bool StaleInCompositingMode() const; |
87 // This will make a compositing layer at the root automatically, and hook up | 87 // This will make a compositing layer at the root automatically, and hook up |
88 // to the native view/window system. | 88 // to the native view/window system. |
89 void SetCompositingModeEnabled(bool); | 89 void SetCompositingModeEnabled(bool); |
90 | 90 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 PaintLayer*, | 186 PaintLayer*, |
187 CompositingStateTransitionType composited_layer_update); | 187 CompositingStateTransitionType composited_layer_update); |
188 | 188 |
189 bool InOverlayFullscreenVideo() const { return in_overlay_fullscreen_video_; } | 189 bool InOverlayFullscreenVideo() const { return in_overlay_fullscreen_video_; } |
190 | 190 |
191 private: | 191 private: |
192 #if DCHECK_IS_ON() | 192 #if DCHECK_IS_ON() |
193 void AssertNoUnresolvedDirtyBits(); | 193 void AssertNoUnresolvedDirtyBits(); |
194 #endif | 194 #endif |
195 | 195 |
196 void UpdateIfNeededRecursiveInternal(); | 196 void UpdateIfNeededRecursiveInternal( |
| 197 DocumentLifecycle::LifecycleState target_state); |
197 | 198 |
198 // GraphicsLayerClient implementation | 199 // GraphicsLayerClient implementation |
199 bool NeedsRepaint(const GraphicsLayer&) const { return true; } | 200 bool NeedsRepaint(const GraphicsLayer&) const { return true; } |
200 IntRect ComputeInterestRect(const GraphicsLayer*, | 201 IntRect ComputeInterestRect(const GraphicsLayer*, |
201 const IntRect&) const override; | 202 const IntRect&) const override; |
202 void PaintContents(const GraphicsLayer*, | 203 void PaintContents(const GraphicsLayer*, |
203 GraphicsContext&, | 204 GraphicsContext&, |
204 GraphicsLayerPaintingPhase, | 205 GraphicsLayerPaintingPhase, |
205 const IntRect& interest_rect) const override; | 206 const IntRect& interest_rect) const override; |
206 | 207 |
207 bool IsTrackingRasterInvalidations() const override; | 208 bool IsTrackingRasterInvalidations() const override; |
208 | 209 |
209 void UpdateWithoutAcceleratedCompositing(CompositingUpdateType); | 210 void UpdateWithoutAcceleratedCompositing(CompositingUpdateType); |
210 void UpdateIfNeeded(); | 211 void UpdateIfNeeded(DocumentLifecycle::LifecycleState target_state); |
211 | 212 |
212 void EnsureRootLayer(); | 213 void EnsureRootLayer(); |
213 void DestroyRootLayer(); | 214 void DestroyRootLayer(); |
214 | 215 |
215 void AttachRootLayer(); | 216 void AttachRootLayer(); |
216 void DetachRootLayer(); | 217 void DetachRootLayer(); |
217 | 218 |
218 void AttachCompositorTimeline(); | 219 void AttachCompositorTimeline(); |
219 void DetachCompositorTimeline(); | 220 void DetachCompositorTimeline(); |
220 | 221 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 288 |
288 // Layers for overflow controls | 289 // Layers for overflow controls |
289 std::unique_ptr<GraphicsLayer> layer_for_horizontal_scrollbar_; | 290 std::unique_ptr<GraphicsLayer> layer_for_horizontal_scrollbar_; |
290 std::unique_ptr<GraphicsLayer> layer_for_vertical_scrollbar_; | 291 std::unique_ptr<GraphicsLayer> layer_for_vertical_scrollbar_; |
291 std::unique_ptr<GraphicsLayer> layer_for_scroll_corner_; | 292 std::unique_ptr<GraphicsLayer> layer_for_scroll_corner_; |
292 }; | 293 }; |
293 | 294 |
294 } // namespace blink | 295 } // namespace blink |
295 | 296 |
296 #endif // PaintLayerCompositor_h | 297 #endif // PaintLayerCompositor_h |
OLD | NEW |