OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkScalerContext.h" | 10 #include "SkScalerContext.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 SkMask::kJustComputeBounds_CreateMode)) { | 160 SkMask::kJustComputeBounds_CreateMode)) { |
161 glyph->fLeft = mask.fBounds.fLeft; | 161 glyph->fLeft = mask.fBounds.fLeft; |
162 glyph->fTop = mask.fBounds.fTop; | 162 glyph->fTop = mask.fBounds.fTop; |
163 glyph->fWidth = SkToU16(mask.fBounds.width()); | 163 glyph->fWidth = SkToU16(mask.fBounds.width()); |
164 glyph->fHeight = SkToU16(mask.fBounds.height()); | 164 glyph->fHeight = SkToU16(mask.fBounds.height()); |
165 } else { | 165 } else { |
166 goto SK_ERROR; | 166 goto SK_ERROR; |
167 } | 167 } |
168 } else { | 168 } else { |
169 // just use devPath | 169 // just use devPath |
170 SkIRect ir; | 170 const SkIRect ir = devPath.getBounds().roundOut(); |
171 devPath.getBounds().roundOut(&ir); | |
172 | 171 |
173 if (ir.isEmpty() || !ir.is16Bit()) { | 172 if (ir.isEmpty() || !ir.is16Bit()) { |
174 goto SK_ERROR; | 173 goto SK_ERROR; |
175 } | 174 } |
176 glyph->fLeft = ir.fLeft; | 175 glyph->fLeft = ir.fLeft; |
177 glyph->fTop = ir.fTop; | 176 glyph->fTop = ir.fTop; |
178 glyph->fWidth = SkToU16(ir.width()); | 177 glyph->fWidth = SkToU16(ir.width()); |
179 glyph->fHeight = SkToU16(ir.height()); | 178 glyph->fHeight = SkToU16(ir.height()); |
180 | 179 |
181 if (glyph->fWidth > 0) { | 180 if (glyph->fWidth > 0) { |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, | 757 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, |
759 bool allowFailure) const { | 758 bool allowFailure) const { |
760 SkScalerContext* c = this->onCreateScalerContext(desc); | 759 SkScalerContext* c = this->onCreateScalerContext(desc); |
761 | 760 |
762 if (!c && !allowFailure) { | 761 if (!c && !allowFailure) { |
763 c = SkNEW_ARGS(SkScalerContext_Empty, | 762 c = SkNEW_ARGS(SkScalerContext_Empty, |
764 (const_cast<SkTypeface*>(this), desc)); | 763 (const_cast<SkTypeface*>(this), desc)); |
765 } | 764 } |
766 return c; | 765 return c; |
767 } | 766 } |
OLD | NEW |