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/ObjectPainter.h" | 5 #include "core/paint/ObjectPainter.h" |
6 | 6 |
7 #include "core/layout/LayoutBlock.h" | 7 #include "core/layout/LayoutBlock.h" |
8 #include "core/layout/LayoutInline.h" | 8 #include "core/layout/LayoutInline.h" |
9 #include "core/layout/LayoutObject.h" | 9 #include "core/layout/LayoutObject.h" |
10 #include "core/layout/LayoutTheme.h" | 10 #include "core/layout/LayoutTheme.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return; | 204 return; |
205 | 205 |
206 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutObject, paintInfo.phase, paintOffset)) | 206 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutObject, paintInfo.phase, paintOffset)) |
207 return; | 207 return; |
208 | 208 |
209 // The result rects are in coordinates of m_layoutObject's border box. | 209 // The result rects are in coordinates of m_layoutObject's border box. |
210 // Block flipping is not applied yet if !m_layoutObject.isBox(). | 210 // Block flipping is not applied yet if !m_layoutObject.isBox(). |
211 if (!m_layoutObject.isBox() && m_layoutObject.styleRef().isFlippedBlocksWrit
ingMode()) { | 211 if (!m_layoutObject.isBox() && m_layoutObject.styleRef().isFlippedBlocksWrit
ingMode()) { |
212 LayoutBlock* container = m_layoutObject.containingBlock(); | 212 LayoutBlock* container = m_layoutObject.containingBlock(); |
213 if (container) { | 213 if (container) { |
214 m_layoutObject.localToContainerRects(outlineRects, container, -paint
Offset, paintOffset); | 214 m_layoutObject.localToAncestorRects(outlineRects, container, -paintO
ffset, paintOffset); |
215 if (outlineRects.isEmpty()) | 215 if (outlineRects.isEmpty()) |
216 return; | 216 return; |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
220 Vector<IntRect> pixelSnappedOutlineRects; | 220 Vector<IntRect> pixelSnappedOutlineRects; |
221 for (auto& r : outlineRects) | 221 for (auto& r : outlineRects) |
222 pixelSnappedOutlineRects.append(pixelSnappedIntRect(r)); | 222 pixelSnappedOutlineRects.append(pixelSnappedIntRect(r)); |
223 | 223 |
224 IntRect unitedOutlineRect = unionRectEvenIfEmpty(pixelSnappedOutlineRects); | 224 IntRect unitedOutlineRect = unionRectEvenIfEmpty(pixelSnappedOutlineRects); |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); | 528 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); |
529 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); | 529 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); |
530 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); | 530 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); |
531 break; | 531 break; |
532 } | 532 } |
533 | 533 |
534 graphicsContext.fillPolygon(4, quad, color, antialias); | 534 graphicsContext.fillPolygon(4, quad, color, antialias); |
535 } | 535 } |
536 | 536 |
537 } // namespace blink | 537 } // namespace blink |
OLD | NEW |