OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #ifndef UNICODE | 8 #ifndef UNICODE |
9 #define UNICODE | 9 #define UNICODE |
10 #endif | 10 #endif |
(...skipping 2076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2087 bool isTTC = (data && | 2087 bool isTTC = (data && |
2088 fontData->getLength() >= sizeof(SkTTCFHeader) && | 2088 fontData->getLength() >= sizeof(SkTTCFHeader) && |
2089 ((SkTTCFHeader*)data)->ttcTag == SkTTCFHeader::TAG); | 2089 ((SkTTCFHeader*)data)->ttcTag == SkTTCFHeader::TAG); |
2090 | 2090 |
2091 TypefaceUse& newTypefaceUse = this->fTypefaces.push_back(); | 2091 TypefaceUse& newTypefaceUse = this->fTypefaces.push_back(); |
2092 newTypefaceUse.typefaceId = typefaceID; | 2092 newTypefaceUse.typefaceId = typefaceID; |
2093 newTypefaceUse.ttcIndex = isTTC ? ttcIndex : -1; | 2093 newTypefaceUse.ttcIndex = isTTC ? ttcIndex : -1; |
2094 newTypefaceUse.fontData = fontData; | 2094 newTypefaceUse.fontData = fontData; |
2095 newTypefaceUse.xpsFont = xpsFontResource.release(); | 2095 newTypefaceUse.xpsFont = xpsFontResource.release(); |
2096 | 2096 |
2097 SkAutoGlyphCache agc = SkAutoGlyphCache(paint, NULL, &SkMatrix::I()); | 2097 SkAutoGlyphCache agc(paint, NULL, &SkMatrix::I()); |
2098 SkGlyphCache* glyphCache = agc.getCache(); | 2098 SkGlyphCache* glyphCache = agc.getCache(); |
2099 unsigned int glyphCount = glyphCache->getGlyphCount(); | 2099 unsigned int glyphCount = glyphCache->getGlyphCount(); |
2100 newTypefaceUse.glyphsUsed = new SkBitSet(glyphCount); | 2100 newTypefaceUse.glyphsUsed = new SkBitSet(glyphCount); |
2101 | 2101 |
2102 *typefaceUse = &newTypefaceUse; | 2102 *typefaceUse = &newTypefaceUse; |
2103 return S_OK; | 2103 return S_OK; |
2104 } | 2104 } |
2105 | 2105 |
2106 HRESULT SkXPSDevice::AddGlyphs(const SkDraw& d, | 2106 HRESULT SkXPSDevice::AddGlyphs(const SkDraw& d, |
2107 IXpsOMObjectFactory* xpsFactory, | 2107 IXpsOMObjectFactory* xpsFactory, |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2452 IID_PPV_ARGS(&this->fXpsFactory)), | 2452 IID_PPV_ARGS(&this->fXpsFactory)), |
2453 "Could not create factory for layer."); | 2453 "Could not create factory for layer."); |
2454 | 2454 |
2455 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), | 2455 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), |
2456 "Could not create canvas for layer."); | 2456 "Could not create canvas for layer."); |
2457 } | 2457 } |
2458 | 2458 |
2459 bool SkXPSDevice::allowImageFilter(SkImageFilter*) { | 2459 bool SkXPSDevice::allowImageFilter(SkImageFilter*) { |
2460 return false; | 2460 return false; |
2461 } | 2461 } |
OLD | NEW |