| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 // SkTypes will include Windows.h, which will pull in all of the GDI defines. | 9 // SkTypes will include Windows.h, which will pull in all of the GDI defines. |
| 10 // GDI #defines GetGlyphIndices to GetGlyphIndicesA or GetGlyphIndicesW, but | 10 // GDI #defines GetGlyphIndices to GetGlyphIndicesA or GetGlyphIndicesW, but |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 "Could not get font file reference key."); | 232 "Could not get font file reference key."); |
| 233 | 233 |
| 234 SkTScopedComPtr<IDWriteFontFileLoader> fontFileLoader; | 234 SkTScopedComPtr<IDWriteFontFileLoader> fontFileLoader; |
| 235 HRNM(fontFile->GetLoader(&fontFileLoader), "Could not get font file loader."
); | 235 HRNM(fontFile->GetLoader(&fontFileLoader), "Could not get font file loader."
); |
| 236 | 236 |
| 237 SkTScopedComPtr<IDWriteFontFileStream> fontFileStream; | 237 SkTScopedComPtr<IDWriteFontFileStream> fontFileStream; |
| 238 HRNM(fontFileLoader->CreateStreamFromKey(fontFileKey, fontFileKeySize, | 238 HRNM(fontFileLoader->CreateStreamFromKey(fontFileKey, fontFileKeySize, |
| 239 &fontFileStream), | 239 &fontFileStream), |
| 240 "Could not create font file stream."); | 240 "Could not create font file stream."); |
| 241 | 241 |
| 242 return SkNEW_ARGS(SkDWriteFontFileStream, (fontFileStream.get())); | 242 return new SkDWriteFontFileStream(fontFileStream.get()); |
| 243 } | 243 } |
| 244 | 244 |
| 245 SkScalerContext* DWriteFontTypeface::onCreateScalerContext(const SkDescriptor* d
esc) const { | 245 SkScalerContext* DWriteFontTypeface::onCreateScalerContext(const SkDescriptor* d
esc) const { |
| 246 return SkNEW_ARGS(SkScalerContext_DW, (const_cast<DWriteFontTypeface*>(this)
, desc)); | 246 return new SkScalerContext_DW(const_cast<DWriteFontTypeface*>(this), desc); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const { | 249 void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const { |
| 250 if (rec->fFlags & SkScalerContext::kLCD_Vertical_Flag) { | 250 if (rec->fFlags & SkScalerContext::kLCD_Vertical_Flag) { |
| 251 rec->fMaskFormat = SkMask::kA8_Format; | 251 rec->fMaskFormat = SkMask::kA8_Format; |
| 252 } | 252 } |
| 253 | 253 |
| 254 unsigned flagsWeDontSupport = SkScalerContext::kVertical_Flag | | 254 unsigned flagsWeDontSupport = SkScalerContext::kVertical_Flag | |
| 255 SkScalerContext::kDevKernText_Flag | | 255 SkScalerContext::kDevKernText_Flag | |
| 256 SkScalerContext::kForceAutohinting_Flag | | 256 SkScalerContext::kForceAutohinting_Flag | |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 getAdvanceData(fDWriteFontFace.get(), | 452 getAdvanceData(fDWriteFontFace.get(), |
| 453 glyphCount, | 453 glyphCount, |
| 454 glyphIDs, | 454 glyphIDs, |
| 455 glyphIDsCount, | 455 glyphIDsCount, |
| 456 getWidthAdvance)); | 456 getWidthAdvance)); |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 | 459 |
| 460 return info; | 460 return info; |
| 461 } | 461 } |
| OLD | NEW |