Chromium Code Reviews| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 return SquashingDisallowedReasonWouldBreakPaintOrder; | 126 return SquashingDisallowedReasonWouldBreakPaintOrder; |
| 127 | 127 |
| 128 DCHECK(squashingState.hasMostRecentMapping); | 128 DCHECK(squashingState.hasMostRecentMapping); |
| 129 const PaintLayer& squashingLayer = | 129 const PaintLayer& squashingLayer = |
| 130 squashingState.mostRecentMapping->owningLayer(); | 130 squashingState.mostRecentMapping->owningLayer(); |
| 131 | 131 |
| 132 // FIXME: this special case for video exists only to deal with corner cases | 132 // FIXME: this special case for video exists only to deal with corner cases |
| 133 // where a LayoutVideo does not report that it needs to be directly | 133 // where a LayoutVideo does not report that it needs to be directly |
| 134 // composited. Video does not currently support sharing a backing, but this | 134 // composited. Video does not currently support sharing a backing, but this |
| 135 // could be generalized in the future. The following layout tests fail if we | 135 // could be generalized in the future. The following layout tests fail if we |
| 136 // permit the video to share a backing with other layers. | 136 // permit the video to share a backing with other laycers. |
|
amineer
2017/03/23 17:30:12
typo?
| |
| 137 // | 137 // |
| 138 // compositing/video/video-controls-layer-creation.html | 138 // compositing/video/video-controls-layer-creation.html |
| 139 if (layer->layoutObject().isVideo() || | 139 if (layer->layoutObject().isVideo() || |
| 140 squashingLayer.layoutObject().isVideo()) | 140 squashingLayer.layoutObject().isVideo()) |
| 141 return SquashingDisallowedReasonSquashingVideoIsDisallowed; | 141 return SquashingDisallowedReasonSquashingVideoIsDisallowed; |
| 142 | 142 |
| 143 // Don't squash iframes, frames or plugins. | 143 // Don't squash iframes, frames or plugins. |
| 144 // FIXME: this is only necessary because there is frame code that assumes that | 144 // FIXME: this is only necessary because there is frame code that assumes that |
| 145 // composited frames are not squashed. | 145 // composited frames are not squashed. |
| 146 if (layer->layoutObject().isLayoutPart() || | 146 if (layer->layoutObject().isLayoutPart() || |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 166 // has no CLM nor a child containment graphics layer). | 166 // has no CLM nor a child containment graphics layer). |
| 167 if (m_compositor->clipsCompositingDescendants(layer)) | 167 if (m_compositor->clipsCompositingDescendants(layer)) |
| 168 return SquashingDisallowedReasonSquashedLayerClipsCompositingDescendants; | 168 return SquashingDisallowedReasonSquashedLayerClipsCompositingDescendants; |
| 169 | 169 |
| 170 if (layer->scrollsWithRespectTo(&squashingLayer)) | 170 if (layer->scrollsWithRespectTo(&squashingLayer)) |
| 171 return SquashingDisallowedReasonScrollsWithRespectToSquashingLayer; | 171 return SquashingDisallowedReasonScrollsWithRespectToSquashingLayer; |
| 172 | 172 |
| 173 if (layer->scrollParent() && layer->hasCompositingDescendant()) | 173 if (layer->scrollParent() && layer->hasCompositingDescendant()) |
| 174 return SquashingDisallowedReasonScrollChildWithCompositedDescendants; | 174 return SquashingDisallowedReasonScrollChildWithCompositedDescendants; |
| 175 | 175 |
| 176 // It's possible for this reason to be true but not the above ones. One | |
| 177 // example is scrolling input boxes, which do not "scroll" but use | |
| 178 // scrolling contents layers to allow typing beyond the input bounds. | |
| 179 if ((squashingLayer.getScrollableArea() && | |
| 180 squashingLayer.getScrollableArea()->usesCompositedScrolling()) || | |
| 181 (layer->getScrollableArea() && | |
| 182 layer->getScrollableArea()->usesCompositedScrolling())) | |
| 183 return SquashingDisallowedReasonCompositedScrolling; | |
| 184 | |
| 176 if (layer->opacityAncestor() != squashingLayer.opacityAncestor()) | 185 if (layer->opacityAncestor() != squashingLayer.opacityAncestor()) |
| 177 return SquashingDisallowedReasonOpacityAncestorMismatch; | 186 return SquashingDisallowedReasonOpacityAncestorMismatch; |
| 178 | 187 |
| 179 if (layer->transformAncestor() != squashingLayer.transformAncestor()) | 188 if (layer->transformAncestor() != squashingLayer.transformAncestor()) |
| 180 return SquashingDisallowedReasonTransformAncestorMismatch; | 189 return SquashingDisallowedReasonTransformAncestorMismatch; |
| 181 | 190 |
| 182 if (layer->transform() && !layer->transform()->isIdentityOrTranslation()) | 191 if (layer->transform() && !layer->transform()->isIdentityOrTranslation()) |
| 183 return SquashingDisallowedReasonNonTranslationTransform; | 192 return SquashingDisallowedReasonNonTranslationTransform; |
| 184 | 193 |
| 185 if (layer->renderingContextRoot() != squashingLayer.renderingContextRoot()) | 194 if (layer->renderingContextRoot() != squashingLayer.renderingContextRoot()) |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 350 while (PaintLayerStackingNode* curNode = iterator.next()) | 359 while (PaintLayerStackingNode* curNode = iterator.next()) |
| 351 assignLayersToBackingsInternal(curNode->layer(), squashingState, | 360 assignLayersToBackingsInternal(curNode->layer(), squashingState, |
| 352 layersNeedingPaintInvalidation); | 361 layersNeedingPaintInvalidation); |
| 353 | 362 |
| 354 if (squashingState.hasMostRecentMapping && | 363 if (squashingState.hasMostRecentMapping && |
| 355 &squashingState.mostRecentMapping->owningLayer() == layer) | 364 &squashingState.mostRecentMapping->owningLayer() == layer) |
| 356 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; | 365 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; |
| 357 } | 366 } |
| 358 | 367 |
| 359 } // namespace blink | 368 } // namespace blink |
| OLD | NEW |