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

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

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 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
« no previous file with comments | « skia/skia_test_expectations.txt ('k') | sky/engine/platform/graphics/Canvas2DLayerBridge.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "sky/engine/public/platform/Platform.h" 43 #include "sky/engine/public/platform/Platform.h"
44 #include "sky/engine/public/platform/linux/WebSandboxSupport.h" 44 #include "sky/engine/public/platform/linux/WebSandboxSupport.h"
45 #include "sky/engine/wtf/Assertions.h" 45 #include "sky/engine/wtf/Assertions.h"
46 #include "sky/engine/wtf/text/AtomicString.h" 46 #include "sky/engine/wtf/text/AtomicString.h"
47 #include "sky/engine/wtf/text/CString.h" 47 #include "sky/engine/wtf/text/CString.h"
48 #include "third_party/skia/include/core/SkStream.h" 48 #include "third_party/skia/include/core/SkStream.h"
49 #include "third_party/skia/include/core/SkTypeface.h" 49 #include "third_party/skia/include/core/SkTypeface.h"
50 #include "third_party/skia/include/ports/SkFontMgr.h" 50 #include "third_party/skia/include/ports/SkFontMgr.h"
51 51
52 #if !OS(WIN) && !OS(ANDROID) 52 #if !OS(WIN) && !OS(ANDROID)
53 static SkStream* streamForFontconfigInterfaceId(int fontconfigInterfaceId) 53 // TODO(bungeman) remove this temporary code ASAP.
54 // This namespace exists to ease transition of SkTypeface from using SkStream to SkStreamAsset.
55 namespace tmp {
56 // Like std::declval but only returns lvalue references, ok since it isn't used on rvalue references.
57 template<typename T> T& declvall();
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&>()));
60 }
61 static tmp::StreamType streamForFontconfigInterfaceId(int fontconfigInterfaceId)
54 { 62 {
55 SkAutoTUnref<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal()); 63 SkAutoTUnref<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal());
56 SkFontConfigInterface::FontIdentity fontIdentity; 64 SkFontConfigInterface::FontIdentity fontIdentity;
57 fontIdentity.fID = fontconfigInterfaceId; 65 fontIdentity.fID = fontconfigInterfaceId;
58 return fci->openStream(fontIdentity); 66 return fci->openStream(fontIdentity);
59 } 67 }
60 #endif 68 #endif
61 69
62 namespace blink { 70 namespace blink {
63 71
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 fontSize, 214 fontSize,
207 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || fontDesc ription.isSyntheticBold(), 215 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || fontDesc ription.isSyntheticBold(),
208 (fontDescription.style() && !tf->isItalic()) || fontDescription.isSynthe ticItalic(), 216 (fontDescription.style() && !tf->isItalic()) || fontDescription.isSynthe ticItalic(),
209 fontDescription.orientation(), 217 fontDescription.orientation(),
210 fontDescription.useSubpixelPositioning()); 218 fontDescription.useSubpixelPositioning());
211 return result; 219 return result;
212 } 220 }
213 #endif // !OS(WIN) 221 #endif // !OS(WIN)
214 222
215 } // namespace blink 223 } // namespace blink
OLDNEW
« no previous file with comments | « skia/skia_test_expectations.txt ('k') | sky/engine/platform/graphics/Canvas2DLayerBridge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698