| 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 BlockPainter_h | 5 #ifndef BlockPainter_h |
| 6 #define BlockPainter_h | 6 #define BlockPainter_h |
| 7 | 7 |
| 8 #include "wtf/Allocator.h" | 8 #include "wtf/Allocator.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 struct PaintInfo; | 12 struct PaintInfo; |
| 13 class InlineBox; | 13 class InlineBox; |
| 14 class LayoutBlock; | 14 class LayoutBlock; |
| 15 class LayoutBox; | 15 class LayoutBox; |
| 16 class LayoutFlexibleBox; | 16 class LayoutFlexibleBox; |
| 17 class LayoutObject; | 17 class LayoutObject; |
| 18 class LayoutPoint; | 18 class LayoutPoint; |
| 19 class LayoutRect; | 19 class LayoutRect; |
| 20 | 20 |
| 21 class BlockPainter { | 21 class BlockPainter { |
| 22 STACK_ALLOCATED(); | 22 STACK_ALLOCATED(); |
| 23 public: | 23 public: |
| 24 BlockPainter(const LayoutBlock& block) : m_layoutBlock(block) { } | 24 BlockPainter(const LayoutBlock& block) : m_layoutBlock(block) { } |
| 25 | 25 |
| 26 void paint(const PaintInfo&, const LayoutPoint& paintOffset); | 26 void paint(const PaintInfo&, const LayoutPoint& paintOffset); |
| 27 void paintObject(const PaintInfo&, const LayoutPoint&); | 27 void paintObject(const PaintInfo&, const LayoutPoint&); |
| 28 void paintContents(const PaintInfo&, const LayoutPoint&); |
| 28 void paintChildren(const PaintInfo&, const LayoutPoint&); | 29 void paintChildren(const PaintInfo&, const LayoutPoint&); |
| 29 void paintChild(const LayoutBox&, const PaintInfo&, const LayoutPoint&); | 30 void paintChild(const LayoutBox&, const PaintInfo&, const LayoutPoint&); |
| 30 void paintOverflowControlsIfNeeded(const PaintInfo&, const LayoutPoint&); | 31 void paintOverflowControlsIfNeeded(const PaintInfo&, const LayoutPoint&); |
| 31 | 32 |
| 32 // See ObjectPainter::paintAllPhasesAtomically(). | 33 // See ObjectPainter::paintAllPhasesAtomically(). |
| 33 void paintAllChildPhasesAtomically(const LayoutBox&, const PaintInfo&, const
LayoutPoint&); | 34 void paintAllChildPhasesAtomically(const LayoutBox&, const PaintInfo&, const
LayoutPoint&); |
| 34 static void paintChildrenOfFlexibleBox(const LayoutFlexibleBox&, const Paint
Info&, const LayoutPoint& paintOffset); | 35 static void paintChildrenOfFlexibleBox(const LayoutFlexibleBox&, const Paint
Info&, const LayoutPoint& paintOffset); |
| 35 static void paintInlineBox(const InlineBox&, const PaintInfo&, const LayoutP
oint& paintOffset); | 36 static void paintInlineBox(const InlineBox&, const PaintInfo&, const LayoutP
oint& paintOffset); |
| 36 | 37 |
| 37 // The adjustedPaintOffset should include the location (offset) of the objec
t itself. | 38 // The adjustedPaintOffset should include the location (offset) of the objec
t itself. |
| 38 bool intersectsPaintRect(const PaintInfo&, const LayoutPoint& adjustedPaintO
ffset) const; | 39 bool intersectsPaintRect(const PaintInfo&, const LayoutPoint& adjustedPaintO
ffset) const; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 void paintCarets(const PaintInfo&, const LayoutPoint&); | 42 void paintCarets(const PaintInfo&, const LayoutPoint&); |
| 42 void paintContents(const PaintInfo&, const LayoutPoint&); | |
| 43 | 43 |
| 44 const LayoutBlock& m_layoutBlock; | 44 const LayoutBlock& m_layoutBlock; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace blink | 47 } // namespace blink |
| 48 | 48 |
| 49 #endif // BlockPainter_h | 49 #endif // BlockPainter_h |
| OLD | NEW |