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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 114 } |
115 } | 115 } |
116 return update; | 116 return update; |
117 } | 117 } |
118 | 118 |
119 CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const
RenderLayer* layer, const CompositingLayerAssigner::SquashingState& squashingSt
ate) | 119 CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const
RenderLayer* layer, const CompositingLayerAssigner::SquashingState& squashingSt
ate) |
120 { | 120 { |
121 if (!squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree) | 121 if (!squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree) |
122 return CompositingReasonSquashingWouldBreakPaintOrder; | 122 return CompositingReasonSquashingWouldBreakPaintOrder; |
123 | 123 |
| 124 ASSERT(squashingState.hasMostRecentMapping); |
| 125 const RenderLayer& squashingLayer = squashingState.mostRecentMapping->owning
Layer(); |
| 126 |
124 // FIXME: this special case for video exists only to deal with corner cases | 127 // FIXME: this special case for video exists only to deal with corner cases |
125 // where a RenderVideo does not report that it needs to be directly composit
ed. | 128 // where a RenderVideo does not report that it needs to be directly composit
ed. |
126 // Video does not currently support sharing a backing, but this could be | 129 // Video does not currently support sharing a backing, but this could be |
127 // generalized in the future. The following layout tests fail if we permit t
he | 130 // generalized in the future. The following layout tests fail if we permit t
he |
128 // video to share a backing with other layers. | 131 // video to share a backing with other layers. |
129 // | 132 // |
130 // compositing/video/video-controls-layer-creation.html | 133 // compositing/video/video-controls-layer-creation.html |
131 if (layer->renderer()->isVideo()) | 134 if (layer->renderer()->isVideo() || squashingLayer.renderer()->isVideo()) |
132 return CompositingReasonSquashingVideoIsDisallowed; | 135 return CompositingReasonSquashingVideoIsDisallowed; |
133 | 136 |
134 // Don't squash iframes, frames or plugins. | 137 // Don't squash iframes, frames or plugins. |
135 // FIXME: this is only necessary because there is frame code that assumes th
at composited frames are not squashed. | 138 // FIXME: this is only necessary because there is frame code that assumes th
at composited frames are not squashed. |
136 if (layer->renderer()->isRenderPart()) | 139 if (layer->renderer()->isRenderPart() || squashingLayer.renderer()->isRender
Part()) |
137 return CompositingReasonSquashingRenderPartIsDisallowed; | 140 return CompositingReasonSquashingRenderPartIsDisallowed; |
138 | 141 |
139 if (layer->reflectionInfo()) | 142 if (layer->reflectionInfo()) |
140 return CompositingReasonSquashingReflectionIsDisallowed; | 143 return CompositingReasonSquashingReflectionIsDisallowed; |
141 | 144 |
142 if (squashingWouldExceedSparsityTolerance(layer, squashingState)) | 145 if (squashingWouldExceedSparsityTolerance(layer, squashingState)) |
143 return CompositingReasonSquashingSparsityExceeded; | 146 return CompositingReasonSquashingSparsityExceeded; |
144 | 147 |
145 // FIXME: this is not efficient, since it walks up the tree . We should stor
e these values on the CompositingInputsCache. | 148 // FIXME: this is not efficient, since it walks up the tree. We should store
these values on the CompositingInputsCache. |
146 ASSERT(squashingState.hasMostRecentMapping); | |
147 const RenderLayer& squashingLayer = squashingState.mostRecentMapping->owning
Layer(); | |
148 | |
149 if (layer->clippingContainer() != squashingLayer.clippingContainer() && !squ
ashingLayer.compositedLayerMapping()->containingSquashedLayer(layer->clippingCon
tainer())) | 149 if (layer->clippingContainer() != squashingLayer.clippingContainer() && !squ
ashingLayer.compositedLayerMapping()->containingSquashedLayer(layer->clippingCon
tainer())) |
150 return CompositingReasonSquashingClippingContainerMismatch; | 150 return CompositingReasonSquashingClippingContainerMismatch; |
151 | 151 |
152 // Composited descendants need to be clipped by a child containment graphics
layer, which would not be available if the layer is | 152 // Composited descendants need to be clipped by a child containment graphics
layer, which would not be available if the layer is |
153 // squashed (and therefore has no CLM nor a child containment graphics layer
). | 153 // squashed (and therefore has no CLM nor a child containment graphics layer
). |
154 if (m_compositor->clipsCompositingDescendants(layer)) | 154 if (m_compositor->clipsCompositingDescendants(layer)) |
155 return CompositingReasonSquashedLayerClipsCompositingDescendants; | 155 return CompositingReasonSquashedLayerClipsCompositingDescendants; |
156 | 156 |
157 if (layer->scrollsWithRespectTo(&squashingLayer)) | 157 if (layer->scrollsWithRespectTo(&squashingLayer)) |
158 return CompositingReasonScrollsWithRespectToSquashingLayer; | 158 return CompositingReasonScrollsWithRespectToSquashingLayer; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 287 |
288 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC
hildren | PositiveZOrderChildren); | 288 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC
hildren | PositiveZOrderChildren); |
289 while (RenderLayerStackingNode* curNode = iterator.next()) | 289 while (RenderLayerStackingNode* curNode = iterator.next()) |
290 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersN
eedingPaintInvalidation); | 290 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersN
eedingPaintInvalidation); |
291 | 291 |
292 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping
->owningLayer() == layer) | 292 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping
->owningLayer() == layer) |
293 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; | 293 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; |
294 } | 294 } |
295 | 295 |
296 } | 296 } |
OLD | NEW |