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/paint/DrawingRecorder.h" | 8 #include "core/paint/DrawingRecorder.h" |
9 #include "core/rendering/PaintInfo.h" | 9 #include "core/rendering/PaintInfo.h" |
10 #include "core/rendering/RenderObject.h" | 10 #include "core/rendering/RenderObject.h" |
11 #include "core/rendering/RenderTheme.h" | 11 #include "core/rendering/RenderTheme.h" |
12 #include "core/rendering/style/RenderStyle.h" | 12 #include "core/rendering/style/RenderStyle.h" |
13 #include "platform/geometry/LayoutPoint.h" | 13 #include "platform/geometry/LayoutPoint.h" |
14 #include "platform/graphics/GraphicsContextStateSaver.h" | 14 #include "platform/graphics/GraphicsContextStateSaver.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 void ObjectPainter::paintFocusRing(PaintInfo& paintInfo, const LayoutPoint& pain
tOffset, RenderStyle* style) | 18 void ObjectPainter::paintFocusRing(PaintInfo& paintInfo, const LayoutPoint& pain
tOffset, RenderStyle* style) |
19 { | 19 { |
20 Vector<LayoutRect> focusRingRects; | 20 Vector<LayoutRect> focusRingRects; |
21 m_renderObject.addFocusRingRects(focusRingRects, paintOffset, paintInfo.pain
tContainer()); | 21 m_renderObject.addFocusRingRects(focusRingRects, paintOffset); |
22 ASSERT(style->outlineStyleIsAuto()); | 22 ASSERT(style->outlineStyleIsAuto()); |
23 Vector<IntRect> focusRingIntRects; | 23 Vector<IntRect> focusRingIntRects; |
24 for (size_t i = 0; i < focusRingRects.size(); ++i) | 24 for (size_t i = 0; i < focusRingRects.size(); ++i) |
25 focusRingIntRects.append(pixelSnappedIntRect(focusRingRects[i])); | 25 focusRingIntRects.append(pixelSnappedIntRect(focusRingRects[i])); |
26 paintInfo.context->drawFocusRing(focusRingIntRects, style->outlineWidth(), s
tyle->outlineOffset(), m_renderObject.resolveColor(style, CSSPropertyOutlineColo
r)); | 26 paintInfo.context->drawFocusRing(focusRingIntRects, style->outlineWidth(), s
tyle->outlineOffset(), m_renderObject.resolveColor(style, CSSPropertyOutlineColo
r)); |
27 } | 27 } |
28 | 28 |
29 void ObjectPainter::paintOutline(PaintInfo& paintInfo, const LayoutRect& paintRe
ct) | 29 void ObjectPainter::paintOutline(PaintInfo& paintInfo, const LayoutRect& paintRe
ct) |
30 { | 30 { |
31 RenderStyle* styleToUse = m_renderObject.style(); | 31 RenderStyle* styleToUse = m_renderObject.style(); |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); | 339 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); |
340 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); | 340 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); |
341 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); | 341 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); |
342 break; | 342 break; |
343 } | 343 } |
344 | 344 |
345 graphicsContext->fillPolygon(4, quad, color, antialias); | 345 graphicsContext->fillPolygon(4, quad, color, antialias); |
346 } | 346 } |
347 | 347 |
348 } // namespace blink | 348 } // namespace blink |
OLD | NEW |