| Index: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
|
| index 906b3ed09c5693e93521154066216337518a8569..98dec728113c1b5dfd767de39b560e9c62a8de8b 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
|
| @@ -270,8 +270,7 @@ PaintArtifactCompositor::compositedLayerForPendingLayer(
|
| gfx::Vector2dF& layerOffset,
|
| Vector<std::unique_ptr<ContentLayerClientImpl>>& newContentLayerClients,
|
| RasterInvalidationTrackingMap<const PaintChunk>* trackingMap,
|
| - bool storeDebugInfo,
|
| - GeometryMapper& geometryMapper) {
|
| + bool storeDebugInfo) {
|
| DCHECK(pendingLayer.paintChunks.size());
|
| const PaintChunk& firstPaintChunk = *pendingLayer.paintChunks[0];
|
| DCHECK(firstPaintChunk.size());
|
| @@ -291,9 +290,9 @@ PaintArtifactCompositor::compositedLayerForPendingLayer(
|
|
|
| layerOffset = ccCombinedBounds.OffsetFromOrigin();
|
| scoped_refptr<cc::DisplayItemList> displayList =
|
| - PaintChunksToCcLayer::convert(
|
| - pendingLayer.paintChunks, pendingLayer.propertyTreeState, layerOffset,
|
| - paintArtifact.getDisplayItemList(), geometryMapper);
|
| + PaintChunksToCcLayer::convert(pendingLayer.paintChunks,
|
| + pendingLayer.propertyTreeState, layerOffset,
|
| + paintArtifact.getDisplayItemList());
|
| contentLayerClient->SetDisplayList(std::move(displayList));
|
| contentLayerClient->SetPaintableRegion(gfx::Rect(ccCombinedBounds.size()));
|
|
|
| @@ -353,15 +352,13 @@ PaintArtifactCompositor::PendingLayer::PendingLayer(
|
| paintChunks.push_back(&firstPaintChunk);
|
| }
|
|
|
| -void PaintArtifactCompositor::PendingLayer::merge(
|
| - const PendingLayer& guest,
|
| - GeometryMapper& geometryMapper) {
|
| +void PaintArtifactCompositor::PendingLayer::merge(const PendingLayer& guest) {
|
| DCHECK(!isForeign && !guest.isForeign);
|
| DCHECK_EQ(backfaceHidden, guest.backfaceHidden);
|
|
|
| paintChunks.appendVector(guest.paintChunks);
|
| FloatRect guestBoundsInHome = guest.bounds;
|
| - geometryMapper.localToAncestorVisualRect(
|
| + GeometryMapper::localToAncestorVisualRect(
|
| guest.propertyTreeState, propertyTreeState, guestBoundsInHome);
|
| FloatRect oldBounds = bounds;
|
| bounds.unite(guestBoundsInHome);
|
| @@ -386,10 +383,10 @@ bool PaintArtifactCompositor::PendingLayer::canMerge(
|
| }
|
|
|
| void PaintArtifactCompositor::PendingLayer::upcast(
|
| - const PropertyTreeState& newState,
|
| - GeometryMapper& geometryMapper) {
|
| + const PropertyTreeState& newState) {
|
| DCHECK(!isForeign);
|
| - geometryMapper.localToAncestorVisualRect(propertyTreeState, newState, bounds);
|
| + GeometryMapper::localToAncestorVisualRect(propertyTreeState, newState,
|
| + bounds);
|
|
|
| propertyTreeState = newState;
|
| // TODO(crbug.com/701991): Upgrade GeometryMapper.
|
| @@ -451,18 +448,17 @@ static const EffectPaintPropertyNode* strictChildOfAlongPath(
|
| }
|
|
|
| bool PaintArtifactCompositor::mightOverlap(const PendingLayer& layerA,
|
| - const PendingLayer& layerB,
|
| - GeometryMapper& geometryMapper) {
|
| + const PendingLayer& layerB) {
|
| PropertyTreeState rootPropertyTreeState(TransformPaintPropertyNode::root(),
|
| ClipPaintPropertyNode::root(),
|
| EffectPaintPropertyNode::root());
|
|
|
| FloatRect boundsA = layerA.bounds;
|
| - geometryMapper.localToAncestorVisualRect(layerA.propertyTreeState,
|
| - rootPropertyTreeState, boundsA);
|
| + GeometryMapper::localToAncestorVisualRect(layerA.propertyTreeState,
|
| + rootPropertyTreeState, boundsA);
|
| FloatRect boundsB = layerB.bounds;
|
| - geometryMapper.localToAncestorVisualRect(layerB.propertyTreeState,
|
| - rootPropertyTreeState, boundsB);
|
| + GeometryMapper::localToAncestorVisualRect(layerB.propertyTreeState,
|
| + rootPropertyTreeState, boundsB);
|
|
|
| return boundsA.intersects(boundsB);
|
| }
|
| @@ -493,7 +489,6 @@ bool PaintArtifactCompositor::canDecompositeEffect(
|
| void PaintArtifactCompositor::layerizeGroup(
|
| const PaintArtifact& paintArtifact,
|
| Vector<PendingLayer>& pendingLayers,
|
| - GeometryMapper& geometryMapper,
|
| const EffectPaintPropertyNode& currentGroup,
|
| Vector<PaintChunk>::const_iterator& chunkIt) {
|
| size_t firstLayerInCurrentGroup = pendingLayers.size();
|
| @@ -539,8 +534,7 @@ void PaintArtifactCompositor::layerizeGroup(
|
| // Case C: The following chunks belong to a subgroup. Process them by
|
| // a recursion call.
|
| size_t firstLayerInSubgroup = pendingLayers.size();
|
| - layerizeGroup(paintArtifact, pendingLayers, geometryMapper, *subgroup,
|
| - chunkIt);
|
| + layerizeGroup(paintArtifact, pendingLayers, *subgroup, chunkIt);
|
| // Now the chunk iterator stepped over the subgroup we just saw.
|
| // If the subgroup generated 2 or more layers then the subgroup must be
|
| // composited to satisfy grouping requirement.
|
| @@ -554,10 +548,9 @@ void PaintArtifactCompositor::layerizeGroup(
|
| PendingLayer& subgroupLayer = pendingLayers[firstLayerInSubgroup];
|
| if (!canDecompositeEffect(subgroup, subgroupLayer))
|
| continue;
|
| - subgroupLayer.upcast(
|
| - PropertyTreeState(subgroup->localTransformSpace(),
|
| - subgroup->outputClip(), ¤tGroup),
|
| - geometryMapper);
|
| + subgroupLayer.upcast(PropertyTreeState(subgroup->localTransformSpace(),
|
| + subgroup->outputClip(),
|
| + ¤tGroup));
|
| }
|
| // At this point pendingLayers.back() is the either a layer from a
|
| // "decomposited" subgroup or a layer created from a chunk we just
|
| @@ -571,11 +564,11 @@ void PaintArtifactCompositor::layerizeGroup(
|
| candidateIndex-- > firstLayerInCurrentGroup;) {
|
| PendingLayer& candidateLayer = pendingLayers[candidateIndex];
|
| if (candidateLayer.canMerge(newLayer)) {
|
| - candidateLayer.merge(newLayer, geometryMapper);
|
| + candidateLayer.merge(newLayer);
|
| pendingLayers.pop_back();
|
| break;
|
| }
|
| - if (mightOverlap(newLayer, candidateLayer, geometryMapper))
|
| + if (mightOverlap(newLayer, candidateLayer))
|
| break;
|
| }
|
| }
|
| @@ -583,20 +576,18 @@ void PaintArtifactCompositor::layerizeGroup(
|
|
|
| void PaintArtifactCompositor::collectPendingLayers(
|
| const PaintArtifact& paintArtifact,
|
| - Vector<PendingLayer>& pendingLayers,
|
| - GeometryMapper& geometryMapper) {
|
| + Vector<PendingLayer>& pendingLayers) {
|
| Vector<PaintChunk>::const_iterator cursor =
|
| paintArtifact.paintChunks().begin();
|
| - layerizeGroup(paintArtifact, pendingLayers, geometryMapper,
|
| - *EffectPaintPropertyNode::root(), cursor);
|
| + layerizeGroup(paintArtifact, pendingLayers, *EffectPaintPropertyNode::root(),
|
| + cursor);
|
| DCHECK_EQ(paintArtifact.paintChunks().end(), cursor);
|
| }
|
|
|
| void PaintArtifactCompositor::update(
|
| const PaintArtifact& paintArtifact,
|
| RasterInvalidationTrackingMap<const PaintChunk>* rasterChunkInvalidations,
|
| - bool storeDebugInfo,
|
| - GeometryMapper& geometryMapper) {
|
| + bool storeDebugInfo) {
|
| #ifndef NDEBUG
|
| storeDebugInfo = true;
|
| #endif
|
| @@ -622,7 +613,7 @@ void PaintArtifactCompositor::update(
|
| sPropertyTreeSequenceNumber);
|
|
|
| Vector<PendingLayer, 0> pendingLayers;
|
| - collectPendingLayers(paintArtifact, pendingLayers, geometryMapper);
|
| + collectPendingLayers(paintArtifact, pendingLayers);
|
|
|
| Vector<std::unique_ptr<ContentLayerClientImpl>> newContentLayerClients;
|
| newContentLayerClients.reserveCapacity(paintArtifact.paintChunks().size());
|
| @@ -630,7 +621,7 @@ void PaintArtifactCompositor::update(
|
| gfx::Vector2dF layerOffset;
|
| scoped_refptr<cc::Layer> layer = compositedLayerForPendingLayer(
|
| paintArtifact, pendingLayer, layerOffset, newContentLayerClients,
|
| - rasterChunkInvalidations, storeDebugInfo, geometryMapper);
|
| + rasterChunkInvalidations, storeDebugInfo);
|
|
|
| const auto* transform = pendingLayer.propertyTreeState.transform();
|
| int transformId =
|
|
|