| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 return update; | 115 return update; |
| 116 } | 116 } |
| 117 | 117 |
| 118 CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const
RenderLayer* layer, const CompositingLayerAssigner::SquashingState& squashingSt
ate) | 118 CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const
RenderLayer* layer, const CompositingLayerAssigner::SquashingState& squashingSt
ate) |
| 119 { | 119 { |
| 120 if (!squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree) | 120 if (!squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree) |
| 121 return CompositingReasonSquashingWouldBreakPaintOrder; | 121 return CompositingReasonSquashingWouldBreakPaintOrder; |
| 122 | 122 |
| 123 // FIXME: this special case for video exists only to deal with corner cases | |
| 124 // where a RenderVideo does not report that it needs to be directly composit
ed. | |
| 125 // Video does not currently support sharing a backing, but this could be | |
| 126 // generalized in the future. The following layout tests fail if we permit t
he | |
| 127 // video to share a backing with other layers. | |
| 128 // | |
| 129 // compositing/video/video-controls-layer-creation.html | |
| 130 if (layer->renderer()->isVideo()) | |
| 131 return CompositingReasonSquashingVideoIsDisallowed; | |
| 132 | |
| 133 if (squashingWouldExceedSparsityTolerance(layer, squashingState)) | 123 if (squashingWouldExceedSparsityTolerance(layer, squashingState)) |
| 134 return CompositingReasonSquashingSparsityExceeded; | 124 return CompositingReasonSquashingSparsityExceeded; |
| 135 | 125 |
| 136 // FIXME: this is not efficient, since it walks up the tree . We should stor
e these values on the CompositingInputsCache. | 126 // FIXME: this is not efficient, since it walks up the tree . We should stor
e these values on the CompositingInputsCache. |
| 137 ASSERT(squashingState.hasMostRecentMapping); | 127 ASSERT(squashingState.hasMostRecentMapping); |
| 138 const RenderLayer& squashingLayer = squashingState.mostRecentMapping->owning
Layer(); | 128 const RenderLayer& squashingLayer = squashingState.mostRecentMapping->owning
Layer(); |
| 139 | 129 |
| 140 if (layer->clippingContainer() != squashingLayer.clippingContainer() && !squ
ashingLayer.compositedLayerMapping()->containingSquashedLayer(layer->clippingCon
tainer())) | 130 if (layer->clippingContainer() != squashingLayer.clippingContainer() && !squ
ashingLayer.compositedLayerMapping()->containingSquashedLayer(layer->clippingCon
tainer())) |
| 141 return CompositingReasonSquashingClippingContainerMismatch; | 131 return CompositingReasonSquashingClippingContainerMismatch; |
| 142 | 132 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 245 |
| 256 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC
hildren | PositiveZOrderChildren); | 246 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC
hildren | PositiveZOrderChildren); |
| 257 while (RenderLayerStackingNode* curNode = iterator.next()) | 247 while (RenderLayerStackingNode* curNode = iterator.next()) |
| 258 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersN
eedingPaintInvalidation); | 248 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersN
eedingPaintInvalidation); |
| 259 | 249 |
| 260 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping
->owningLayer() == layer) | 250 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping
->owningLayer() == layer) |
| 261 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; | 251 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; |
| 262 } | 252 } |
| 263 | 253 |
| 264 } | 254 } |
| OLD | NEW |