| 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/ObjectPainter.h" | 6 #include "core/paint/ObjectPainter.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutObject.h" | 8 #include "core/layout/LayoutObject.h" |
| 9 #include "core/layout/LayoutTheme.h" | 9 #include "core/layout/LayoutTheme.h" |
| 10 #include "core/layout/PaintInfo.h" | 10 #include "core/layout/PaintInfo.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 return; | 44 return; |
| 45 } | 45 } |
| 46 | 46 |
| 47 if (styleToUse.outlineStyle() == BNONE) | 47 if (styleToUse.outlineStyle() == BNONE) |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 IntRect inner = pixelSnappedIntRect(paintRect); | 50 IntRect inner = pixelSnappedIntRect(paintRect); |
| 51 inner.inflate(styleToUse.outlineOffset()); | 51 inner.inflate(styleToUse.outlineOffset()); |
| 52 | 52 |
| 53 IntRect outer = pixelSnappedIntRect(inner); | 53 IntRect outer = inner; |
| 54 LayoutUnit outlineWidth = styleToUse.outlineWidth(); | 54 LayoutUnit outlineWidth = styleToUse.outlineWidth(); |
| 55 outer.inflate(outlineWidth); | 55 outer.inflate(outlineWidth); |
| 56 | 56 |
| 57 // FIXME: This prevents outlines from painting inside the object. See bug 12
042 | 57 // FIXME: This prevents outlines from painting inside the object. See bug 12
042 |
| 58 if (outer.isEmpty()) | 58 if (outer.isEmpty()) |
| 59 return; | 59 return; |
| 60 | 60 |
| 61 EBorderStyle outlineStyle = styleToUse.outlineStyle(); | 61 EBorderStyle outlineStyle = styleToUse.outlineStyle(); |
| 62 Color outlineColor = m_layoutObject.resolveColor(styleToUse, CSSPropertyOutl
ineColor); | 62 Color outlineColor = m_layoutObject.resolveColor(styleToUse, CSSPropertyOutl
ineColor); |
| 63 | 63 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); | 341 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); |
| 342 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); | 342 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); |
| 343 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); | 343 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); |
| 344 break; | 344 break; |
| 345 } | 345 } |
| 346 | 346 |
| 347 graphicsContext->fillPolygon(4, quad, color, antialias); | 347 graphicsContext->fillPolygon(4, quad, color, antialias); |
| 348 } | 348 } |
| 349 | 349 |
| 350 } // namespace blink | 350 } // namespace blink |
| OLD | NEW |