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

Side by Side Diff: sky/engine/platform/fonts/skia/FontCacheSkia.cpp

Issue 1241673004: Minor sky/engine updates for Mac target (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Remove file added as a result of a bad merge Created 5 years, 5 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) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "sky/engine/wtf/text/AtomicString.h" 42 #include "sky/engine/wtf/text/AtomicString.h"
43 #include "sky/engine/wtf/text/CString.h" 43 #include "sky/engine/wtf/text/CString.h"
44 #include "third_party/skia/include/core/SkStream.h" 44 #include "third_party/skia/include/core/SkStream.h"
45 #include "third_party/skia/include/core/SkTypeface.h" 45 #include "third_party/skia/include/core/SkTypeface.h"
46 #include "third_party/skia/include/ports/SkFontMgr.h" 46 #include "third_party/skia/include/ports/SkFontMgr.h"
47 47
48 #if !OS(WIN) && !OS(ANDROID) 48 #if !OS(WIN) && !OS(ANDROID)
49 #include "third_party/skia/include/ports/SkFontConfigInterface.h" 49 #include "third_party/skia/include/ports/SkFontConfigInterface.h"
50 #endif 50 #endif
51 51
52 #if !OS(WIN) && !OS(ANDROID) && !OS(IOS) 52 #if !OS(WIN) && !OS(ANDROID) && !OS(IOS) && !OS(MACOSX)
53 // TODO(bungeman) remove this temporary code ASAP. 53 // TODO(bungeman) remove this temporary code ASAP.
54 // This namespace exists to ease transition of SkTypeface from using SkStream to SkStreamAsset. 54 // This namespace exists to ease transition of SkTypeface from using SkStream to SkStreamAsset.
55 namespace tmp { 55 namespace tmp {
56 // Like std::declval but only returns lvalue references, ok since it isn't used on rvalue references. 56 // Like std::declval but only returns lvalue references, ok since it isn't used on rvalue references.
57 template<typename T> T& declvall(); 57 template<typename T> T& declvall();
58 // The return type of SkFontConfigInterface::openStream(const SkFontConfigInterf ace::FontIdentity&). 58 // The return type of SkFontConfigInterface::openStream(const SkFontConfigInterf ace::FontIdentity&).
59 using StreamType = decltype(tmp::declvall<SkFontConfigInterface>().openStream(tm p::declvall<const SkFontConfigInterface::FontIdentity&>())); 59 using StreamType = decltype(tmp::declvall<SkFontConfigInterface>().openStream(tm p::declvall<const SkFontConfigInterface::FontIdentity&>()));
60 } 60 }
61 static tmp::StreamType streamForFontconfigInterfaceId(int fontconfigInterfaceId) 61 static tmp::StreamType streamForFontconfigInterfaceId(int fontconfigInterfaceId)
62 { 62 {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, arialCreationParams, ( AtomicString("Arial", AtomicString::ConstructFromLiteral))); 208 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, arialCreationParams, ( AtomicString("Arial", AtomicString::ConstructFromLiteral)));
209 fontPlatformData = getFontPlatformData(description, arialCreationParams) ; 209 fontPlatformData = getFontPlatformData(description, arialCreationParams) ;
210 } 210 }
211 211
212 ASSERT(fontPlatformData); 212 ASSERT(fontPlatformData);
213 return fontDataFromFontPlatformData(fontPlatformData, shouldRetain); 213 return fontDataFromFontPlatformData(fontPlatformData, shouldRetain);
214 } 214 }
215 215
216 PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc ription, const FontFaceCreationParams& creationParams, CString& name) 216 PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc ription, const FontFaceCreationParams& creationParams, CString& name)
217 { 217 {
218 #if !OS(WIN) && !OS(ANDROID) && !OS(IOS) 218 #if !OS(WIN) && !OS(ANDROID) && !OS(IOS) && !OS(MACOSX)
219 if (creationParams.creationType() == CreateFontByFciIdAndTtcIndex) { 219 if (creationParams.creationType() == CreateFontByFciIdAndTtcIndex) {
220 // TODO(dro): crbug.com/381620 Use creationParams.ttcIndex() after 220 // TODO(dro): crbug.com/381620 Use creationParams.ttcIndex() after
221 // https://code.google.com/p/skia/issues/detail?id=1186 gets fixed. 221 // https://code.google.com/p/skia/issues/detail?id=1186 gets fixed.
222 SkTypeface* typeface = nullptr; 222 SkTypeface* typeface = nullptr;
223 if (Platform::current()->sandboxSupport()) 223 if (Platform::current()->sandboxSupport())
224 typeface = SkTypeface::CreateFromStream(streamForFontconfigInterface Id(creationParams.fontconfigInterfaceId())); 224 typeface = SkTypeface::CreateFromStream(streamForFontconfigInterface Id(creationParams.fontconfigInterfaceId()));
225 else 225 else
226 typeface = SkTypeface::CreateFromFile(creationParams.filename().data ()); 226 typeface = SkTypeface::CreateFromFile(creationParams.filename().data ());
227 227
228 if (typeface) 228 if (typeface)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 fontSize, 273 fontSize,
274 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || fontDesc ription.isSyntheticBold(), 274 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || fontDesc ription.isSyntheticBold(),
275 (fontDescription.style() && !tf->isItalic()) || fontDescription.isSynthe ticItalic(), 275 (fontDescription.style() && !tf->isItalic()) || fontDescription.isSynthe ticItalic(),
276 fontDescription.orientation(), 276 fontDescription.orientation(),
277 fontDescription.useSubpixelPositioning()); 277 fontDescription.useSubpixelPositioning());
278 return result; 278 return result;
279 } 279 }
280 #endif // !OS(WIN) 280 #endif // !OS(WIN)
281 281
282 } // namespace blink 282 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/platform/fonts/ios/FontPlatformDataIOS.cpp ('k') | sky/engine/platform/fonts/skia/SimpleFontDataSkia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698