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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp

Issue 2177163003: Add null-check to ShapeResult::fallbackFonts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 208 }
209 209
210 return charactersSoFar; 210 return charactersSoFar;
211 } 211 }
212 212
213 void ShapeResult::fallbackFonts(HashSet<const SimpleFontData*>* fallback) const 213 void ShapeResult::fallbackFonts(HashSet<const SimpleFontData*>* fallback) const
214 { 214 {
215 ASSERT(fallback); 215 ASSERT(fallback);
216 ASSERT(m_primaryFont); 216 ASSERT(m_primaryFont);
217 for (unsigned i = 0; i < m_runs.size(); ++i) { 217 for (unsigned i = 0; i < m_runs.size(); ++i) {
218 if (m_runs[i] && m_runs[i]->m_fontData != m_primaryFont 218 if (m_runs[i] && m_runs[i]->m_fontData
219 && m_runs[i]->m_fontData != m_primaryFont
219 && !m_runs[i]->m_fontData->isTextOrientationFallbackOf(m_primaryFont .get())) { 220 && !m_runs[i]->m_fontData->isTextOrientationFallbackOf(m_primaryFont .get())) {
220 fallback->add(m_runs[i]->m_fontData.get()); 221 fallback->add(m_runs[i]->m_fontData.get());
221 } 222 }
222 } 223 }
223 } 224 }
224 225
225 void ShapeResult::applySpacing(ShapeResultSpacing& spacing, const TextRun& textR un) 226 void ShapeResult::applySpacing(ShapeResultSpacing& spacing, const TextRun& textR un)
226 { 227 {
227 float offsetX, offsetY; 228 float offsetX, offsetY;
228 float& offset = spacing.isVerticalOffset() ? offsetY : offsetX; 229 float& offset = spacing.isVerticalOffset() ? offsetY : offsetX;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 break; 351 break;
351 } 352 }
352 } 353 }
353 } 354 }
354 // If we didn't find an existing slot to place it, append. 355 // If we didn't find an existing slot to place it, append.
355 if (run) 356 if (run)
356 m_runs.append(std::move(run)); 357 m_runs.append(std::move(run));
357 } 358 }
358 359
359 } // namespace blink 360 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698