| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkDescriptor.h" | 10 #include "SkDescriptor.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // return new SkOTUtils::LocalizedStrings_SingleName(familyName, language); | 183 // return new SkOTUtils::LocalizedStrings_SingleName(familyName, language); |
| 184 } | 184 } |
| 185 | 185 |
| 186 class SkTestScalerContext : public SkScalerContext { | 186 class SkTestScalerContext : public SkScalerContext { |
| 187 public: | 187 public: |
| 188 SkTestScalerContext(SkTestTypeface* face, const SkDescriptor* desc) | 188 SkTestScalerContext(SkTestTypeface* face, const SkDescriptor* desc) |
| 189 : SkScalerContext(face, desc) | 189 : SkScalerContext(face, desc) |
| 190 , fFace(face) | 190 , fFace(face) |
| 191 { | 191 { |
| 192 fRec.getSingleMatrix(&fMatrix); | 192 fRec.getSingleMatrix(&fMatrix); |
| 193 this->forceGenerateImageFromPath(); | 193 this->setGenerateImageFromPath(true); |
| 194 } | 194 } |
| 195 | 195 |
| 196 virtual ~SkTestScalerContext() { | 196 virtual ~SkTestScalerContext() { |
| 197 } | 197 } |
| 198 | 198 |
| 199 protected: | 199 protected: |
| 200 virtual unsigned generateGlyphCount() SK_OVERRIDE { | 200 virtual unsigned generateGlyphCount() SK_OVERRIDE { |
| 201 return fFace->onCountGlyphs(); | 201 return fFace->onCountGlyphs(); |
| 202 } | 202 } |
| 203 | 203 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 } | 284 } |
| 285 | 285 |
| 286 private: | 286 private: |
| 287 SkTestTypeface* fFace; | 287 SkTestTypeface* fFace; |
| 288 SkMatrix fMatrix; | 288 SkMatrix fMatrix; |
| 289 }; | 289 }; |
| 290 | 290 |
| 291 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { | 291 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { |
| 292 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); | 292 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); |
| 293 } | 293 } |
| OLD | NEW |