Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: src/fonts/SkTestScalerContext.cpp

Issue 1863013003: Pass effects directly to fontcache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: name the empty effects Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/fonts/SkTestScalerContext.h ('k') | src/gpu/GrPathRendering.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 SkDescriptor* desc) 186 SkTestScalerContext(SkTestTypeface* face, const SkScalerContextEffects& effe cts,
187 : SkScalerContext(face, desc) 187 const SkDescriptor* desc)
188 : SkScalerContext(face, effects, desc)
188 , fFace(face) 189 , fFace(face)
189 { 190 {
190 fRec.getSingleMatrix(&fMatrix); 191 fRec.getSingleMatrix(&fMatrix);
191 this->forceGenerateImageFromPath(); 192 this->forceGenerateImageFromPath();
192 } 193 }
193 194
194 virtual ~SkTestScalerContext() { 195 virtual ~SkTestScalerContext() {
195 } 196 }
196 197
197 protected: 198 protected:
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 metrics->fXMax = SkScalarMul(metrics->fXMax, scale); 277 metrics->fXMax = SkScalarMul(metrics->fXMax, scale);
277 metrics->fXHeight = SkScalarMul(metrics->fXHeight, scale); 278 metrics->fXHeight = SkScalarMul(metrics->fXHeight, scale);
278 } 279 }
279 } 280 }
280 281
281 private: 282 private:
282 SkTestTypeface* fFace; 283 SkTestTypeface* fFace;
283 SkMatrix fMatrix; 284 SkMatrix fMatrix;
284 }; 285 };
285 286
286 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const { 287 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkScalerContextEffe cts& effects,
287 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), desc); 288 const SkDescriptor* desc) const {
289 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), effects, d esc);
288 } 290 }
OLDNEW
« no previous file with comments | « src/fonts/SkTestScalerContext.h ('k') | src/gpu/GrPathRendering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698