| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/BoxPainter.h" | 6 #include "core/paint/BoxPainter.h" |
| 7 | 7 |
| 8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/html/HTMLFrameOwnerElement.h" | 10 #include "core/html/HTMLFrameOwnerElement.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 bool bleedAvoidanceIsClipping(BackgroundBleedAvoidance bleedAvoidance) | 72 bool bleedAvoidanceIsClipping(BackgroundBleedAvoidance bleedAvoidance) |
| 73 { | 73 { |
| 74 return bleedAvoidance == BackgroundBleedClipOnly || bleedAvoidance == Backgr
oundBleedClipLayer; | 74 return bleedAvoidance == BackgroundBleedClipOnly || bleedAvoidance == Backgr
oundBleedClipLayer; |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // anonymous namespace | 77 } // anonymous namespace |
| 78 | 78 |
| 79 void BoxPainter::paintBoxDecorationBackgroundWithRect(const PaintInfo& paintInfo
, const LayoutPoint& paintOffset, const LayoutRect& paintRect) | 79 void BoxPainter::paintBoxDecorationBackgroundWithRect(const PaintInfo& paintInfo
, const LayoutPoint& paintOffset, const LayoutRect& paintRect) |
| 80 { | 80 { |
| 81 const ComputedStyle& style = m_layoutBox.styleRef(); |
| 82 |
| 83 // FIXME: For now we don't have notification on media buffered range change
from media player |
| 84 // and miss paint invalidation on buffered range change. crbug.com/484288. |
| 85 Optional<DisplayItemCacheSkipper> cacheSkipper; |
| 86 if (style.appearance() == MediaSliderPart) |
| 87 cacheSkipper.emplace(*paintInfo.context); |
| 88 |
| 81 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBox, Displa
yItem::BoxDecorationBackground, boundsForDrawingRecorder(paintOffset)); | 89 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBox, Displa
yItem::BoxDecorationBackground, boundsForDrawingRecorder(paintOffset)); |
| 82 if (recorder.canUseCachedDrawing()) | 90 if (recorder.canUseCachedDrawing()) |
| 83 return; | 91 return; |
| 84 | 92 |
| 85 const ComputedStyle& style = m_layoutBox.styleRef(); | |
| 86 BoxDecorationData boxDecorationData(m_layoutBox); | 93 BoxDecorationData boxDecorationData(m_layoutBox); |
| 87 | 94 |
| 88 #if ENABLE(ASSERT) | |
| 89 // FIXME: For now we don't have notification on media buffered range change
from media player | |
| 90 // and miss paint invalidation on buffered range change. crbug.com/484288. | |
| 91 if (style.appearance() == MediaSliderPart) | |
| 92 recorder.setUnderInvalidationCheckingMode(DrawingDisplayItem::DontCheck)
; | |
| 93 #endif | |
| 94 | |
| 95 // FIXME: Should eventually give the theme control over whether the box shad
ow should paint, since controls could have | 95 // FIXME: Should eventually give the theme control over whether the box shad
ow should paint, since controls could have |
| 96 // custom shadows of their own. | 96 // custom shadows of their own. |
| 97 if (!m_layoutBox.boxShadowShouldBeAppliedToBackground(boxDecorationData.blee
dAvoidance)) | 97 if (!m_layoutBox.boxShadowShouldBeAppliedToBackground(boxDecorationData.blee
dAvoidance)) |
| 98 paintBoxShadow(paintInfo, paintRect, style, Normal); | 98 paintBoxShadow(paintInfo, paintRect, style, Normal); |
| 99 | 99 |
| 100 GraphicsContextStateSaver stateSaver(*paintInfo.context, false); | 100 GraphicsContextStateSaver stateSaver(*paintInfo.context, false); |
| 101 if (bleedAvoidanceIsClipping(boxDecorationData.bleedAvoidance)) { | 101 if (bleedAvoidanceIsClipping(boxDecorationData.bleedAvoidance)) { |
| 102 | 102 |
| 103 stateSaver.save(); | 103 stateSaver.save(); |
| 104 FloatRoundedRect border = style.getRoundedBorderFor(paintRect); | 104 FloatRoundedRect border = style.getRoundedBorderFor(paintRect); |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 else | 1042 else |
| 1043 clippedEdges |= GraphicsContext::BottomEdge; | 1043 clippedEdges |= GraphicsContext::BottomEdge; |
| 1044 } | 1044 } |
| 1045 // TODO: support non-integer shadows - crbug.com/334828 | 1045 // TODO: support non-integer shadows - crbug.com/334828 |
| 1046 context->drawInnerShadow(border, shadowColor, flooredIntSize(shadowO
ffset), shadowBlur, shadowSpread, clippedEdges); | 1046 context->drawInnerShadow(border, shadowColor, flooredIntSize(shadowO
ffset), shadowBlur, shadowSpread, clippedEdges); |
| 1047 } | 1047 } |
| 1048 } | 1048 } |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 } // namespace blink | 1051 } // namespace blink |
| OLD | NEW |