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 #include "SkPDFDevice.h" | 8 #include "SkPDFDevice.h" |
9 | 9 |
10 #include "SkAnnotation.h" | 10 #include "SkAnnotation.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 SkScalar xAdj = SkFixedToScalar(xAdv); | 116 SkScalar xAdj = SkFixedToScalar(xAdv); |
117 SkScalar yAdj = SkFixedToScalar(yAdv); | 117 SkScalar yAdj = SkFixedToScalar(yAdv); |
118 if (paint.getTextAlign() == SkPaint::kCenter_Align) { | 118 if (paint.getTextAlign() == SkPaint::kCenter_Align) { |
119 xAdj = SkScalarHalf(xAdj); | 119 xAdj = SkScalarHalf(xAdj); |
120 yAdj = SkScalarHalf(yAdj); | 120 yAdj = SkScalarHalf(yAdj); |
121 } | 121 } |
122 *x = *x - xAdj; | 122 *x = *x - xAdj; |
123 *y = *y - yAdj; | 123 *y = *y - yAdj; |
124 } | 124 } |
125 | 125 |
126 static size_t max_glyphid_for_typeface(SkTypeface* typeface) { | 126 static int max_glyphid_for_typeface(SkTypeface* typeface) { |
127 SkAutoResolveDefaultTypeface autoResolve(typeface); | 127 SkAutoResolveDefaultTypeface autoResolve(typeface); |
128 typeface = autoResolve.get(); | 128 typeface = autoResolve.get(); |
129 return typeface->countGlyphs() - 1; | 129 return typeface->countGlyphs() - 1; |
130 } | 130 } |
131 | 131 |
132 typedef SkAutoSTMalloc<128, uint16_t> SkGlyphStorage; | 132 typedef SkAutoSTMalloc<128, uint16_t> SkGlyphStorage; |
133 | 133 |
134 static size_t force_glyph_encoding(const SkPaint& paint, const void* text, | 134 static size_t force_glyph_encoding(const SkPaint& paint, const void* text, |
135 size_t len, SkGlyphStorage* storage, | 135 size_t len, SkGlyphStorage* storage, |
136 uint16_t** glyphIDs) { | 136 uint16_t** glyphIDs) { |
(...skipping 2167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2304 } | 2304 } |
2305 | 2305 |
2306 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, | 2306 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, |
2307 SkCanvas::Config8888) { | 2307 SkCanvas::Config8888) { |
2308 return false; | 2308 return false; |
2309 } | 2309 } |
2310 | 2310 |
2311 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { | 2311 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { |
2312 return false; | 2312 return false; |
2313 } | 2313 } |
OLD | NEW |