blob: 1d4b90febf645db40e95956f820671ded645b918 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
From dcb55fb8f18abe5f43d260aa67b14b2dc996f992 Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jose.dapena@lge.com>
Date: Tue, 11 Jun 2019 08:00:13 +0000
Subject: [PATCH] GCC: move explicit specialization out of RunInfo
Explicit specialization in non-namespace scope is not allowed in C++, and GCC breaks
build because of that. Move the template specializations out of RunInfo declaration
in shape_result_inline_headeres.h to fix the GCC build issue.
Bug: 819294
Change-Id: Id083852bcf8e9efbdc911fdad28fd8767d2905d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1651728
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
Cr-Commit-Position: refs/heads/master@{#667901}
---
diff --git a/third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h b/third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h
index 76ee6091..c14d3a0 100644
--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h
+++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h
@@ -251,37 +251,6 @@
template <bool has_non_zero_glyph_offsets>
struct iterator final {};
- // For non-zero glyph offset array
- template <>
- struct iterator<true> final {
- // The constructor for ShapeResult
- explicit iterator(const GlyphOffsetArray& array)
- : pointer(array.storage_.get()) {
- DCHECK(pointer);
- }
-
- // The constructor for ShapeResultView
- explicit iterator(const GlyphDataRange& range) : pointer(range.offsets) {
- DCHECK(pointer);
- }
-
- GlyphOffset operator*() const { return *pointer; }
- void operator++() { ++pointer; }
-
- const GlyphOffset* pointer;
- };
-
- // For zero glyph offset array
- template <>
- struct iterator<false> final {
- explicit iterator(const GlyphOffsetArray& array) {
- DCHECK(!array.HasStorage());
- }
- explicit iterator(const GlyphDataRange& range) { DCHECK(!range.offsets); }
- GlyphOffset operator*() const { return GlyphOffset(); }
- void operator++() {}
- };
-
template <bool has_non_zero_glyph_offsets>
iterator<has_non_zero_glyph_offsets> GetIterator() const {
return iterator<has_non_zero_glyph_offsets>(*this);
@@ -495,6 +464,37 @@
float width_;
};
+// For non-zero glyph offset array
+template <>
+struct ShapeResult::RunInfo::GlyphOffsetArray::iterator<true> final {
+ // The constructor for ShapeResult
+ explicit iterator(const GlyphOffsetArray& array)
+ : pointer(array.storage_.get()) {
+ DCHECK(pointer);
+ }
+
+ // The constructor for ShapeResultView
+ explicit iterator(const GlyphDataRange& range) : pointer(range.offsets) {
+ DCHECK(pointer);
+ }
+
+ GlyphOffset operator*() const { return *pointer; }
+ void operator++() { ++pointer; }
+
+ const GlyphOffset* pointer;
+};
+
+// For zero glyph offset array
+template <>
+struct ShapeResult::RunInfo::GlyphOffsetArray::iterator<false> final {
+ explicit iterator(const GlyphOffsetArray& array) {
+ DCHECK(!array.HasStorage());
+ }
+ explicit iterator(const GlyphDataRange& range) { DCHECK(!range.offsets); }
+ GlyphOffset operator*() const { return GlyphOffset(); }
+ void operator++() {}
+};
+
// Find the range of HarfBuzzRunGlyphData for the specified character index
// range. This function uses binary search twice, hence O(2 log n).
inline ShapeResult::RunInfo::GlyphDataRange
|