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 #ifndef InlinePainter_h | 5 #ifndef InlinePainter_h |
6 #define InlinePainter_h | 6 #define InlinePainter_h |
7 | 7 |
8 #include "core/style/ComputedStyleConstants.h" | 8 #include "core/style/ComputedStyleConstants.h" |
| 9 #include "wtf/Allocator.h" |
9 #include "wtf/Vector.h" | 10 #include "wtf/Vector.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 class Color; | 14 class Color; |
14 class GraphicsContext; | 15 class GraphicsContext; |
15 class LayoutPoint; | 16 class LayoutPoint; |
16 class LayoutRect; | 17 class LayoutRect; |
17 struct PaintInfo; | 18 struct PaintInfo; |
18 class LayoutInline; | 19 class LayoutInline; |
19 | 20 |
20 class InlinePainter { | 21 class InlinePainter { |
| 22 STACK_ALLOCATED(); |
21 public: | 23 public: |
22 InlinePainter(LayoutInline& layoutInline) : m_layoutInline(layoutInline) { } | 24 InlinePainter(LayoutInline& layoutInline) : m_layoutInline(layoutInline) { } |
23 | 25 |
24 void paint(const PaintInfo&, const LayoutPoint& paintOffset); | 26 void paint(const PaintInfo&, const LayoutPoint& paintOffset); |
25 void paintOutline(const PaintInfo&, const LayoutPoint& paintOffset); | 27 void paintOutline(const PaintInfo&, const LayoutPoint& paintOffset); |
26 | 28 |
27 private: | 29 private: |
28 LayoutRect outlinePaintRect(const Vector<LayoutRect>&, const LayoutPoint& pa
intOffset) const; | 30 LayoutRect outlinePaintRect(const Vector<LayoutRect>&, const LayoutPoint& pa
intOffset) const; |
29 void paintOutlineForLine(GraphicsContext*, const LayoutPoint&, const LayoutR
ect& prevLine, const LayoutRect& thisLine, | 31 void paintOutlineForLine(GraphicsContext*, const LayoutPoint&, const LayoutR
ect& prevLine, const LayoutRect& thisLine, |
30 const LayoutRect& nextLine, const Color); | 32 const LayoutRect& nextLine, const Color); |
31 LayoutInline& m_layoutInline; | 33 LayoutInline& m_layoutInline; |
32 }; | 34 }; |
33 | 35 |
34 } // namespace blink | 36 } // namespace blink |
35 | 37 |
36 #endif // InlinePainter_h | 38 #endif // InlinePainter_h |
OLD | NEW |