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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 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) 2005, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Alexey Proskuryakov 3 * Copyright (C) 2006 Alexey Proskuryakov
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 20 matching lines...) Expand all
31 31
32 #include "SkPaint.h" 32 #include "SkPaint.h"
33 #include "SkPath.h" 33 #include "SkPath.h"
34 #include "SkTypeface.h" 34 #include "SkTypeface.h"
35 #include "SkTypes.h" 35 #include "SkTypes.h"
36 #include "platform/fonts/FontDescription.h" 36 #include "platform/fonts/FontDescription.h"
37 #include "platform/fonts/GlyphPage.h" 37 #include "platform/fonts/GlyphPage.h"
38 #include "platform/fonts/VDMXParser.h" 38 #include "platform/fonts/VDMXParser.h"
39 #include "platform/geometry/FloatRect.h" 39 #include "platform/geometry/FloatRect.h"
40 #include "wtf/MathExtras.h" 40 #include "wtf/MathExtras.h"
41 #include "wtf/PtrUtil.h"
41 #include "wtf/allocator/Partitions.h" 42 #include "wtf/allocator/Partitions.h"
42 #include "wtf/text/CharacterNames.h" 43 #include "wtf/text/CharacterNames.h"
43 #include "wtf/text/Unicode.h" 44 #include "wtf/text/Unicode.h"
45 #include <memory>
44 #include <unicode/unorm.h> 46 #include <unicode/unorm.h>
45 #include <unicode/utf16.h> 47 #include <unicode/utf16.h>
46 48
47 namespace blink { 49 namespace blink {
48 50
49 const float smallCapsFontSizeMultiplier = 0.7f; 51 const float smallCapsFontSizeMultiplier = 0.7f;
50 const float emphasisMarkFontSizeMultiplier = 0.5f; 52 const float emphasisMarkFontSizeMultiplier = 0.5f;
51 53
52 #if OS(LINUX) || OS(ANDROID) 54 #if OS(LINUX) || OS(ANDROID)
53 // This is the largest VDMX table which we'll try to load and parse. 55 // This is the largest VDMX table which we'll try to load and parse.
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 338 }
337 339
338 bool SimpleFontData::isTextOrientationFallbackOf(const SimpleFontData* fontData) const 340 bool SimpleFontData::isTextOrientationFallbackOf(const SimpleFontData* fontData) const
339 { 341 {
340 if (!isTextOrientationFallback() || !fontData->m_derivedFontData) 342 if (!isTextOrientationFallback() || !fontData->m_derivedFontData)
341 return false; 343 return false;
342 return fontData->m_derivedFontData->uprightOrientation == this 344 return fontData->m_derivedFontData->uprightOrientation == this
343 || fontData->m_derivedFontData->verticalRightOrientation == this; 345 || fontData->m_derivedFontData->verticalRightOrientation == this;
344 } 346 }
345 347
346 PassOwnPtr<SimpleFontData::DerivedFontData> SimpleFontData::DerivedFontData::cre ate(bool forCustomFont) 348 std::unique_ptr<SimpleFontData::DerivedFontData> SimpleFontData::DerivedFontData ::create(bool forCustomFont)
347 { 349 {
348 return adoptPtr(new DerivedFontData(forCustomFont)); 350 return wrapUnique(new DerivedFontData(forCustomFont));
349 } 351 }
350 352
351 SimpleFontData::DerivedFontData::~DerivedFontData() 353 SimpleFontData::DerivedFontData::~DerivedFontData()
352 { 354 {
353 if (!forCustomFont) 355 if (!forCustomFont)
354 return; 356 return;
355 357
356 if (smallCaps) 358 if (smallCaps)
357 GlyphPageTreeNode::pruneTreeCustomFontData(smallCaps.get()); 359 GlyphPageTreeNode::pruneTreeCustomFontData(smallCaps.get());
358 if (emphasisMark) 360 if (emphasisMark)
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if (glyphs[i]) { 441 if (glyphs[i]) {
440 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); 442 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this);
441 haveGlyphs = true; 443 haveGlyphs = true;
442 } 444 }
443 } 445 }
444 446
445 return haveGlyphs; 447 return haveGlyphs;
446 } 448 }
447 449
448 } // namespace blink 450 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698