Commit f4a839a2 authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

[BlinkGenPropertyTrees] SVG animations should not reset layer invalidations

When an SVG image has animations, SVGImage::ServiceAnimations is called
which updates animations via DocumentAnimations::UpdateAnimations. For
blink generated property trees (BGPT), this is done during paint (see:
LocalFrameView::RunPaintLifecyclePhase) and, because paint is skipped
when updating svg image animations, it must be explicitly invoked for
svg animations. (For non-BGPT, this is done as part of the compositing
step which precedes paint). Updating animations may invalidate the SVG
image's paint layers.

Before this patch, the paint layer invalidations were cleared which
caused the later svg image paint to incorrectly use stale paint data.

Bug: 884240
Cq-Include-Trybots: luci.chromium.try:linux-blink-gen-property-trees;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: If21335672f55db0b937505c6475f55def0be14ac
Reviewed-on: https://chromium-review.googlesource.com/c/1261718Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596760}
parent e0664242
......@@ -210,5 +210,3 @@ crbug.com/882975 virtual/threaded/synthetic_gestures/synthetic-pinch-zoom-gestur
crbug.com/882973 http/tests/devtools/layers/layer-tree-model.js [ Failure ]
crbug.com/884239 virtual/threaded/animations/animationworklet/worklet-animation-local-time-undefined.html [ Failure ]
crbug.com/884240 images/cross-fade-invalidation.html [ Pass Failure ]
......@@ -663,9 +663,12 @@ void SVGImage::ServiceAnimations(
// rect invalidation during paint invalidation of the SVGImage's frame view.
auto* layer = frame_view->GetLayoutView()->Layer();
if (layer->NeedsRepaint()) {
if (auto* observer = GetImageObserver())
if (auto* observer = GetImageObserver()) {
// TODO(pdr): This should use |frame_view->Size()| instead of the
// image's |Rect()|. See the matching non-BGPT call to InvalidateRect in
// InvalidateChromeClient in paint_invalidator.cc.
observer->ChangedInRect(this, Rect());
layer->ClearNeedsRepaintRecursively();
}
}
}
}
......
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