add font param to CreateDescriptorAndEffectsUsingPaint
Bug: skia:
Change-Id: I629c712dd56809539fca6e8f958f766b9f8341b1
Reviewed-on: https://skia-review.googlesource.com/c/174305
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 551a769..5927995 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -1113,17 +1113,6 @@
return AutoDescriptorGivenRecAndEffects(rec, *effects, ad);
}
-SkDescriptor* SkScalerContext::CreateDescriptorAndEffectsUsingPaint(
- const SkPaint& paint, const SkSurfaceProps& surfaceProps,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& deviceMatrix, SkAutoDescriptor* ad,
- SkScalerContextEffects* effects)
-{
- return CreateDescriptorAndEffectsUsingPaint(SkFont::LEGACY_ExtractFromPaint(paint), paint,
- surfaceProps, scalerContextFlags,
- deviceMatrix, ad, effects);
-}
-
static size_t calculate_size_and_flatten(const SkScalerContextRec& rec,
const SkScalerContextEffects& effects,
SkBinaryWriteBuffer* effectBuffer) {
diff --git a/src/core/SkScalerContext.h b/src/core/SkScalerContext.h
index 315b51e..1217192 100644
--- a/src/core/SkScalerContext.h
+++ b/src/core/SkScalerContext.h
@@ -368,12 +368,6 @@
const SkMatrix& deviceMatrix, SkAutoDescriptor* ad,
SkScalerContextEffects* effects);
- static SkDescriptor* CreateDescriptorAndEffectsUsingPaint(
- const SkPaint& paint, const SkSurfaceProps& surfaceProps,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& deviceMatrix, SkAutoDescriptor* ad,
- SkScalerContextEffects* effects);
-
protected:
SkScalerContextRec fRec;
diff --git a/src/gpu/text/GrTextBlob.cpp b/src/gpu/text/GrTextBlob.cpp
index 48aed7a..e9421ff 100644
--- a/src/gpu/text/GrTextBlob.cpp
+++ b/src/gpu/text/GrTextBlob.cpp
@@ -58,17 +58,17 @@
return blob;
}
-SkExclusiveStrikePtr GrTextBlob::Run::setupCache(const SkPaint& skPaint,
+SkExclusiveStrikePtr GrTextBlob::Run::setupCache(const SkPaint& paint,
const SkSurfaceProps& props,
SkScalerContextFlags scalerContextFlags,
const SkMatrix& viewMatrix) {
-
+ SkFont font = SkFont::LEGACY_ExtractFromPaint(paint);
// if we have an override descriptor for the run, then we should use that
SkAutoDescriptor* desc = fARGBFallbackDescriptor.get() ? fARGBFallbackDescriptor.get() : &fDescriptor;
SkScalerContextEffects effects;
SkScalerContext::CreateDescriptorAndEffectsUsingPaint(
- skPaint, props, scalerContextFlags, viewMatrix, desc, &effects);
- fTypeface = SkPaintPriv::RefTypefaceOrDefault(skPaint);
+ font, paint, props, scalerContextFlags, viewMatrix, desc, &effects);
+ fTypeface = SkFontPriv::RefTypefaceOrDefault(font);
fPathEffect = sk_ref_sp(effects.fPathEffect);
fMaskFilter = sk_ref_sp(effects.fMaskFilter);
return SkStrikeCache::FindOrCreateStrikeExclusive(*desc->getDesc(), effects, *fTypeface);