| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 SkScalar xAdj = SkFixedToScalar(xAdv); | 113 SkScalar xAdj = SkFixedToScalar(xAdv); |
| 114 SkScalar yAdj = SkFixedToScalar(yAdv); | 114 SkScalar yAdj = SkFixedToScalar(yAdv); |
| 115 if (paint.getTextAlign() == SkPaint::kCenter_Align) { | 115 if (paint.getTextAlign() == SkPaint::kCenter_Align) { |
| 116 xAdj = SkScalarHalf(xAdj); | 116 xAdj = SkScalarHalf(xAdj); |
| 117 yAdj = SkScalarHalf(yAdj); | 117 yAdj = SkScalarHalf(yAdj); |
| 118 } | 118 } |
| 119 *x = *x - xAdj; | 119 *x = *x - xAdj; |
| 120 *y = *y - yAdj; | 120 *y = *y - yAdj; |
| 121 } | 121 } |
| 122 | 122 |
| 123 static size_t max_glyphid_for_typeface(SkTypeface* typeface) { | 123 static int max_glyphid_for_typeface(SkTypeface* typeface) { |
| 124 SkAutoResolveDefaultTypeface autoResolve(typeface); | 124 SkAutoResolveDefaultTypeface autoResolve(typeface); |
| 125 typeface = autoResolve.get(); | 125 typeface = autoResolve.get(); |
| 126 return typeface->countGlyphs() - 1; | 126 return typeface->countGlyphs() - 1; |
| 127 } | 127 } |
| 128 | 128 |
| 129 typedef SkAutoSTMalloc<128, uint16_t> SkGlyphStorage; | 129 typedef SkAutoSTMalloc<128, uint16_t> SkGlyphStorage; |
| 130 | 130 |
| 131 static size_t force_glyph_encoding(const SkPaint& paint, const void* text, | 131 static size_t force_glyph_encoding(const SkPaint& paint, const void* text, |
| 132 size_t len, SkGlyphStorage* storage, | 132 size_t len, SkGlyphStorage* storage, |
| 133 uint16_t** glyphIDs) { | 133 uint16_t** glyphIDs) { |
| (...skipping 2004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2138 } | 2138 } |
| 2139 | 2139 |
| 2140 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, | 2140 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, |
| 2141 SkCanvas::Config8888) { | 2141 SkCanvas::Config8888) { |
| 2142 return false; | 2142 return false; |
| 2143 } | 2143 } |
| 2144 | 2144 |
| 2145 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { | 2145 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { |
| 2146 return false; | 2146 return false; |
| 2147 } | 2147 } |
| OLD | NEW |