| 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 paintChildren(const PaintInfo&, const LayoutPoint&); | 28 void paintChildren(const PaintInfo&, const LayoutPoint&); |
| 29 void paintChild(const LayoutBox&, const PaintInfo&, const LayoutPoint&); | 29 void paintChild(const LayoutBox&, const PaintInfo&, const LayoutPoint&); |
| 30 void paintChildAsInlineBlock(const LayoutBox&, const PaintInfo&, const Layou
tPoint&); |
| 30 void paintOverflowControlsIfNeeded(const PaintInfo&, const LayoutPoint&); | 31 void paintOverflowControlsIfNeeded(const PaintInfo&, const LayoutPoint&); |
| 31 | 32 |
| 32 // See ObjectPainter::paintAsPseudoStackingContext for explanation of "pseud
o stacking context". | 33 // inline-block elements paint all phases atomically. This function ensures
that. Certain other elements |
| 33 void paintChildAsPseudoStackingContext(const LayoutBox&, const PaintInfo&, c
onst LayoutPoint&); | 34 // (grid items, flex items) require this behavior as well, and this function
exists as a helper for them. |
| 35 // It is expected that the caller will call this function independent of the
value of paintInfo.phase. |
| 36 static void paintAsInlineBlock(const LayoutObject&, const PaintInfo&, const
LayoutPoint&); |
| 34 static void paintChildrenOfFlexibleBox(const LayoutFlexibleBox&, const Paint
Info&, const LayoutPoint& paintOffset); | 37 static void paintChildrenOfFlexibleBox(const LayoutFlexibleBox&, const Paint
Info&, const LayoutPoint& paintOffset); |
| 35 static void paintInlineBox(const InlineBox&, const PaintInfo&, const LayoutP
oint& paintOffset); | 38 static void paintInlineBox(const InlineBox&, const PaintInfo&, const LayoutP
oint& paintOffset); |
| 36 | 39 |
| 37 bool intersectsPaintRect(const PaintInfo&, const LayoutPoint& paintOffset) c
onst; | 40 bool intersectsPaintRect(const PaintInfo&, const LayoutPoint& paintOffset) c
onst; |
| 38 | 41 |
| 39 private: | 42 private: |
| 40 void paintCarets(const PaintInfo&, const LayoutPoint&); | 43 void paintCarets(const PaintInfo&, const LayoutPoint&); |
| 41 void paintContents(const PaintInfo&, const LayoutPoint&); | 44 void paintContents(const PaintInfo&, const LayoutPoint&); |
| 42 | 45 |
| 43 const LayoutBlock& m_layoutBlock; | 46 const LayoutBlock& m_layoutBlock; |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 } // namespace blink | 49 } // namespace blink |
| 47 | 50 |
| 48 #endif // BlockPainter_h | 51 #endif // BlockPainter_h |
| OLD | NEW |