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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp

Issue 1858753003: Remove RawPtr from core/css (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * Copyright (C) 2015 Collabora Ltd. All rights reserved. 5 * Copyright (C) 2015 Collabora Ltd. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 void FontBuilder::updateComputedSize(FontDescription& fontDescription, const Com putedStyle& style) 333 void FontBuilder::updateComputedSize(FontDescription& fontDescription, const Com putedStyle& style)
334 { 334 {
335 float computedSize = getComputedSizeFromSpecifiedSize(fontDescription, style .effectiveZoom(), fontDescription.specifiedSize()); 335 float computedSize = getComputedSizeFromSpecifiedSize(fontDescription, style .effectiveZoom(), fontDescription.specifiedSize());
336 float multiplier = style.textAutosizingMultiplier(); 336 float multiplier = style.textAutosizingMultiplier();
337 if (multiplier > 1) 337 if (multiplier > 1)
338 computedSize = TextAutosizer::computeAutosizedFontSize(computedSize, mul tiplier); 338 computedSize = TextAutosizer::computeAutosizedFontSize(computedSize, mul tiplier);
339 fontDescription.setComputedSize(computedSize); 339 fontDescription.setComputedSize(computedSize);
340 } 340 }
341 341
342 void FontBuilder::createFont(RawPtr<FontSelector> fontSelector, ComputedStyle& s tyle) 342 void FontBuilder::createFont(FontSelector* fontSelector, ComputedStyle& style)
343 { 343 {
344 if (!m_flags) 344 if (!m_flags)
345 return; 345 return;
346 346
347 FontDescription description = style.getFontDescription(); 347 FontDescription description = style.getFontDescription();
348 348
349 if (isSet(PropertySetFlag::Family)) { 349 if (isSet(PropertySetFlag::Family)) {
350 description.setGenericFamily(m_fontDescription.genericFamily()); 350 description.setGenericFamily(m_fontDescription.genericFamily());
351 description.setFamily(m_fontDescription.family()); 351 description.setFamily(m_fontDescription.family());
352 } 352 }
(...skipping 22 matching lines...) Expand all
375 description.setTextRendering(m_fontDescription.textRendering()); 375 description.setTextRendering(m_fontDescription.textRendering());
376 if (isSet(PropertySetFlag::Kerning)) 376 if (isSet(PropertySetFlag::Kerning))
377 description.setKerning(m_fontDescription.getKerning()); 377 description.setKerning(m_fontDescription.getKerning());
378 if (isSet(PropertySetFlag::FontSmoothing)) 378 if (isSet(PropertySetFlag::FontSmoothing))
379 description.setFontSmoothing(m_fontDescription.fontSmoothing()); 379 description.setFontSmoothing(m_fontDescription.fontSmoothing());
380 if (isSet(PropertySetFlag::TextOrientation) || isSet(PropertySetFlag::Writin gMode)) 380 if (isSet(PropertySetFlag::TextOrientation) || isSet(PropertySetFlag::Writin gMode))
381 updateOrientation(description, style); 381 updateOrientation(description, style);
382 382
383 updateSpecifiedSize(description, style); 383 updateSpecifiedSize(description, style);
384 updateComputedSize(description, style); 384 updateComputedSize(description, style);
385 updateAdjustedSize(description, style, fontSelector.get()); 385 updateAdjustedSize(description, style, fontSelector);
386 386
387 style.setFontDescription(description); 387 style.setFontDescription(description);
388 style.font().update(fontSelector); 388 style.font().update(fontSelector);
389 m_flags = 0; 389 m_flags = 0;
390 } 390 }
391 391
392 void FontBuilder::createFontForDocument(RawPtr<FontSelector> fontSelector, Compu tedStyle& documentStyle) 392 void FontBuilder::createFontForDocument(FontSelector* fontSelector, ComputedStyl e& documentStyle)
393 { 393 {
394 FontDescription fontDescription = FontDescription(); 394 FontDescription fontDescription = FontDescription();
395 fontDescription.setLocale(documentStyle.locale()); 395 fontDescription.setLocale(documentStyle.locale());
396 396
397 setFamilyDescription(fontDescription, FontBuilder::initialFamilyDescription( )); 397 setFamilyDescription(fontDescription, FontBuilder::initialFamilyDescription( ));
398 setSize(fontDescription, FontDescription::Size(FontSize::initialKeywordSize( ), 0.0f, false)); 398 setSize(fontDescription, FontDescription::Size(FontSize::initialKeywordSize( ), 0.0f, false));
399 updateSpecifiedSize(fontDescription, documentStyle); 399 updateSpecifiedSize(fontDescription, documentStyle);
400 updateComputedSize(fontDescription, documentStyle); 400 updateComputedSize(fontDescription, documentStyle);
401 401
402 updateOrientation(fontDescription, documentStyle); 402 updateOrientation(fontDescription, documentStyle);
403 documentStyle.setFontDescription(fontDescription); 403 documentStyle.setFontDescription(fontDescription);
404 documentStyle.font().update(fontSelector); 404 documentStyle.font().update(fontSelector);
405 } 405 }
406 406
407 } // namespace blink 407 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698