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

Unified Diff: third_party/WebKit/Source/core/paint/NGTextPainter.h

Issue 2842983002: [LayoutNG] Paint inlines from the fragment tree
Patch Set: Rebase w/HEAD Created 3 years, 7 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: third_party/WebKit/Source/core/paint/NGTextPainter.h
diff --git a/third_party/WebKit/Source/core/paint/NGTextPainter.h b/third_party/WebKit/Source/core/paint/NGTextPainter.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c621687fb0346352728fbc1271ce12bec70970b
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/NGTextPainter.h
@@ -0,0 +1,67 @@
+// Copyright 2017 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 NGTextPainter_h
+#define NGTextPainter_h
+
+#include "core/CoreExport.h"
+#include "core/paint/TextPainterBase.h"
+
+namespace blink {
+
+class NGPhysicalTextFragment;
+struct TextFragmentPaintInfo;
+
+// Text painter for LayoutNG. Operates on NGPhysicalTextFragments.
+class CORE_EXPORT NGTextPainter : public TextPainterBase {
+ STACK_ALLOCATED();
+
+ public:
+ NGTextPainter(GraphicsContext& context,
+ const Font& font,
+ const NGPhysicalTextFragment* text_fragment,
+ const LayoutPoint& text_origin,
+ const LayoutRect& text_bounds,
+ bool horizontal)
+ : TextPainterBase(context, font, text_origin, text_bounds, horizontal),
+ text_fragment_(text_fragment) {}
+ ~NGTextPainter() {}
+
+ // void SetCombinedText(LayoutTextCombine* combined_text) {
+ // combined_text_ = combined_text;
+ //}
+
+ void ClipDecorationsStripe(float upper, float stripe_width, float dilation);
+ void Paint(unsigned start_offset,
+ unsigned end_offset,
+ unsigned length,
+ const Style&);
+
+ static Style TextPaintingStyle(const NGPhysicalTextFragment*,
+ const ComputedStyle&,
+ const PaintInfo&);
+ static Style SelectionPaintingStyle(const NGPhysicalTextFragment*,
+ bool have_selection,
+ const PaintInfo&,
+ const Style& text_style);
+
+ private:
+ template <PaintInternalStep step>
+ void PaintInternalFragment(TextFragmentPaintInfo&,
+ unsigned from,
+ unsigned to);
+
+ template <PaintInternalStep step>
+ void PaintInternal(unsigned start_offset,
+ unsigned end_offset,
+ unsigned truncation_point);
+
+ void PaintEmphasisMarkForCombinedText();
+
+ const NGPhysicalTextFragment* text_fragment_;
+};
+
+} // namespace blink
+
+#endif // TextPainter_h
« no previous file with comments | « third_party/WebKit/Source/core/paint/NGTextFragmentPainter.cpp ('k') | third_party/WebKit/Source/core/paint/NGTextPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698