Chromium Code Reviews| 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 paintChildAsStackingContext(const LayoutBox&, const PaintInfo&, const L ayoutPoint&); |
|
chrishtr
2016/01/07 01:51:26
It's not really a stacking context for positioned
Xianzhu
2016/01/07 17:02:40
Done.
Added more complete comments to ObjectPaint
| |
| 31 void paintOverflowControlsIfNeeded(const PaintInfo&, const LayoutPoint&); | 31 void paintOverflowControlsIfNeeded(const PaintInfo&, const LayoutPoint&); |
| 32 | 32 |
| 33 // inline-block elements paint all phases atomically. This function ensures that. Certain other elements | |
| 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&); | |
| 37 static void paintChildrenOfFlexibleBox(const LayoutFlexibleBox&, const Paint Info&, const LayoutPoint& paintOffset); | 33 static void paintChildrenOfFlexibleBox(const LayoutFlexibleBox&, const Paint Info&, const LayoutPoint& paintOffset); |
| 38 static void paintInlineBox(const InlineBox&, const PaintInfo&, const LayoutP oint& paintOffset); | 34 static void paintInlineBox(const InlineBox&, const PaintInfo&, const LayoutP oint& paintOffset); |
| 39 | 35 |
| 40 bool intersectsPaintRect(const PaintInfo&, const LayoutPoint& paintOffset) c onst; | 36 bool intersectsPaintRect(const PaintInfo&, const LayoutPoint& paintOffset) c onst; |
| 41 | 37 |
| 42 private: | 38 private: |
| 43 void paintCarets(const PaintInfo&, const LayoutPoint&); | 39 void paintCarets(const PaintInfo&, const LayoutPoint&); |
| 44 void paintContents(const PaintInfo&, const LayoutPoint&); | 40 void paintContents(const PaintInfo&, const LayoutPoint&); |
| 45 | 41 |
| 46 const LayoutBlock& m_layoutBlock; | 42 const LayoutBlock& m_layoutBlock; |
| 47 }; | 43 }; |
| 48 | 44 |
| 49 } // namespace blink | 45 } // namespace blink |
| 50 | 46 |
| 51 #endif // BlockPainter_h | 47 #endif // BlockPainter_h |
| OLD | NEW |