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 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2246 break; | 2246 break; |
2247 case SkPaint::kUTF16_TextEncoding: | 2247 case SkPaint::kUTF16_TextEncoding: |
2248 numGlyphGuess = SkUTF16_CountUnichars( | 2248 numGlyphGuess = SkUTF16_CountUnichars( |
2249 static_cast<const uint16_t *>(text), | 2249 static_cast<const uint16_t *>(text), |
2250 byteLength); | 2250 byteLength); |
2251 break; | 2251 break; |
2252 case SkPaint::kGlyphID_TextEncoding: | 2252 case SkPaint::kGlyphID_TextEncoding: |
2253 numGlyphGuess = byteLength / 2; | 2253 numGlyphGuess = byteLength / 2; |
2254 break; | 2254 break; |
2255 default: | 2255 default: |
2256 SK_DEBUGBREAK(true); | 2256 SK_ALWAYSBREAK(true); |
2257 } | 2257 } |
2258 procs.xpsGlyphs.setReserve(numGlyphGuess); | 2258 procs.xpsGlyphs.setReserve(numGlyphGuess); |
2259 procs.glyphUse = &glyphsUsed; | 2259 procs.glyphUse = &glyphsUsed; |
2260 procs.centemPerUnit = 100.0f / SkScalarToFLOAT(paint.getTextSize()); | 2260 procs.centemPerUnit = 100.0f / SkScalarToFLOAT(paint.getTextSize()); |
2261 | 2261 |
2262 myDraw.fProcs = &procs; | 2262 myDraw.fProcs = &procs; |
2263 } | 2263 } |
2264 | 2264 |
2265 static bool text_must_be_pathed(const SkPaint& paint, const SkMatrix& matrix) { | 2265 static bool text_must_be_pathed(const SkPaint& paint, const SkMatrix& matrix) { |
2266 const SkPaint::Style style = paint.getStyle(); | 2266 const SkPaint::Style style = paint.getStyle(); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2435 IID_PPV_ARGS(&this->fXpsFactory)), | 2435 IID_PPV_ARGS(&this->fXpsFactory)), |
2436 "Could not create factory for layer."); | 2436 "Could not create factory for layer."); |
2437 | 2437 |
2438 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), | 2438 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), |
2439 "Could not create canvas for layer."); | 2439 "Could not create canvas for layer."); |
2440 } | 2440 } |
2441 | 2441 |
2442 bool SkXPSDevice::allowImageFilter(const SkImageFilter*) { | 2442 bool SkXPSDevice::allowImageFilter(const SkImageFilter*) { |
2443 return false; | 2443 return false; |
2444 } | 2444 } |
OLD | NEW |