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

Unified Diff: third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h

Issue 2871733003: [LayoutNG] Refactor NGLineBreaker for ShapingLineBreaker (Closed)
Patch Set: Cleanup 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/layout/ng/inline/ng_inline_item_result.h
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h
new file mode 100644
index 0000000000000000000000000000000000000000..cf8ea096beb9223a0ad6875f84d7c923649928d5
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h
@@ -0,0 +1,50 @@
+// 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 NGInlineItemResult_h
+#define NGInlineItemResult_h
+
+#include "core/layout/ng/ng_layout_result.h"
+#include "platform/LayoutUnit.h"
+#include "platform/fonts/shaping/ShapeResult.h"
+#include "platform/wtf/Allocator.h"
+
+namespace blink {
+
+// The result of measuring NGInlineItem.
+//
+// This is a transient context object only while building line boxes.
+// Produced while determining the line break points, but these data are needed
+// to create line boxes.
+//
+// NGLineBreaker produces, and NGInlineLayoutAlgorithm consumes.
+struct CORE_EXPORT NGInlineItemResult {
+ DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
+
+ public:
+ // The index of NGInlineItem and its text range.
+ unsigned item_index;
+ unsigned start_offset;
+ unsigned end_offset;
+
+ // Inline size of this item.
+ LayoutUnit inline_size;
+
+ // ShapeResult for text items. Maybe different from NGInlineItem if re-shape
+ // is needed in the line breaker.
+ RefPtr<ShapeResult> shape_result;
+
+ // NGLayoutResult for atomic inline items.
+ RefPtr<NGLayoutResult> layout_result;
+
+ NGInlineItemResult();
+ NGInlineItemResult(unsigned index, unsigned start, unsigned end);
+};
+
+// Represents a set of NGInlineItemResult that form a line box.
+using NGInlineItemResults = Vector<NGInlineItemResult, 32>;
+
+} // namespace blink
+
+#endif // NGInlineItemResult_h

Powered by Google App Engine
This is Rietveld 408576698