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 "SkAdvancedTypefaceMetrics.h" | 8 #include "SkAdvancedTypefaceMetrics.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 SkTypeface::LocalizedStrings* SkTestTypeface::onCreateFamilyNameIterator() const
{ | 176 SkTypeface::LocalizedStrings* SkTestTypeface::onCreateFamilyNameIterator() const
{ |
177 SkString familyName(fTestFont->fName); | 177 SkString familyName(fTestFont->fName); |
178 SkString language("und"); //undetermined | 178 SkString language("und"); //undetermined |
179 SkASSERT(0); // incomplete | 179 SkASSERT(0); // incomplete |
180 return nullptr; | 180 return nullptr; |
181 // return new SkOTUtils::LocalizedStrings_SingleName(familyName, language); | 181 // return new SkOTUtils::LocalizedStrings_SingleName(familyName, language); |
182 } | 182 } |
183 | 183 |
184 class SkTestScalerContext : public SkScalerContext { | 184 class SkTestScalerContext : public SkScalerContext { |
185 public: | 185 public: |
186 SkTestScalerContext(SkTestTypeface* face, const SkScalerContextEffects& effe
cts, | 186 SkTestScalerContext(SkTestTypeface* face, const SkDescriptor* desc) |
187 const SkDescriptor* desc) | 187 : SkScalerContext(face, desc) |
188 : SkScalerContext(face, effects, desc) | |
189 , fFace(face) | 188 , fFace(face) |
190 { | 189 { |
191 fRec.getSingleMatrix(&fMatrix); | 190 fRec.getSingleMatrix(&fMatrix); |
192 this->forceGenerateImageFromPath(); | 191 this->forceGenerateImageFromPath(); |
193 } | 192 } |
194 | 193 |
195 virtual ~SkTestScalerContext() { | 194 virtual ~SkTestScalerContext() { |
196 } | 195 } |
197 | 196 |
198 protected: | 197 protected: |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 metrics->fXMax = SkScalarMul(metrics->fXMax, scale); | 276 metrics->fXMax = SkScalarMul(metrics->fXMax, scale); |
278 metrics->fXHeight = SkScalarMul(metrics->fXHeight, scale); | 277 metrics->fXHeight = SkScalarMul(metrics->fXHeight, scale); |
279 } | 278 } |
280 } | 279 } |
281 | 280 |
282 private: | 281 private: |
283 SkTestTypeface* fFace; | 282 SkTestTypeface* fFace; |
284 SkMatrix fMatrix; | 283 SkMatrix fMatrix; |
285 }; | 284 }; |
286 | 285 |
287 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkScalerContextEffe
cts& effects, | 286 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { |
288 const SkDescriptor* desc)
const { | 287 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), desc); |
289 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), effects, d
esc); | |
290 } | 288 } |
OLD | NEW |