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

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 review 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_saveSkipInkExceptions = true;
146 m_skipInkExceptions.reserveInitialCapacity(2048);
147 }
148
149 bool shouldSaveSkipInkExceptions() const { return m_saveSkipInkExceptions; }
150
151 void addIsSkipInkException(bool value) { m_skipInkExceptions.append(value); }
drott 2017/01/02 15:07:46 Can we add a DCHECK_EQ(m_offsets.size(), m_skipInk
152
153 Vector<bool>& skipInkExceptions() { return m_skipInkExceptions; }
drott 2017/01/02 15:07:46 Can we add the same debug assertion here, before r
154
144 protected: 155 protected:
145 Vector<const SimpleFontData*, 2048> m_fontData; 156 Vector<const SimpleFontData*, 2048> m_fontData;
146 Vector<Glyph, 2048> m_glyphs; 157 Vector<Glyph, 2048> m_glyphs;
147 158
148 // Glyph positioning: either x-only offsets, or interleaved x,y offsets 159 // Glyph positioning: either x-only offsets, or interleaved x,y offsets
149 // (depending on the buffer-wide positioning mode). This matches the 160 // (depending on the buffer-wide positioning mode). This matches the
150 // glyph positioning format used by Skia. 161 // glyph positioning format used by Skia.
151 Vector<float, 2048> m_offsets; 162 Vector<float, 2048> m_offsets;
163
164 Vector<bool> m_skipInkExceptions;
drott 2017/01/02 15:07:46 Could you add a comment like: // Flag vector of id
165
166 bool m_saveSkipInkExceptions = false;
152 }; 167 };
153 168
154 } // namespace blink 169 } // namespace blink
155 170
156 #endif 171 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698