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

Unified Diff: src/core/SkScalerContext.h

Issue 1880873002: Revert "Revert of Pass effects directly to fontcache (patchset #8 id:140001 of https://codereview.c… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScalerContext.h
diff --git a/src/core/SkScalerContext.h b/src/core/SkScalerContext.h
index 96674cd5002a8934df2af4a9933834d7345bf1ad..ffde83cb0a9e456f6baf035ca7feb8358983069b 100644
--- a/src/core/SkScalerContext.h
+++ b/src/core/SkScalerContext.h
@@ -20,6 +20,16 @@ class SkMaskFilter;
class SkPathEffect;
class SkRasterizer;
+struct SkScalerContextEffects {
+ SkScalerContextEffects() : fPathEffect(nullptr), fMaskFilter(nullptr), fRasterizer(nullptr) {}
+ SkScalerContextEffects(SkPathEffect* pe, SkMaskFilter* mf, SkRasterizer* ra)
+ : fPathEffect(pe), fMaskFilter(mf), fRasterizer(ra) {}
+
+ SkPathEffect* fPathEffect;
+ SkMaskFilter* fMaskFilter;
+ SkRasterizer* fRasterizer;
+};
+
enum SkAxisAlignment {
kNone_SkAxisAlignment,
kX_SkAxisAlignment,
@@ -200,8 +210,7 @@ public:
kHinting_Mask = kHintingBit1_Flag | kHintingBit2_Flag,
};
-
- SkScalerContext(SkTypeface*, const SkDescriptor*);
+ SkScalerContext(SkTypeface*, const SkScalerContextEffects&, const SkDescriptor*);
virtual ~SkScalerContext();
SkTypeface* getTypeface() const { return fTypeface.get(); }
@@ -260,13 +269,16 @@ public:
const Rec& getRec() const { return fRec; }
+ SkScalerContextEffects getEffects() const {
+ return { fPathEffect.get(), fMaskFilter.get(), fRasterizer.get() };
+ }
+
/**
* Return the axis (if any) that the baseline for horizontal text should land on.
* As an example, the identity matrix will return kX_SkAxisAlignment
*/
SkAxisAlignment computeAxisAlignmentForHText();
-
protected:
Rec fRec;
@@ -326,12 +338,12 @@ private:
friend class SkRandomScalerContext; // For debug purposes
// never null
- SkAutoTUnref<SkTypeface> fTypeface;
+ sk_sp<SkTypeface> fTypeface;
- // optional object, which may be null
- SkPathEffect* fPathEffect;
- SkMaskFilter* fMaskFilter;
- SkRasterizer* fRasterizer;
+ // optional objects, which may be null
+ sk_sp<SkPathEffect> fPathEffect;
+ sk_sp<SkMaskFilter> fMaskFilter;
+ sk_sp<SkRasterizer> fRasterizer;
// if this is set, we draw the image from a path, rather than
// calling generateImage.
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698