Chromium Code Reviews| 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/ReplacedPainter.h" | 5 #include "core/paint/ReplacedPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutReplaced.h" | 7 #include "core/layout/LayoutReplaced.h" |
| 8 #include "core/layout/api/SelectionState.h" | 8 #include "core/layout/api/SelectionState.h" |
| 9 #include "core/layout/svg/LayoutSVGRoot.h" | 9 #include "core/layout/svg/LayoutSVGRoot.h" |
| 10 #include "core/paint/BoxPainter.h" | 10 #include "core/paint/BoxPainter.h" |
| 11 #include "core/paint/LayoutObjectDrawingRecorder.h" | 11 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 12 #include "core/paint/ObjectPainter.h" | 12 #include "core/paint/ObjectPainter.h" |
| 13 #include "core/paint/PaintInfo.h" | 13 #include "core/paint/PaintInfo.h" |
| 14 #include "core/paint/PaintLayer.h" | 14 #include "core/paint/PaintLayer.h" |
| 15 #include "core/paint/RoundedInnerRectClipper.h" | 15 #include "core/paint/RoundedInnerRectClipper.h" |
| 16 #include "wtf/Optional.h" | 16 #include "wtf/Optional.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 static bool shouldApplyViewportClip(const LayoutReplaced& layoutReplaced) | 20 static bool shouldApplyViewportClip(const LayoutReplaced& layoutReplaced) |
| 21 { | 21 { |
| 22 return !layoutReplaced.isSVGRoot() || toLayoutSVGRoot(&layoutReplaced)->shou ldApplyViewportClip(); | 22 return !layoutReplaced.isSVGRoot() || toLayoutSVGRoot(&layoutReplaced)->shou ldApplyViewportClip(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint Offset) | 25 void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint Offset) |
| 26 { | 26 { |
| 27 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutReplaced.location(); | 27 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutReplaced.location(); |
| 28 if (!shouldPaint(paintInfo, adjustedPaintOffset)) | 28 if (!shouldPaint(paintInfo, adjustedPaintOffset)) { |
| 29 if (m_layoutReplaced.isSVGRoot() && m_layoutReplaced.style()->visibility () != VISIBLE) | |
|
fs
2016/03/21 16:07:58
I _think_ that clipping from 'overflow' should sti
hyunjunekim2
2016/03/23 14:19:33
Could you checkPS13? Added more tests.
Thank you.
| |
| 30 m_layoutReplaced.paintReplaced(paintInfo, adjustedPaintOffset); | |
| 29 return; | 31 return; |
| 32 } | |
| 30 | 33 |
| 31 LayoutRect borderRect(adjustedPaintOffset, m_layoutReplaced.size()); | 34 LayoutRect borderRect(adjustedPaintOffset, m_layoutReplaced.size()); |
| 32 | 35 |
| 33 if (m_layoutReplaced.hasBoxDecorationBackground() && (paintInfo.phase == Pai ntPhaseForeground || paintInfo.phase == PaintPhaseSelection)) | 36 if (m_layoutReplaced.hasBoxDecorationBackground() && (paintInfo.phase == Pai ntPhaseForeground || paintInfo.phase == PaintPhaseSelection)) |
| 34 m_layoutReplaced.paintBoxDecorationBackground(paintInfo, adjustedPaintOf fset); | 37 m_layoutReplaced.paintBoxDecorationBackground(paintInfo, adjustedPaintOf fset); |
| 35 | 38 |
| 36 if (paintInfo.phase == PaintPhaseMask) { | 39 if (paintInfo.phase == PaintPhaseMask) { |
| 37 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset); | 40 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset); |
| 38 return; | 41 return; |
| 39 } | 42 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 paintRect.unite(m_layoutReplaced.localSelectionRect()); | 112 paintRect.unite(m_layoutReplaced.localSelectionRect()); |
| 110 paintRect.moveBy(adjustedPaintOffset); | 113 paintRect.moveBy(adjustedPaintOffset); |
| 111 | 114 |
| 112 if (!paintInfo.cullRect().intersectsCullRect(paintRect)) | 115 if (!paintInfo.cullRect().intersectsCullRect(paintRect)) |
| 113 return false; | 116 return false; |
| 114 | 117 |
| 115 return true; | 118 return true; |
| 116 } | 119 } |
| 117 | 120 |
| 118 } // namespace blink | 121 } // namespace blink |
| OLD | NEW |