Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp

Issue 2745563004: Reduce copying of local data structures in GeometryMapper and PaintLayerClipper. (Closed)
Patch Set: none Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9050f4972e6fa2d81ad03f4a3c52c80b58560504..b0927fb6f0083d066c36fc70bf457ef6e6bc8596 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -289,11 +289,11 @@ static void applyClipsBetweenStates(const PropertyTreeState& localState,
}
#endif
- FloatRect combinedClip =
- geometryMapper.localToAncestorClipRect(localState, ancestorState).rect();
+ const FloatClipRect& combinedClip =
+ geometryMapper.localToAncestorClipRect(localState, ancestorState);
ccList.CreateAndAppendPairedBeginItem<cc::FloatClipDisplayItem>(
- gfx::RectF(combinedClip));
+ gfx::RectF(combinedClip.rect()));
endDisplayItems.push_back(EndClip);
}
@@ -604,19 +604,15 @@ bool PaintArtifactCompositor::mightOverlap(
ClipPaintPropertyNode::root(),
EffectPaintPropertyNode::root());
- FloatRect paintChunkScreenVisualRect =
- geometryMapper
- .localToAncestorVisualRect(paintChunk.bounds,
- paintChunk.properties.propertyTreeState,
- rootPropertyTreeState)
- .rect();
+ FloatRect paintChunkScreenVisualRect = paintChunk.bounds;
+ geometryMapper.localToAncestorVisualRect(
+ paintChunk.properties.propertyTreeState, rootPropertyTreeState,
+ paintChunkScreenVisualRect);
- FloatRect pendingLayerScreenVisualRect =
- geometryMapper
- .localToAncestorVisualRect(candidatePendingLayer.bounds,
- candidatePendingLayer.propertyTreeState,
- rootPropertyTreeState)
- .rect();
+ FloatRect pendingLayerScreenVisualRect = candidatePendingLayer.bounds;
+ geometryMapper.localToAncestorVisualRect(
+ candidatePendingLayer.propertyTreeState, rootPropertyTreeState,
+ pendingLayerScreenVisualRect);
return paintChunkScreenVisualRect.intersects(pendingLayerScreenVisualRect);
}
@@ -637,9 +633,9 @@ void PaintArtifactCompositor::PendingLayer::add(
paintChunks.push_back(&paintChunk);
FloatRect mappedBounds = paintChunk.bounds;
if (geometryMapper) {
- mappedBounds = geometryMapper->localToAncestorRect(
- mappedBounds, paintChunk.properties.propertyTreeState.transform(),
- propertyTreeState.transform());
+ geometryMapper->localToAncestorRect(
+ paintChunk.properties.propertyTreeState.transform(),
+ propertyTreeState.transform(), mappedBounds);
}
bounds.unite(mappedBounds);
if (bounds.size() != paintChunks[0]->bounds.size()) {

Powered by Google App Engine
This is Rietveld 408576698