| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 ASSERT(squashingState.hasMostRecentMapping); | 118 ASSERT(squashingState.hasMostRecentMapping); |
| 119 const Layer& squashingLayer = squashingState.mostRecentMapping->owningLayer(
); | 119 const Layer& squashingLayer = squashingState.mostRecentMapping->owningLayer(
); |
| 120 | 120 |
| 121 // FIXME: this special case for video exists only to deal with corner cases | 121 // FIXME: this special case for video exists only to deal with corner cases |
| 122 // where a LayoutVideo does not report that it needs to be directly composit
ed. | 122 // where a LayoutVideo does not report that it needs to be directly composit
ed. |
| 123 // Video does not currently support sharing a backing, but this could be | 123 // Video does not currently support sharing a backing, but this could be |
| 124 // generalized in the future. The following layout tests fail if we permit t
he | 124 // generalized in the future. The following layout tests fail if we permit t
he |
| 125 // video to share a backing with other layers. | 125 // video to share a backing with other layers. |
| 126 // | 126 // |
| 127 // compositing/video/video-controls-layer-creation.html | 127 // compositing/video/video-controls-layer-creation.html |
| 128 if (layer->renderer()->isVideo() || squashingLayer.renderer()->isVideo()) | 128 if (layer->layoutObject()->isVideo() || squashingLayer.layoutObject()->isVid
eo()) |
| 129 return CompositingReasonSquashingVideoIsDisallowed; | 129 return CompositingReasonSquashingVideoIsDisallowed; |
| 130 | 130 |
| 131 // Don't squash iframes, frames or plugins. | 131 // Don't squash iframes, frames or plugins. |
| 132 // FIXME: this is only necessary because there is frame code that assumes th
at composited frames are not squashed. | 132 // FIXME: this is only necessary because there is frame code that assumes th
at composited frames are not squashed. |
| 133 if (layer->renderer()->isLayoutPart() || squashingLayer.renderer()->isLayout
Part()) | 133 if (layer->layoutObject()->isLayoutPart() || squashingLayer.layoutObject()->
isLayoutPart()) |
| 134 return CompositingReasonSquashingLayoutPartIsDisallowed; | 134 return CompositingReasonSquashingLayoutPartIsDisallowed; |
| 135 | 135 |
| 136 if (layer->reflectionInfo()) | 136 if (layer->reflectionInfo()) |
| 137 return CompositingReasonSquashingReflectionIsDisallowed; | 137 return CompositingReasonSquashingReflectionIsDisallowed; |
| 138 | 138 |
| 139 if (squashingWouldExceedSparsityTolerance(layer, squashingState)) | 139 if (squashingWouldExceedSparsityTolerance(layer, squashingState)) |
| 140 return CompositingReasonSquashingSparsityExceeded; | 140 return CompositingReasonSquashingSparsityExceeded; |
| 141 | 141 |
| 142 if (layer->renderer()->style()->hasBlendMode()) | 142 if (layer->layoutObject()->style()->hasBlendMode()) |
| 143 return CompositingReasonSquashingBlendingIsDisallowed; | 143 return CompositingReasonSquashingBlendingIsDisallowed; |
| 144 | 144 |
| 145 // FIXME: this is not efficient, since it walks up the tree. We should store
these values on the CompositingInputsCache. | 145 // FIXME: this is not efficient, since it walks up the tree. We should store
these values on the CompositingInputsCache. |
| 146 if (layer->clippingContainer() != squashingLayer.clippingContainer() && !squ
ashingLayer.compositedLayerMapping()->containingSquashedLayer(layer->clippingCon
tainer(), squashingState.nextSquashedLayerIndex)) | 146 if (layer->clippingContainer() != squashingLayer.clippingContainer() && !squ
ashingLayer.compositedLayerMapping()->containingSquashedLayer(layer->clippingCon
tainer(), squashingState.nextSquashedLayerIndex)) |
| 147 return CompositingReasonSquashingClippingContainerMismatch; | 147 return CompositingReasonSquashingClippingContainerMismatch; |
| 148 | 148 |
| 149 // Composited descendants need to be clipped by a child containment graphics
layer, which would not be available if the layer is | 149 // Composited descendants need to be clipped by a child containment graphics
layer, which would not be available if the layer is |
| 150 // squashed (and therefore has no CLM nor a child containment graphics layer
). | 150 // squashed (and therefore has no CLM nor a child containment graphics layer
). |
| 151 if (m_compositor->clipsCompositingDescendants(layer)) | 151 if (m_compositor->clipsCompositingDescendants(layer)) |
| 152 return CompositingReasonSquashedLayerClipsCompositingDescendants; | 152 return CompositingReasonSquashedLayerClipsCompositingDescendants; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 280 |
| 281 LayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowChildre
n | PositiveZOrderChildren); | 281 LayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowChildre
n | PositiveZOrderChildren); |
| 282 while (LayerStackingNode* curNode = iterator.next()) | 282 while (LayerStackingNode* curNode = iterator.next()) |
| 283 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersN
eedingPaintInvalidation); | 283 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersN
eedingPaintInvalidation); |
| 284 | 284 |
| 285 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping
->owningLayer() == layer) | 285 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping
->owningLayer() == layer) |
| 286 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; | 286 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; |
| 287 } | 287 } |
| 288 | 288 |
| 289 } | 289 } |
| OLD | NEW |