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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs 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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 FontDescription elementFontDescription( 472 FontDescription elementFontDescription(
473 computedStyle->getFontDescription()); 473 computedStyle->getFontDescription());
474 // Reset the computed size to avoid inheriting the zoom factor from the 474 // Reset the computed size to avoid inheriting the zoom factor from the
475 // <canvas> element. 475 // <canvas> element.
476 elementFontDescription.setComputedSize( 476 elementFontDescription.setComputedSize(
477 elementFontDescription.specifiedSize()); 477 elementFontDescription.specifiedSize());
478 fontStyle->setFontDescription(elementFontDescription); 478 fontStyle->setFontDescription(elementFontDescription);
479 fontStyle->font().update(fontStyle->font().getFontSelector()); 479 fontStyle->font().update(fontStyle->font().getFontSelector());
480 canvas()->document().ensureStyleResolver().computeFont(fontStyle.get(), 480 canvas()->document().ensureStyleResolver().computeFont(fontStyle.get(),
481 *parsedStyle); 481 *parsedStyle);
482 m_fontsResolvedUsingCurrentStyle.add(newFont, fontStyle->font()); 482 m_fontsResolvedUsingCurrentStyle.insert(newFont, fontStyle->font());
483 DCHECK(!m_fontLRUList.contains(newFont)); 483 DCHECK(!m_fontLRUList.contains(newFont));
484 m_fontLRUList.add(newFont); 484 m_fontLRUList.add(newFont);
485 pruneLocalFontCache(canvasFontCache->hardMaxFonts()); // hard limit 485 pruneLocalFontCache(canvasFontCache->hardMaxFonts()); // hard limit
486 schedulePruneLocalFontCacheIfNeeded(); // soft limit 486 schedulePruneLocalFontCacheIfNeeded(); // soft limit
487 modifiableState().setFont( 487 modifiableState().setFont(
488 fontStyle->font(), canvas()->document().styleEngine().fontSelector()); 488 fontStyle->font(), canvas()->document().styleEngine().fontSelector());
489 } 489 }
490 } else { 490 } else {
491 Font resolvedFont; 491 Font resolvedFont;
492 if (!canvasFontCache->getFontUsingDefaultStyle(newFont, resolvedFont)) 492 if (!canvasFontCache->getFontUsingDefaultStyle(newFont, resolvedFont))
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 } 1167 }
1168 return true; 1168 return true;
1169 } 1169 }
1170 1170
1171 void CanvasRenderingContext2D::resetUsageTracking() { 1171 void CanvasRenderingContext2D::resetUsageTracking() {
1172 UsageCounters newCounters; 1172 UsageCounters newCounters;
1173 m_usageCounters = newCounters; 1173 m_usageCounters = newCounters;
1174 } 1174 }
1175 1175
1176 } // namespace blink 1176 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698