| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CompositingReasons_h | 5 #ifndef CompositingReasons_h |
| 6 #define CompositingReasons_h | 6 #define CompositingReasons_h |
| 7 | 7 |
| 8 #include "wtf/MathExtras.h" | 8 #include "wtf/MathExtras.h" |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 namespace WebCore { | 11 namespace WebCore { |
| 12 | 12 |
| 13 const uint64_t CompositingReasonNone = 0; | 13 const uint64_t CompositingReasonNone = 0; |
| 14 const uint64_t CompositingReasonAll = ~static
_cast<uint64_t>(0); | 14 const uint64_t CompositingReasonAll = ~stat
ic_cast<uint64_t>(0); |
| 15 | 15 |
| 16 // Intrinsic reasons that can be known right away by the layer | 16 // Intrinsic reasons that can be known right away by the layer |
| 17 const uint64_t CompositingReason3DTransform = UINT64_
C(1) << 0; | 17 const uint64_t CompositingReason3DTransform = UINT6
4_C(1) << 0; |
| 18 const uint64_t CompositingReasonVideo = UINT64_
C(1) << 1; | 18 const uint64_t CompositingReasonVideo = UINT6
4_C(1) << 1; |
| 19 const uint64_t CompositingReasonCanvas = UINT64_
C(1) << 2; | 19 const uint64_t CompositingReasonCanvas = UINT6
4_C(1) << 2; |
| 20 const uint64_t CompositingReasonPlugin = UINT64_
C(1) << 3; | 20 const uint64_t CompositingReasonPlugin = UINT6
4_C(1) << 3; |
| 21 const uint64_t CompositingReasonIFrame = UINT64_
C(1) << 4; | 21 const uint64_t CompositingReasonIFrame = UINT6
4_C(1) << 4; |
| 22 const uint64_t CompositingReasonBackfaceVisibilityHidden = UINT64_
C(1) << 5; | 22 const uint64_t CompositingReasonBackfaceVisibilityHidden = UINT6
4_C(1) << 5; |
| 23 const uint64_t CompositingReasonActiveAnimation = UINT64_
C(1) << 6; | 23 const uint64_t CompositingReasonActiveAnimation = UINT6
4_C(1) << 6; |
| 24 const uint64_t CompositingReasonTransitionProperty = UINT64_
C(1) << 7; | 24 const uint64_t CompositingReasonTransitionProperty = UINT6
4_C(1) << 7; |
| 25 const uint64_t CompositingReasonFilters = UINT64_
C(1) << 8; | 25 const uint64_t CompositingReasonFilters = UINT6
4_C(1) << 8; |
| 26 const uint64_t CompositingReasonPositionFixed = UINT64_
C(1) << 9; | 26 const uint64_t CompositingReasonPositionFixed = UINT6
4_C(1) << 9; |
| 27 // Bit 10 is available. | 27 const uint64_t CompositingReasonOverflowScrollingTouch = UINT6
4_C(1) << 10; |
| 28 const uint64_t CompositingReasonOverflowScrollingTouch = UINT64_
C(1) << 11; | 28 const uint64_t CompositingReasonOverflowScrollingParent = UINT6
4_C(1) << 11; |
| 29 const uint64_t CompositingReasonOverflowScrollingParent = UINT64_
C(1) << 12; | 29 const uint64_t CompositingReasonOutOfFlowClipping = UINT6
4_C(1) << 12; |
| 30 const uint64_t CompositingReasonOutOfFlowClipping = UINT64_
C(1) << 13; | 30 const uint64_t CompositingReasonVideoOverlay = UINT6
4_C(1) << 13; |
| 31 const uint64_t CompositingReasonVideoOverlay = UINT64_
C(1) << 14; | 31 const uint64_t CompositingReasonWillChangeCompositingHint = UINT6
4_C(1) << 14; |
| 32 const uint64_t CompositingReasonWillChangeCompositingHint = UINT64_
C(1) << 15; | |
| 33 // Bit 16 is available. | |
| 34 | 32 |
| 35 // Overlap reasons that require knowing what's behind you in paint-order before
knowing the answer | 33 // Overlap reasons that require knowing what's behind you in paint-order before
knowing the answer |
| 36 const uint64_t CompositingReasonAssumedOverlap = UINT64_
C(1) << 17; | 34 const uint64_t CompositingReasonAssumedOverlap = UINT6
4_C(1) << 15; |
| 37 const uint64_t CompositingReasonOverlap = UINT64_
C(1) << 18; | 35 const uint64_t CompositingReasonOverlap = UINT6
4_C(1) << 16; |
| 38 const uint64_t CompositingReasonNegativeZIndexChildren = UINT64_
C(1) << 19; | 36 const uint64_t CompositingReasonNegativeZIndexChildren = UINT6
4_C(1) << 17; |
| 39 const uint64_t CompositingReasonNoSquashingTargetFound = UINT64_
C(1) << 20; | 37 const uint64_t CompositingReasonScrollsWithRespectToSquashingLayer = UINT6
4_C(1) << 18; |
| 38 const uint64_t CompositingReasonSquashingSparsityExceeded = UINT6
4_C(1) << 19; |
| 39 const uint64_t CompositingReasonSquashingClippingContainerMismatch = UINT6
4_C(1) << 20; |
| 40 const uint64_t CompositingReasonSquashingOpacityAncestorMismatch = UINT6
4_C(1) << 21; |
| 41 const uint64_t CompositingReasonSquashingTransformAncestorMismatch = UINT6
4_C(1) << 22; |
| 42 const uint64_t CompositingReasonSquashingFilterAncestorMismatch = UINT6
4_C(1) << 23; |
| 43 const uint64_t CompositingReasonSquashingWouldBreakPaintOrder = UINT6
4_C(1) << 24; |
| 44 const uint64_t CompositingReasonSquashingVideoIsDisallowed = UINT6
4_C(1) << 25; |
| 45 const uint64_t CompositingReasonSquashedLayerClipsCompositingDescendants = UINT6
4_C(1) << 26; |
| 40 | 46 |
| 41 // Subtree reasons that require knowing what the status of your subtree is befor
e knowing the answer | 47 // Subtree reasons that require knowing what the status of your subtree is befor
e knowing the answer |
| 42 const uint64_t CompositingReasonTransformWithCompositedDescendants = UINT64_
C(1) << 21; | 48 const uint64_t CompositingReasonTransformWithCompositedDescendants = UINT6
4_C(1) << 27; |
| 43 const uint64_t CompositingReasonOpacityWithCompositedDescendants = UINT64_
C(1) << 22; | 49 const uint64_t CompositingReasonOpacityWithCompositedDescendants = UINT6
4_C(1) << 28; |
| 44 const uint64_t CompositingReasonMaskWithCompositedDescendants = UINT64_
C(1) << 23; | 50 const uint64_t CompositingReasonMaskWithCompositedDescendants = UINT6
4_C(1) << 29; |
| 45 const uint64_t CompositingReasonReflectionWithCompositedDescendants = UINT64_
C(1) << 24; | 51 const uint64_t CompositingReasonReflectionWithCompositedDescendants = UINT6
4_C(1) << 30; |
| 46 const uint64_t CompositingReasonFilterWithCompositedDescendants = UINT64_
C(1) << 25; | 52 const uint64_t CompositingReasonFilterWithCompositedDescendants = UINT6
4_C(1) << 31; |
| 47 const uint64_t CompositingReasonBlendingWithCompositedDescendants = UINT64_
C(1) << 26; | 53 const uint64_t CompositingReasonBlendingWithCompositedDescendants = UINT6
4_C(1) << 32; |
| 48 const uint64_t CompositingReasonClipsCompositingDescendants = UINT64_
C(1) << 27; | 54 const uint64_t CompositingReasonClipsCompositingDescendants = UINT6
4_C(1) << 33; |
| 49 const uint64_t CompositingReasonPerspectiveWith3DDescendants = UINT64_
C(1) << 28; | 55 const uint64_t CompositingReasonPerspectiveWith3DDescendants = UINT6
4_C(1) << 34; |
| 50 const uint64_t CompositingReasonPreserve3DWith3DDescendants = UINT64_
C(1) << 29; | 56 const uint64_t CompositingReasonPreserve3DWith3DDescendants = UINT6
4_C(1) << 35; |
| 51 const uint64_t CompositingReasonReflectionOfCompositedParent = UINT64_
C(1) << 30; | 57 const uint64_t CompositingReasonReflectionOfCompositedParent = UINT6
4_C(1) << 36; |
| 52 const uint64_t CompositingReasonIsolateCompositedDescendants = UINT64_
C(1) << 31; | 58 const uint64_t CompositingReasonIsolateCompositedDescendants = UINT6
4_C(1) << 37; |
| 53 | 59 |
| 54 // The root layer is a special case that may be forced to be a layer, but also i
t needs to be | 60 // The root layer is a special case that may be forced to be a layer, but also i
t needs to be |
| 55 // a layer if anything else in the subtree is composited. | 61 // a layer if anything else in the subtree is composited. |
| 56 const uint64_t CompositingReasonRoot = UINT64_
C(1) << 32; | 62 const uint64_t CompositingReasonRoot = UINT6
4_C(1) << 38; |
| 57 | 63 |
| 58 // CompositedLayerMapping internal hierarchy reasons | 64 // CompositedLayerMapping internal hierarchy reasons |
| 59 const uint64_t CompositingReasonLayerForAncestorClip = UINT64_
C(1) << 33; | 65 const uint64_t CompositingReasonLayerForAncestorClip = UINT6
4_C(1) << 39; |
| 60 const uint64_t CompositingReasonLayerForDescendantClip = UINT64_
C(1) << 34; | 66 const uint64_t CompositingReasonLayerForDescendantClip = UINT6
4_C(1) << 40; |
| 61 const uint64_t CompositingReasonLayerForPerspective = UINT64_
C(1) << 35; | 67 const uint64_t CompositingReasonLayerForPerspective = UINT6
4_C(1) << 41; |
| 62 const uint64_t CompositingReasonLayerForHorizontalScrollbar = UINT64_
C(1) << 36; | 68 const uint64_t CompositingReasonLayerForHorizontalScrollbar = UINT6
4_C(1) << 42; |
| 63 const uint64_t CompositingReasonLayerForVerticalScrollbar = UINT64_
C(1) << 37; | 69 const uint64_t CompositingReasonLayerForVerticalScrollbar = UINT6
4_C(1) << 43; |
| 64 const uint64_t CompositingReasonLayerForScrollCorner = UINT64_
C(1) << 38; | 70 const uint64_t CompositingReasonLayerForScrollCorner = UINT6
4_C(1) << 44; |
| 65 const uint64_t CompositingReasonLayerForScrollingContents = UINT64_
C(1) << 39; | 71 const uint64_t CompositingReasonLayerForScrollingContents = UINT6
4_C(1) << 45; |
| 66 const uint64_t CompositingReasonLayerForScrollingContainer = UINT64_
C(1) << 40; | 72 const uint64_t CompositingReasonLayerForScrollingContainer = UINT6
4_C(1) << 46; |
| 67 const uint64_t CompositingReasonLayerForSquashingContents = UINT64_
C(1) << 41; | 73 const uint64_t CompositingReasonLayerForSquashingContents = UINT6
4_C(1) << 47; |
| 68 const uint64_t CompositingReasonLayerForSquashingContainer = UINT64_
C(1) << 42; | 74 const uint64_t CompositingReasonLayerForSquashingContainer = UINT6
4_C(1) << 48; |
| 69 const uint64_t CompositingReasonLayerForForeground = UINT64_
C(1) << 43; | 75 const uint64_t CompositingReasonLayerForForeground = UINT6
4_C(1) << 49; |
| 70 const uint64_t CompositingReasonLayerForBackground = UINT64_
C(1) << 44; | 76 const uint64_t CompositingReasonLayerForBackground = UINT6
4_C(1) << 50; |
| 71 const uint64_t CompositingReasonLayerForMask = UINT64_
C(1) << 45; | 77 const uint64_t CompositingReasonLayerForMask = UINT6
4_C(1) << 51; |
| 72 const uint64_t CompositingReasonLayerForClippingMask = UINT64_
C(1) << 46; | 78 const uint64_t CompositingReasonLayerForClippingMask = UINT6
4_C(1) << 52; |
| 73 const uint64_t CompositingReasonLayerForScrollingBlockSelection = UINT64_
C(1) << 47; | 79 const uint64_t CompositingReasonLayerForScrollingBlockSelection = UINT6
4_C(1) << 53; |
| 74 | 80 |
| 75 // Various combinations of compositing reasons are defined here also, for more i
ntutive and faster bitwise logic. | 81 // Various combinations of compositing reasons are defined here also, for more i
ntutive and faster bitwise logic. |
| 76 const uint64_t CompositingReasonComboAllDirectReasons = | 82 const uint64_t CompositingReasonComboAllDirectReasons = |
| 77 CompositingReason3DTransform | 83 CompositingReason3DTransform |
| 78 | CompositingReasonVideo | 84 | CompositingReasonVideo |
| 79 | CompositingReasonCanvas | 85 | CompositingReasonCanvas |
| 80 | CompositingReasonPlugin | 86 | CompositingReasonPlugin |
| 81 | CompositingReasonIFrame | 87 | CompositingReasonIFrame |
| 82 | CompositingReasonBackfaceVisibilityHidden | 88 | CompositingReasonBackfaceVisibilityHidden |
| 83 | CompositingReasonActiveAnimation | 89 | CompositingReasonActiveAnimation |
| (...skipping 12 matching lines...) Expand all Loading... |
| 96 | CompositingReasonActiveAnimation | 102 | CompositingReasonActiveAnimation |
| 97 | CompositingReasonTransitionProperty | 103 | CompositingReasonTransitionProperty |
| 98 | CompositingReasonFilters | 104 | CompositingReasonFilters |
| 99 | CompositingReasonWillChangeCompositingHint; | 105 | CompositingReasonWillChangeCompositingHint; |
| 100 | 106 |
| 101 const uint64_t CompositingReasonComboReasonsThatRequireOwnBacking = | 107 const uint64_t CompositingReasonComboReasonsThatRequireOwnBacking = |
| 102 CompositingReasonComboAllDirectReasons | 108 CompositingReasonComboAllDirectReasons |
| 103 | CompositingReasonOverlap | 109 | CompositingReasonOverlap |
| 104 | CompositingReasonAssumedOverlap | 110 | CompositingReasonAssumedOverlap |
| 105 | CompositingReasonNegativeZIndexChildren | 111 | CompositingReasonNegativeZIndexChildren |
| 106 | CompositingReasonNoSquashingTargetFound | 112 | CompositingReasonScrollsWithRespectToSquashingLayer |
| 113 | CompositingReasonSquashingSparsityExceeded |
| 114 | CompositingReasonSquashingClippingContainerMismatch |
| 115 | CompositingReasonSquashingOpacityAncestorMismatch |
| 116 | CompositingReasonSquashingTransformAncestorMismatch |
| 117 | CompositingReasonSquashingFilterAncestorMismatch |
| 118 | CompositingReasonSquashingWouldBreakPaintOrder |
| 119 | CompositingReasonSquashingVideoIsDisallowed |
| 120 | CompositingReasonSquashedLayerClipsCompositingDescendants |
| 107 | CompositingReasonTransformWithCompositedDescendants | 121 | CompositingReasonTransformWithCompositedDescendants |
| 108 | CompositingReasonOpacityWithCompositedDescendants | 122 | CompositingReasonOpacityWithCompositedDescendants |
| 109 | CompositingReasonMaskWithCompositedDescendants | 123 | CompositingReasonMaskWithCompositedDescendants |
| 110 | CompositingReasonFilterWithCompositedDescendants | 124 | CompositingReasonFilterWithCompositedDescendants |
| 111 | CompositingReasonBlendingWithCompositedDescendants | 125 | CompositingReasonBlendingWithCompositedDescendants |
| 112 | CompositingReasonIsolateCompositedDescendants | 126 | CompositingReasonIsolateCompositedDescendants |
| 113 | CompositingReasonPreserve3DWith3DDescendants; // preserve-3d has to create
backing store to ensure that 3d-transformed elements intersect. | 127 | CompositingReasonPreserve3DWith3DDescendants; // preserve-3d has to create
backing store to ensure that 3d-transformed elements intersect. |
| 114 | 128 |
| 115 const uint64_t CompositingReasonComboSquashableReasons = | 129 const uint64_t CompositingReasonComboSquashableReasons = |
| 116 CompositingReasonOverlap | 130 CompositingReasonOverlap |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 { 0, 0, 0 }, // Available. | 206 { 0, 0, 0 }, // Available. |
| 193 { CompositingReasonAssumedOverlap, | 207 { CompositingReasonAssumedOverlap, |
| 194 "assumedOverlap", | 208 "assumedOverlap", |
| 195 "Might overlap other composited content" }, | 209 "Might overlap other composited content" }, |
| 196 { CompositingReasonOverlap, | 210 { CompositingReasonOverlap, |
| 197 "overlap", | 211 "overlap", |
| 198 "Overlaps other composited content" }, | 212 "Overlaps other composited content" }, |
| 199 { CompositingReasonNegativeZIndexChildren, | 213 { CompositingReasonNegativeZIndexChildren, |
| 200 "negativeZIndexChildren", | 214 "negativeZIndexChildren", |
| 201 "Parent with composited negative z-index content" }, | 215 "Parent with composited negative z-index content" }, |
| 202 { CompositingReasonNoSquashingTargetFound, | 216 { CompositingReasonScrollsWithRespectToSquashingLayer, |
| 203 "noSquashingTargetFound", | 217 "scrollsWithRespectToSquashingLayer", |
| 204 "Cannot be squashed due to no compatible squashing owner found" }, | 218 "Cannot be squashed since this layer scrolls with respect to the squashi
ng layer" }, |
| 219 { CompositingReasonSquashingSparsityExceeded, |
| 220 "squashingSparsityExceeded", |
| 221 "Cannot be squashed as the squashing layer would become too sparse" }, |
| 222 { CompositingReasonSquashingClippingContainerMismatch, |
| 223 "squashingClippingContainerMismatch", |
| 224 "Cannot be squashed because this layer has a different clipping containe
r than the squashing layer" }, |
| 225 { CompositingReasonSquashingOpacityAncestorMismatch, |
| 226 "squashingOpacityAncestorMismatch", |
| 227 "Cannot be squashed because this layer has a different opacity ancestor
than the squashing layer" }, |
| 228 { CompositingReasonSquashingTransformAncestorMismatch, |
| 229 "squashingTransformAncestorMismatch", |
| 230 "Cannot be squashed because this layer has a different transform ancesto
r than the squashing layer" }, |
| 231 { CompositingReasonSquashingFilterAncestorMismatch, |
| 232 "squashingFilterAncestorMismatch", |
| 233 "Cannot be squashed because this layer has a different filter ancestor t
han the squashing layer" }, |
| 234 { CompositingReasonSquashingWouldBreakPaintOrder, |
| 235 "squashingWouldBreakPaintOrder", |
| 236 "Cannot be squashed without breaking paint order" }, |
| 237 { CompositingReasonSquashingVideoIsDisallowed, |
| 238 "squashingVideoIsDisallowed", |
| 239 "Squashing video is not supported" }, |
| 240 { CompositingReasonSquashedLayerClipsCompositingDescendants, |
| 241 "squashedLayerClipsCompositingDescendants", |
| 242 "Squashing a layer that clips composited descendants is not supported."
}, |
| 205 { CompositingReasonTransformWithCompositedDescendants, | 243 { CompositingReasonTransformWithCompositedDescendants, |
| 206 "transformWithCompositedDescendants", | 244 "transformWithCompositedDescendants", |
| 207 "Has a transform that needs to be known by compositor because of composi
ted descendants" }, | 245 "Has a transform that needs to be known by compositor because of composi
ted descendants" }, |
| 208 { CompositingReasonOpacityWithCompositedDescendants, | 246 { CompositingReasonOpacityWithCompositedDescendants, |
| 209 "opacityWithCompositedDescendants", | 247 "opacityWithCompositedDescendants", |
| 210 "Has opacity that needs to be applied by compositor because of composite
d descendants" }, | 248 "Has opacity that needs to be applied by compositor because of composite
d descendants" }, |
| 211 { CompositingReasonMaskWithCompositedDescendants, | 249 { CompositingReasonMaskWithCompositedDescendants, |
| 212 "maskWithCompositedDescendants", | 250 "maskWithCompositedDescendants", |
| 213 "Has a mask that needs to be known by compositor because of composited d
escendants" }, | 251 "Has a mask that needs to be known by compositor because of composited d
escendants" }, |
| 214 { CompositingReasonReflectionWithCompositedDescendants, | 252 { CompositingReasonReflectionWithCompositedDescendants, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 "layerForClippingMask", | 319 "layerForClippingMask", |
| 282 "Secondary layer, for clipping mask" }, | 320 "Secondary layer, for clipping mask" }, |
| 283 { CompositingReasonLayerForScrollingBlockSelection, | 321 { CompositingReasonLayerForScrollingBlockSelection, |
| 284 "layerForScrollingBlockSelection", | 322 "layerForScrollingBlockSelection", |
| 285 "Secondary layer, to house block selection gaps for composited scrolling
with no scrolling contents" }, | 323 "Secondary layer, to house block selection gaps for composited scrolling
with no scrolling contents" }, |
| 286 }; | 324 }; |
| 287 | 325 |
| 288 } // namespace WebCore | 326 } // namespace WebCore |
| 289 | 327 |
| 290 #endif // CompositingReasons_h | 328 #endif // CompositingReasons_h |
| OLD | NEW |