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

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

Issue 2458003002: Remove ASSERT_WITH_SECURITY_IMPLICATION. (Closed)
Patch Set: Minor formatting fix Created 4 years, 1 month 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // 126 //
127 // The input buffer is shaped using RTL advances, but since the right edge 127 // The input buffer is shaped using RTL advances, but since the right edge
128 // is unknown at that time, offsets are computed as if the advances were 128 // is unknown at that time, offsets are computed as if the advances were
129 // LTR. This method performs the required adjustments by reconstructing 129 // LTR. This method performs the required adjustments by reconstructing
130 // advances and positioning offsets in an RTL progression. 130 // advances and positioning offsets in an RTL progression.
131 131
132 // FIXME: we should get rid of this (idea: store negative offsets while 132 // FIXME: we should get rid of this (idea: store negative offsets while
133 // shaping, and adjust the initial advance accordingly -> should 133 // shaping, and adjust the initial advance accordingly -> should
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 ASSERT_WITH_SECURITY_IMPLICATION(!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.last() = totalWidth - afterOffset; 139 m_offsets.last() = totalWidth - afterOffset;
140 140
141 m_offsets.reverse(); 141 m_offsets.reverse();
142 } 142 }
143 143
144 protected: 144 protected:
145 Vector<const SimpleFontData*, 2048> m_fontData; 145 Vector<const SimpleFontData*, 2048> m_fontData;
146 Vector<Glyph, 2048> m_glyphs; 146 Vector<Glyph, 2048> m_glyphs;
147 147
148 // Glyph positioning: either x-only offsets, or interleaved x,y offsets 148 // Glyph positioning: either x-only offsets, or interleaved x,y offsets
149 // (depending on the buffer-wide positioning mode). This matches the 149 // (depending on the buffer-wide positioning mode). This matches the
150 // glyph positioning format used by Skia. 150 // glyph positioning format used by Skia.
151 Vector<float, 2048> m_offsets; 151 Vector<float, 2048> m_offsets;
152 }; 152 };
153 153
154 } // namespace blink 154 } // namespace blink
155 155
156 #endif 156 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp ('k') | third_party/WebKit/Source/platform/fonts/GlyphMetricsMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698