OLD | NEW |
---|---|
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // FIXME: For now we don't have notification on media buffered range change from media player |
107 // and miss paint invalidation on buffered range change. crbug.com/484288. | 107 // and miss paint invalidation on buffered range change. crbug.com/484288. |
108 Optional<DisplayItemCacheSkipper> cacheSkipper; | 108 Optional<DisplayItemCacheSkipper> cacheSkipper; |
109 if (style.appearance() == MediaSliderPart) | 109 if (style.appearance() == MediaSliderPart) |
110 cacheSkipper.emplace(paintInfo.context); | 110 cacheSkipper.emplace(paintInfo.context); |
111 | 111 |
112 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex t, m_layoutBox, DisplayItem::BoxDecorationBackground)) | 112 const DisplayItemClient& displayItemClient = paintingOverflowContents ? stat ic_cast<const DisplayItemClient&>(*m_layoutBox.layer()->compositedLayerMapping() ->scrollingContentsLayer()) : m_layoutBox; |
Xianzhu
2016/08/17 23:28:48
Can you make sure if paint invalidation work for t
wkorman
2016/08/18 17:26:23
Hmm, it does not, and it does at ToT. Paint flashi
wkorman
2016/08/18 18:02:02
Invalidation not working is specific to 'local' be
flackr
2016/08/18 19:03:39
Invalidations were supposed to be fixed by https:/
wkorman
2016/08/18 19:46:00
OK, that change is helpful re: involved code, than
wkorman
2016/08/18 21:16:59
So it looks like we're invalidating the correct re
| |
113 if (DrawingRecorder::useCachedDrawingIfPossible(paintInfo.context, displayIt emClient, DisplayItem::BoxDecorationBackground)) | |
113 return; | 114 return; |
114 | 115 |
115 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutBox, Display Item::BoxDecorationBackground, boundsForDrawingRecorder(paintInfo, paintOffset)) ; | 116 DrawingRecorder recorder(paintInfo.context, displayItemClient, DisplayItem:: BoxDecorationBackground, FloatRect(boundsForDrawingRecorder(paintInfo, paintOffs et))); |
116 | |
117 BoxDecorationData boxDecorationData(m_layoutBox); | 117 BoxDecorationData boxDecorationData(m_layoutBox); |
118 GraphicsContextStateSaver stateSaver(paintInfo.context, false); | 118 GraphicsContextStateSaver stateSaver(paintInfo.context, false); |
119 | 119 |
120 if (!paintingOverflowContents) { | 120 if (!paintingOverflowContents) { |
121 // FIXME: Should eventually give the theme control over whether the box shadow should paint, since controls could have | 121 // FIXME: Should eventually give the theme control over whether the box shadow should paint, since controls could have |
122 // custom shadows of their own. | 122 // custom shadows of their own. |
123 if (!m_layoutBox.boxShadowShouldBeAppliedToBackground(boxDecorationData. bleedAvoidance)) { | 123 if (!m_layoutBox.boxShadowShouldBeAppliedToBackground(boxDecorationData. bleedAvoidance)) { |
124 paintBoxShadow(paintInfo, paintRect, style, Normal); | 124 paintBoxShadow(paintInfo, paintRect, style, Normal); |
125 } | 125 } |
126 | 126 |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
862 } | 862 } |
863 } | 863 } |
864 | 864 |
865 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document) | 865 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document) |
866 { | 866 { |
867 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus tEconomy | 867 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus tEconomy |
868 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ()); | 868 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ()); |
869 } | 869 } |
870 | 870 |
871 } // namespace blink | 871 } // namespace blink |
OLD | NEW |