Commit ccceb975 authored by wangxianzhu's avatar wangxianzhu Committed by Commit bot

Enable paint cache for media slider when not checking under-invalidation

The under-invalidation does no real harm except for delayed paint
when buffered ranges change in paused mode.

This improves performance of media control painting which may help
crbug.com/633036.

BUG=484288
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2297453002
Cr-Commit-Position: refs/heads/master@{#415305}
parent 72d0476e
...@@ -103,10 +103,10 @@ void BoxPainter::paintBoxDecorationBackgroundWithRect(const PaintInfo& paintInfo ...@@ -103,10 +103,10 @@ void BoxPainter::paintBoxDecorationBackgroundWithRect(const PaintInfo& paintInfo
bool paintingOverflowContents = isPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer(&m_layoutBox, paintInfo); bool paintingOverflowContents = isPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer(&m_layoutBox, paintInfo);
const ComputedStyle& style = m_layoutBox.styleRef(); const ComputedStyle& style = m_layoutBox.styleRef();
// FIXME: For now we don't have notification on media buffered range change from media player
// and miss paint invalidation on buffered range change. crbug.com/484288.
Optional<DisplayItemCacheSkipper> cacheSkipper; Optional<DisplayItemCacheSkipper> cacheSkipper;
if (style.appearance() == MediaSliderPart // Disable cache in under-invalidation checking mode for MediaSliderPart because we always paint using the
// latest data (buffered ranges, current time and duration) which may be different from the cached data.
if ((RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled() && style.appearance() == MediaSliderPart)
// We may paint a delayed-invalidation object before it's actually invalidated. Note this would be handled for // We may paint a delayed-invalidation object before it's actually invalidated. Note this would be handled for
// us by LayoutObjectDrawingRecorder but we have to use DrawingRecorder as we may use the scrolling contents // us by LayoutObjectDrawingRecorder but we have to use DrawingRecorder as we may use the scrolling contents
// layer as DisplayItemClient below. // layer as DisplayItemClient below.
......
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