chromium/chromium-76.0.3809.100-gcc-...

98 lines
3.4 KiB
Diff

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