Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| index 46f51bb1e039bc6de704030e6d337f9ff203abff..6904e51ee26f73e256860b8d2c469cf4fe85ba9f 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| @@ -1376,6 +1376,7 @@ enum ApplyToGraphicsLayersModeFlags { |
| ApplyToMaskLayers = (1 << 4), |
| ApplyToContentLayers = (1 << 5), |
| ApplyToChildContainingLayers = (1 << 6), // layers between m_graphicsLayer and children |
| + ApplyToScrollingContentsLayer = (1 << 7), |
| ApplyToAllGraphicsLayers = (ApplyToSquashingLayer | ApplyToScrollbarLayers | ApplyToBackgroundLayer | ApplyToMaskLayers | ApplyToLayersAffectedByPreserve3D | ApplyToContentLayers) |
| }; |
| typedef unsigned ApplyToGraphicsLayersMode; |
| @@ -1395,7 +1396,7 @@ static void ApplyToGraphicsLayers(const CompositedLayerMapping* mapping, const F |
| f(mapping->scrollingLayer()); |
| if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildContainingLayers)) && mapping->scrollingBlockSelectionLayer()) |
| f(mapping->scrollingBlockSelectionLayer()); |
| - if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLayers) || (mode & ApplyToChildContainingLayers)) && mapping->scrollingContentsLayer()) |
| + if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLayers) || (mode & ApplyToChildContainingLayers) || (mode & ApplyToScrollingContentsLayer)) && mapping->scrollingContentsLayer()) |
| f(mapping->scrollingContentsLayer()); |
| if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLayers)) && mapping->foregroundLayer()) |
| f(mapping->foregroundLayer()); |
| @@ -2038,12 +2039,19 @@ void CompositedLayerMapping::setContentsNeedDisplayInRect(const LayoutRect& r, P |
| void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClientWrapper& displayItemClient, PaintInvalidationReason paintInvalidationReason, const LayoutRect& previousPaintInvalidationRect, const LayoutRect& newPaintInvalidationRect) |
| { |
| // FIXME: need to split out paint invalidations for the background. |
| - // FIXME: need to distinguish invalidations for different layers (e.g. the main layer and scrolling layer). crbug.com/416535. |
| ApplyToGraphicsLayers(this, [&displayItemClient, paintInvalidationReason, previousPaintInvalidationRect, newPaintInvalidationRect](GraphicsLayer* layer) { |
| layer->invalidateDisplayItemClient(displayItemClient, paintInvalidationReason, enclosingIntRect(previousPaintInvalidationRect), enclosingIntRect(newPaintInvalidationRect)); |
| }, ApplyToContentLayers); |
| } |
| +void CompositedLayerMapping::invalidateDisplayItemClientOnScrollingContentsLayer(const DisplayItemClientWrapper& displayItemClient, PaintInvalidationReason paintInvalidationReason, const LayoutRect& previousPaintInvalidationRect, const LayoutRect& newPaintInvalidationRect) |
| +{ |
| + // FIXME: need to split out paint invalidations for the background. |
|
chrishtr
2015/10/16 00:55:38
TODO(wangxianzhu). Also represent in a bug blockin
Xianzhu
2015/10/16 17:38:05
Actually the FIXME won't apply for spv2 so I remov
|
| + ApplyToGraphicsLayers(this, [&displayItemClient, paintInvalidationReason, previousPaintInvalidationRect, newPaintInvalidationRect](GraphicsLayer* layer) { |
| + layer->invalidateDisplayItemClient(displayItemClient, paintInvalidationReason, enclosingIntRect(previousPaintInvalidationRect), enclosingIntRect(newPaintInvalidationRect)); |
| + }, ApplyToScrollingContentsLayer); |
| +} |
| + |
| const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(const LayoutObject* layoutObject, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIndex) |
| { |
| for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) { |