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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/GlyphBuffer.h

Issue 2598393002: Do not skip ink for ideographic scripts (Closed)
Patch Set: drott nits Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2007-2008 Torch Mobile Inc. 3 * Copyright (C) 2007-2008 Torch Mobile Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // yield correctly positioned RTL glyphs without any post-shape 134 // yield correctly positioned RTL glyphs without any post-shape
135 // munging). 135 // munging).
136 SECURITY_DCHECK(!m_offsets.isEmpty()); 136 SECURITY_DCHECK(!m_offsets.isEmpty());
137 for (unsigned i = 0; i + 1 < m_offsets.size(); ++i) 137 for (unsigned i = 0; i + 1 < m_offsets.size(); ++i)
138 m_offsets[i] = totalWidth - m_offsets[i + 1]; 138 m_offsets[i] = totalWidth - m_offsets[i + 1];
139 m_offsets.back() = totalWidth - afterOffset; 139 m_offsets.back() = totalWidth - afterOffset;
140 140
141 m_offsets.reverse(); 141 m_offsets.reverse();
142 } 142 }
143 143
144 void saveSkipInkExceptions() {
145 m_skipInkExceptions = WTF::makeUnique<Vector<bool, 2048>>();
146 }
147
148 bool hasSkipInkExceptions() const { return !!m_skipInkExceptions; }
149
150 bool isSkipInkException(unsigned index) const {
151 if (!m_skipInkExceptions)
152 return false;
153 DCHECK_EQ(m_skipInkExceptions->size(), m_offsets.size());
154 return (*m_skipInkExceptions)[index];
155 }
156
157 void addIsSkipInkException(bool value) {
158 DCHECK(hasSkipInkExceptions());
159 DCHECK_EQ(m_skipInkExceptions->size(), m_offsets.size() - 1);
160 m_skipInkExceptions->append(value);
161 }
162
144 protected: 163 protected:
145 Vector<const SimpleFontData*, 2048> m_fontData; 164 Vector<const SimpleFontData*, 2048> m_fontData;
146 Vector<Glyph, 2048> m_glyphs; 165 Vector<Glyph, 2048> m_glyphs;
147 166
148 // Glyph positioning: either x-only offsets, or interleaved x,y offsets 167 // Glyph positioning: either x-only offsets, or interleaved x,y offsets
149 // (depending on the buffer-wide positioning mode). This matches the 168 // (depending on the buffer-wide positioning mode). This matches the
150 // glyph positioning format used by Skia. 169 // glyph positioning format used by Skia.
151 Vector<float, 2048> m_offsets; 170 Vector<float, 2048> m_offsets;
171
172 // Flag vector of identical size to m_offset, true when glyph is to be
173 // exempted from ink skipping, false otherwise.
174 std::unique_ptr<Vector<bool, 2048>> m_skipInkExceptions;
152 }; 175 };
153 176
154 } // namespace blink 177 } // namespace blink
155 178
156 #endif 179 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698