| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |