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

Unified Diff: Source/core/paint/InlineTextBoxPainter.h

Issue 620243002: Move painting code from InlineTextBox to InlineTextBoxPainter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Finished. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/paint/InlineTextBoxPainter.h
diff --git a/Source/core/paint/InlineTextBoxPainter.h b/Source/core/paint/InlineTextBoxPainter.h
new file mode 100644
index 0000000000000000000000000000000000000000..a1998d06c2a45122105dddd261d68e05f0e18da4
--- /dev/null
+++ b/Source/core/paint/InlineTextBoxPainter.h
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef InlineTextBoxPainter_h
+#define InlineTextBoxPainter_h
+
+#include "core/rendering/style/RenderStyleConstants.h"
+
+namespace blink {
+
+class Color;
+struct CompositionUnderline;
+class DocumentMarker;
+class FloatPoint;
+class Font;
+class GraphicsContext;
+struct PaintInfo;
jbroman 2014/10/03 17:46:17 forward declaration sort order
chrishtr 2014/10/03 18:10:37 Done.
jbroman 2014/10/03 18:18:26 Hmm, I'd either expect this to be sorted with the
chrishtr 2014/10/03 18:37:46 Fixed.
+class LayoutPoint;
+class InlineTextBox;
+class RenderStyle;
+
+class InlineTextBoxPainter {
+public:
+ InlineTextBoxPainter(InlineTextBox& inlineTextBox) : m_inlineTextBox(inlineTextBox) { }
jbroman 2014/10/03 17:46:17 nit: Any reason this is a non-const ref? There are
chrishtr 2014/10/03 18:10:37 const-ness is not preserved on some RenderObject m
+
+ void paint(PaintInfo&, const LayoutPoint&);
+ void paintDocumentMarkers(GraphicsContext*, const FloatPoint& boxOrigin, RenderStyle*, const Font&, bool background);
+ void paintDocumentMarker(GraphicsContext*, const FloatPoint& boxOrigin, DocumentMarker*, RenderStyle*, const Font&, bool grammar);
+ void paintTextMatchMarker(GraphicsContext*, const FloatPoint& boxOrigin, DocumentMarker*, RenderStyle*, const Font&);
+
+private:
+ void paintCompositionBackgrounds(GraphicsContext*, const FloatPoint& boxOrigin, RenderStyle*, const Font&, bool useCustomUnderlines);
+ void paintSingleCompositionBackgroundRun(GraphicsContext*, const FloatPoint& boxOrigin, RenderStyle*, const Font&, Color backgroundColor, int startPos, int endPos);
+ void paintSelection(GraphicsContext*, const FloatPoint& boxOrigin, RenderStyle*, const Font&, Color textColor);
+ void paintDecoration(GraphicsContext*, const FloatPoint& boxOrigin, TextDecoration);
+ void paintCompositionUnderline(GraphicsContext*, const FloatPoint& boxOrigin, const CompositionUnderline&);
+ unsigned underlinePaintStart(const CompositionUnderline&);
+ unsigned underlinePaintEnd(const CompositionUnderline&);
+
+ InlineTextBox& m_inlineTextBox;
+};
+
+} // namespace blink
+
+#endif // InlineTextBoxPainter_h

Powered by Google App Engine
This is Rietveld 408576698