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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 10 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) 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 void ShapeResult::fallbackFonts( 224 void ShapeResult::fallbackFonts(
225 HashSet<const SimpleFontData*>* fallback) const { 225 HashSet<const SimpleFontData*>* fallback) const {
226 ASSERT(fallback); 226 ASSERT(fallback);
227 ASSERT(m_primaryFont); 227 ASSERT(m_primaryFont);
228 for (unsigned i = 0; i < m_runs.size(); ++i) { 228 for (unsigned i = 0; i < m_runs.size(); ++i) {
229 if (m_runs[i] && m_runs[i]->m_fontData && 229 if (m_runs[i] && m_runs[i]->m_fontData &&
230 m_runs[i]->m_fontData != m_primaryFont && 230 m_runs[i]->m_fontData != m_primaryFont &&
231 !m_runs[i]->m_fontData->isTextOrientationFallbackOf( 231 !m_runs[i]->m_fontData->isTextOrientationFallbackOf(
232 m_primaryFont.get())) { 232 m_primaryFont.get())) {
233 fallback->add(m_runs[i]->m_fontData.get()); 233 fallback->insert(m_runs[i]->m_fontData.get());
234 } 234 }
235 } 235 }
236 } 236 }
237 237
238 void ShapeResult::applySpacing(ShapeResultSpacing& spacing, 238 void ShapeResult::applySpacing(ShapeResultSpacing& spacing,
239 const TextRun& textRun) { 239 const TextRun& textRun) {
240 float offsetX, offsetY; 240 float offsetX, offsetY;
241 float& offset = spacing.isVerticalOffset() ? offsetY : offsetX; 241 float& offset = spacing.isVerticalOffset() ? offsetY : offsetX;
242 float totalSpace = 0; 242 float totalSpace = 0;
243 for (auto& run : m_runs) { 243 for (auto& run : m_runs) {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 result->m_width = run->m_width; 401 result->m_width = run->m_width;
402 result->m_numGlyphs = count; 402 result->m_numGlyphs = count;
403 DCHECK_EQ(result->m_numGlyphs, count); // no overflow 403 DCHECK_EQ(result->m_numGlyphs, count); // no overflow
404 result->m_hasVerticalOffsets = 404 result->m_hasVerticalOffsets =
405 fontData->platformData().isVerticalAnyUpright(); 405 fontData->platformData().isVerticalAnyUpright();
406 result->m_runs.push_back(std::move(run)); 406 result->m_runs.push_back(std::move(run));
407 return result.release(); 407 return result.release();
408 } 408 }
409 409
410 } // namespace blink 410 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698