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

Side by Side Diff: third_party/WebKit/Source/core/paint/BoxPainter.cpp

Issue 2280123002: Fix under-invalidation of media buffered ranges (Closed)
Patch Set: Synchronize buffered ranges when the current play time changes Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/BoxPainter.h" 5 #include "core/paint/BoxPainter.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/html/HTMLFrameOwnerElement.h" 9 #include "core/html/HTMLFrameOwnerElement.h"
10 #include "core/layout/ImageQualityController.h" 10 #include "core/layout/ImageQualityController.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return bleedAvoidance == BackgroundBleedClipOnly || bleedAvoidance == Backgr oundBleedClipLayer; 96 return bleedAvoidance == BackgroundBleedClipOnly || bleedAvoidance == Backgr oundBleedClipLayer;
97 } 97 }
98 98
99 } // anonymous namespace 99 } // anonymous namespace
100 100
101 void BoxPainter::paintBoxDecorationBackgroundWithRect(const PaintInfo& paintInfo , const LayoutPoint& paintOffset, const LayoutRect& paintRect) 101 void BoxPainter::paintBoxDecorationBackgroundWithRect(const PaintInfo& paintInfo , const LayoutPoint& paintOffset, const LayoutRect& paintRect)
102 { 102 {
103 bool paintingOverflowContents = isPaintingBackgroundOfPaintContainerIntoScro llingContentsLayer(&m_layoutBox, paintInfo); 103 bool paintingOverflowContents = isPaintingBackgroundOfPaintContainerIntoScro llingContentsLayer(&m_layoutBox, paintInfo);
104 const ComputedStyle& style = m_layoutBox.styleRef(); 104 const ComputedStyle& style = m_layoutBox.styleRef();
105 105
106 // FIXME: For now we don't have notification on media buffered range change from media player 106 // We may paint a delayed-invalidation object before it's actually invalidat ed. Note this would be handled for
107 // and miss paint invalidation on buffered range change. crbug.com/484288. 107 // us by LayoutObjectDrawingRecorder but we have to use DrawingRecorder as w e may use the scrolling contents
108 // layer as DisplayItemClient below.
108 Optional<DisplayItemCacheSkipper> cacheSkipper; 109 Optional<DisplayItemCacheSkipper> cacheSkipper;
109 if (style.appearance() == MediaSliderPart 110 if (m_layoutBox.fullPaintInvalidationReason() == PaintInvalidationDelayedFul l)
110 // We may paint a delayed-invalidation object before it's actually inval idated. Note this would be handled for
111 // us by LayoutObjectDrawingRecorder but we have to use DrawingRecorder as we may use the scrolling contents
112 // layer as DisplayItemClient below.
113 || m_layoutBox.fullPaintInvalidationReason() == PaintInvalidationDelayed Full) {
114 cacheSkipper.emplace(paintInfo.context); 111 cacheSkipper.emplace(paintInfo.context);
115 }
116 112
117 const DisplayItemClient& displayItemClient = paintingOverflowContents ? stat ic_cast<const DisplayItemClient&>(*m_layoutBox.layer()->compositedLayerMapping() ->scrollingContentsLayer()) : m_layoutBox; 113 const DisplayItemClient& displayItemClient = paintingOverflowContents ? stat ic_cast<const DisplayItemClient&>(*m_layoutBox.layer()->compositedLayerMapping() ->scrollingContentsLayer()) : m_layoutBox;
118 if (DrawingRecorder::useCachedDrawingIfPossible(paintInfo.context, displayIt emClient, DisplayItem::BoxDecorationBackground)) 114 if (DrawingRecorder::useCachedDrawingIfPossible(paintInfo.context, displayIt emClient, DisplayItem::BoxDecorationBackground))
119 return; 115 return;
120 116
121 DrawingRecorder recorder(paintInfo.context, displayItemClient, DisplayItem:: BoxDecorationBackground, FloatRect(boundsForDrawingRecorder(paintInfo, paintOffs et))); 117 DrawingRecorder recorder(paintInfo.context, displayItemClient, DisplayItem:: BoxDecorationBackground, FloatRect(boundsForDrawingRecorder(paintInfo, paintOffs et)));
122 BoxDecorationData boxDecorationData(m_layoutBox); 118 BoxDecorationData boxDecorationData(m_layoutBox);
123 GraphicsContextStateSaver stateSaver(paintInfo.context, false); 119 GraphicsContextStateSaver stateSaver(paintInfo.context, false);
124 120
125 if (!paintingOverflowContents) { 121 if (!paintingOverflowContents) {
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 } 863 }
868 } 864 }
869 865
870 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document) 866 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document)
871 { 867 {
872 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus tEconomy 868 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus tEconomy
873 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ()); 869 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ());
874 } 870 }
875 871
876 } // namespace blink 872 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698