Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / paint / BlockPainter.h
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
3 // found in the LICENSE file.
4
5 #ifndef BlockPainter_h
6 #define BlockPainter_h
7
8 namespace blink {
9
10 struct PaintInfo;
11 class InlineBox;
12 class LayoutPoint;
13 class LayoutRect;
14 class RenderFlexibleBox;
15 class RenderBlock;
16 class RenderBox;
17 class RenderObject;
18
19 class BlockPainter {
20 public:
21     BlockPainter(RenderBlock& block) : m_renderBlock(block) { }
22
23     void paint(PaintInfo&, const LayoutPoint& paintOffset);
24     void paintObject(PaintInfo&, const LayoutPoint&);
25     void paintChildren(PaintInfo&, const LayoutPoint&);
26     void paintChildAsInlineBlock(RenderBox*, PaintInfo&, const LayoutPoint&);
27     void paintOverflowControlsIfNeeded(PaintInfo&, const LayoutPoint&);
28
29     // inline-block elements paint all phases atomically. This function ensures that. Certain other elements
30     // (grid items, flex items) require this behavior as well, and this function exists as a helper for them.
31     // It is expected that the caller will call this function independent of the value of paintInfo.phase.
32     static void paintAsInlineBlock(RenderObject*, PaintInfo&, const LayoutPoint&);
33     static void paintChildrenOfFlexibleBox(RenderFlexibleBox&, PaintInfo&, const LayoutPoint& paintOffset);
34     static void paintInlineBox(InlineBox&, PaintInfo&, const LayoutPoint& paintOffset);
35
36 private:
37     LayoutRect overflowRectForPaintRejection() const;
38     bool hasCaret() const;
39     void paintCarets(PaintInfo&, const LayoutPoint&);
40     void paintContents(PaintInfo&, const LayoutPoint&);
41     void paintColumnContents(PaintInfo&, const LayoutPoint&, bool paintFloats = false);
42     void paintColumnRules(PaintInfo&, const LayoutPoint&);
43     void paintChild(RenderBox*, PaintInfo&, const LayoutPoint&);
44     void paintSelection(PaintInfo&, const LayoutPoint&);
45     void paintContinuationOutlines(PaintInfo&, const LayoutPoint&);
46
47     RenderBlock& m_renderBlock;
48 };
49
50 } // namespace blink
51
52 #endif // BlockPainter_h