Commit d2aa77c3 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Disable under-invalidation checking for animated images

Animated images may change before invalidation. For example, an
image with SVG animation gets ImageChanged notification
periodically but a paint triggered by some other change may not
just follow an invalidation of the animated image.

Bug: 819683
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I5acb3eedc0ac714a600ac6df752dc22245bf3d1d
Reviewed-on: https://chromium-review.googlesource.com/956303
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542211}
parent 053304da
......@@ -3410,7 +3410,6 @@ crbug.com/681919 [ Linux Debug ] http/tests/media/media-src-suspend-before-have-
# Sheriff 2018-03-07
crbug.com/819591 virtual/threaded/animations/hit-testing/composited-with-hit-testing.html [ Failure Pass ]
crbug.com/819683 [ Linux ] paint/invalidation/background/obscured-background-no-repaint.html [ Crash ]
crbug.com/819851 [ Mac ] paint/invalidation/forms/checkbox-focus-by-mouse-then-keydown.html [ Skip ]
crbug.com/819851 [ Mac ] paint/invalidation/forms/radio-focus-by-mouse-then-keydown.html [ Skip ]
crbug.com/819778 [ Linux ] external/wpt/css/cssom-view/interfaces.html [ Pass Timeout ]
......
......@@ -12,6 +12,9 @@ tr { background-image: url(../svg/resources/animated-svg-fixed-size.svg) }
<img id="image">
<script src="../resources/text-based-repaint.js"></script>
<script>
// The occasional under-invalidation of svg animation as background is harmless.
if (window.internals)
internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = false;
window.testIsAsync = true;
function repaintTest() {
if (window.internals)
......
......@@ -112,7 +112,8 @@ void BoxPainter::PaintBoxDecorationBackgroundWithRect(
// because we always paint using the latest data (buffered ranges, current
// time and duration) which may be different from the cached data, and for
// delayed-invalidation object because it may change before it's actually
// invalidated.
// invalidated. Note that we still report harmless under-invalidation of
// non-delayed-invalidation animated background, which should be ignored.
if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled() &&
(style.Appearance() == kMediaSliderPart ||
layout_box_.FullPaintInvalidationReason() ==
......
......@@ -109,12 +109,12 @@ void ImagePainter::PaintReplaced(const PaintInfo& paint_info,
paint_info.phase))
return;
// Disable cache in under-invalidation checking mode for delayed-invalidation
// image because it may change before it's actually invalidated.
// Disable cache in under-invalidation checking mode for animated image
// because it may change before it's actually invalidated.
Optional<DisplayItemCacheSkipper> cache_skipper;
if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled() &&
layout_image_.FullPaintInvalidationReason() ==
PaintInvalidationReason::kDelayedFull)
layout_image_.ImageResource() &&
layout_image_.ImageResource()->MaybeAnimated())
cache_skipper.emplace(context);
LayoutRect content_rect(paint_offset + layout_image_.ContentBoxOffset(),
......
......@@ -6,15 +6,12 @@
#include <memory>
#include "platform/graphics/GraphicsLayer.h"
#include "platform/graphics/LoggingCanvas.h"
#include "platform/graphics/paint/DrawingDisplayItem.h"
#include "platform/instrumentation/tracing/TraceEvent.h"
#include "platform/wtf/AutoReset.h"
#include "platform/wtf/text/StringBuilder.h"
#ifndef NDEBUG
#include "platform/graphics/LoggingCanvas.h"
#endif
namespace blink {
void PaintController::SetTracksRasterInvalidations(bool value) {
......@@ -1019,12 +1016,8 @@ void PaintController::ShowUnderInvalidationError(
LOG(ERROR) << "New display item: " << new_item.AsDebugString();
LOG(ERROR) << "Old display item: "
<< (old_item ? old_item->AsDebugString() : "None");
#else
LOG(ERROR) << "Run a build with DCHECK on to get more details.";
#endif
LOG(ERROR) << "See http://crbug.com/619103.";
#ifndef NDEBUG
const PaintRecord* new_record = nullptr;
if (new_item.IsDrawing()) {
new_record =
......@@ -1044,7 +1037,10 @@ void PaintController::ShowUnderInvalidationError(
: "None");
ShowDebugData();
#endif // NDEBUG
#else
LOG(ERROR) << "Run a build with DCHECK on to get more details.";
LOG(ERROR) << "See http://crbug.com/619103.";
#endif
}
void PaintController::ShowSequenceUnderInvalidationError(
......
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