Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: Source/core/paint/BlockPainter.h

Issue 1218013003: Keep a cache of caret painters to avoid recomputing all the time. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: a shade of deduplication blue Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 namespace blink { 8 namespace blink {
9 9
10 struct PaintInfo; 10 struct PaintInfo;
11 class InlineBox; 11 class InlineBox;
12 class LayoutBlock; 12 class LayoutBlock;
13 class LayoutBox; 13 class LayoutBox;
14 class LayoutFlexibleBox; 14 class LayoutFlexibleBox;
15 class LayoutObject; 15 class LayoutObject;
16 class LayoutPoint; 16 class LayoutPoint;
17 class LayoutRect; 17 class LayoutRect;
18 class LocalFrame;
19 class PaintDataCache;
18 20
19 class BlockPainter { 21 class BlockPainter {
20 public: 22 public:
21 BlockPainter(LayoutBlock& block) : m_layoutBlock(block) { } 23 BlockPainter(LayoutBlock& block) : m_layoutBlock(block) { }
22 24
23 void paint(const PaintInfo&, const LayoutPoint& paintOffset); 25 void paint(const PaintInfo&, const LayoutPoint& paintOffset);
24 void paintObject(const PaintInfo&, const LayoutPoint&); 26 void paintObject(const PaintInfo&, const LayoutPoint&);
25 void paintChildren(const PaintInfo&, const LayoutPoint&); 27 void paintChildren(const PaintInfo&, const LayoutPoint&);
26 void paintChild(LayoutBox&, const PaintInfo&, const LayoutPoint&); 28 void paintChild(LayoutBox&, const PaintInfo&, const LayoutPoint&);
27 void paintChildAsInlineBlock(LayoutBox&, const PaintInfo&, const LayoutPoint &); 29 void paintChildAsInlineBlock(LayoutBox&, const PaintInfo&, const LayoutPoint &);
28 void paintOverflowControlsIfNeeded(const PaintInfo&, const LayoutPoint&); 30 void paintOverflowControlsIfNeeded(const PaintInfo&, const LayoutPoint&);
29 31
30 // inline-block elements paint all phases atomically. This function ensures that. Certain other elements 32 // inline-block elements paint all phases atomically. This function ensures that. Certain other elements
31 // (grid items, flex items) require this behavior as well, and this function exists as a helper for them. 33 // (grid items, flex items) require this behavior as well, and this function exists as a helper for them.
32 // It is expected that the caller will call this function independent of the value of paintInfo.phase. 34 // It is expected that the caller will call this function independent of the value of paintInfo.phase.
33 static void paintAsInlineBlock(LayoutObject&, const PaintInfo&, const Layout Point&); 35 static void paintAsInlineBlock(LayoutObject&, const PaintInfo&, const Layout Point&);
34 static void paintChildrenOfFlexibleBox(LayoutFlexibleBox&, const PaintInfo&, const LayoutPoint& paintOffset); 36 static void paintChildrenOfFlexibleBox(LayoutFlexibleBox&, const PaintInfo&, const LayoutPoint& paintOffset);
35 static void paintInlineBox(InlineBox&, const PaintInfo&, const LayoutPoint& paintOffset); 37 static void paintInlineBox(InlineBox&, const PaintInfo&, const LayoutPoint& paintOffset);
36 38
37 private: 39 private:
38 LayoutRect overflowRectForPaintRejection() const; 40 LayoutRect overflowRectForPaintRejection() const;
39 bool hasCaret() const; 41 bool hasCaret(PaintDataCache* = nullptr) const;
40 void paintCarets(const PaintInfo&, const LayoutPoint&); 42 void paintCarets(const PaintInfo&, const LayoutPoint&);
41 void paintContents(const PaintInfo&, const LayoutPoint&); 43 void paintContents(const PaintInfo&, const LayoutPoint&);
42 void paintSelection(const PaintInfo&, const LayoutPoint&); 44 void paintSelection(const PaintInfo&, const LayoutPoint&);
43 void paintContinuationOutlines(const PaintInfo&, const LayoutPoint&); 45 void paintContinuationOutlines(const PaintInfo&, const LayoutPoint&);
44 46
45 LayoutBlock& m_layoutBlock; 47 LayoutBlock& m_layoutBlock;
46 }; 48 };
47 49
48 } // namespace blink 50 } // namespace blink
49 51
50 #endif // BlockPainter_h 52 #endif // BlockPainter_h
OLDNEW
« no previous file with comments | « Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp ('k') | Source/core/paint/BlockPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698