Commit 8920316b authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[SPv175+] Correct initial property tree state for SVGFilterRecordingContext

Previously we used PropertyTreeState::Root() as the initial property
tree state and replay state in SVGFilterRecordingContext, which was
incorrect causing e.g. extra transforms applied in the recorded filter.

Now use the property tree state of the painting context.

Bug: 771643
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I07c3cbac74cda079c146a66b193450705909114d
Reviewed-on: https://chromium-review.googlesource.com/857747Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528349}
parent 6fe1de9c
......@@ -89,8 +89,6 @@ crbug.com/771643 virtual/spv175/paint/invalidation/forms/select-option-backgroun
crbug.com/771643 virtual/spv175/paint/invalidation/position/position-change-keeping-geometry.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/svg/absolute-sized-content-with-resources.xhtml [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/svg/deep-dynamic-updates.svg [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/svg/filter-refresh.svg [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/svg/paintorder-filtered.svg [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/svg/text-viewbox-rescale.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/svg/use-clipped-hit.svg [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/svg/zoom-coords-viewattr-01-b.svg [ Failure ]
......
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutSVGContainer g",
"rect": [10, 170, 132, 36],
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"rect": [10, 130, 132, 36],
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='separate2'",
"rect": [140, 140, 36, 36],
"reason": "full"
},
{
"object": "LayoutSVGRect rect id='filtered'",
"rect": [140, 100, 36, 36],
"reason": "full"
},
{
"object": "LayoutSVGContainer g",
"rect": [140, 60, 36, 36],
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"rect": [90, 90, 36, 36],
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"rect": [90, 50, 36, 36],
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"rect": [50, 90, 36, 36],
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"rect": [50, 50, 36, 36],
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"rect": [10, 90, 36, 36],
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"rect": [10, 50, 36, 36],
"reason": "SVG resource change"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='rect'",
"reason": "appeared"
},
{
"object": "LayoutSVGContainer g",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGRect rect id='separate1'",
"reason": "style change"
},
{
"object": "LayoutSVGRect rect id='filtered'",
"reason": "style change"
},
{
"object": "LayoutSVGRect rect id='separate2'",
"reason": "style change"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutSVGContainer use",
"rect": [451, 160, 140, 140],
"reason": "SVG resource change"
},
{
"object": "LayoutSVGContainer use id='t2'",
"rect": [179, 160, 140, 140],
"reason": "style change"
},
{
"object": "LayoutSVGContainer use id='t1'",
"rect": [42, 160, 140, 140],
"reason": "style change"
},
{
"object": "LayoutSVGViewportContainer svg",
"rect": [318, 163, 137, 137],
"reason": "SVG resource change"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "LayoutSVGContainer use id='t1'",
"reason": "style change"
},
{
"object": "LayoutSVGViewportContainer svg id='poly'",
"reason": "style change"
},
{
"object": "LayoutSVGPath polygon",
"reason": "style change"
},
{
"object": "LayoutSVGContainer use id='t2'",
"reason": "style change"
},
{
"object": "LayoutSVGViewportContainer svg id='poly'",
"reason": "style change"
},
{
"object": "LayoutSVGPath polygon",
"reason": "style change"
},
{
"object": "LayoutSVGViewportContainer svg",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGPath polygon id='t3'",
"reason": "style change"
},
{
"object": "LayoutSVGContainer use",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGViewportContainer svg id='poly2'",
"reason": "SVG resource change"
},
{
"object": "LayoutSVGPath polygon",
"reason": "style change"
}
]
}
......@@ -21,11 +21,12 @@ GraphicsContext* SVGFilterRecordingContext::BeginContent() {
paint_controller_ = PaintController::Create();
context_ = WTF::WrapUnique(new GraphicsContext(*paint_controller_));
// Content painted into a new PaintRecord in SPv2 will have an
// independent property tree set.
if (RuntimeEnabledFeatures::SlimmingPaintV175Enabled()) {
// Use initial_context_'s current paint chunk properties so that any new
// chunk created during painting the content will be in the correct state.
paint_controller_->UpdateCurrentPaintChunkProperties(
WTF::nullopt, PropertyTreeState::Root());
WTF::nullopt,
initial_context_.GetPaintController().CurrentPaintChunkProperties());
}
return context_.get();
}
......@@ -38,8 +39,10 @@ sk_sp<PaintRecord> SVGFilterRecordingContext::EndContent(
context_->BeginRecording(bounds);
paint_controller_->CommitNewDisplayItems();
paint_controller_->GetPaintArtifact().Replay(*context_,
PropertyTreeState::Root());
paint_controller_->GetPaintArtifact().Replay(
*context_, initial_context_.GetPaintController()
.CurrentPaintChunkProperties()
.property_tree_state);
sk_sp<PaintRecord> content = context_->EndRecording();
// Content is cached by the source graphic so temporaries can be freed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment