#include "GrStyle.h"
-void GrStyle::initPathEffect(sk_sp<SkPathEffect> pe) {
+void GrStyle::initPathEffect(SkPathEffect* pe) {
if (!pe) {
fDashInfo.fType = SkPathEffect::kNone_DashType;
return;
if (fStrokeRec.getStyle() == SkStrokeRec::kFill_Style) {
fPathEffect.reset(nullptr);
} else {
- fPathEffect = std::move(pe);
+ fPathEffect.reset(SkSafeRef(pe));
fDashInfo.fType = SkPathEffect::kDash_DashType;
fDashInfo.fIntervals.reset(info.fCount);
fDashInfo.fPhase = info.fPhase;
return;
}
} else {
- fPathEffect = std::move(pe);
+ fPathEffect.reset(SkSafeRef(pe));
}
fDashInfo.fType = SkPathEffect::kNone_DashType;
fDashInfo.fIntervals.reset(0);
fDashInfo.fType = SkPathEffect::kNone_DashType;
}
- GrStyle(const SkStrokeRec& strokeRec, sk_sp<SkPathEffect> pe) : fStrokeRec(strokeRec) {
+ GrStyle(const SkStrokeRec& strokeRec, SkPathEffect* pe) : fStrokeRec(strokeRec) {
SkASSERT(SkStrokeRec::kStrokeAndFill_Style != strokeRec.getStyle());
- this->initPathEffect(std::move(pe));
+ this->initPathEffect(pe);
}
GrStyle(const GrStyle& that) : fStrokeRec(SkStrokeRec::kFill_InitStyle) {
explicit GrStyle(const SkPaint& paint) : fStrokeRec(paint) {
SkASSERT(SkStrokeRec::kStrokeAndFill_Style != fStrokeRec.getStyle());
- this->initPathEffect(sk_ref_sp(paint.getPathEffect()));
+ this->initPathEffect(paint.getPathEffect());
}
GrStyle& operator=(const GrStyle& that) {
const SkStrokeRec& strokeRec() const { return fStrokeRec; }
private:
- void initPathEffect(sk_sp<SkPathEffect> pe);
+ void initPathEffect(SkPathEffect* pe);
struct DashInfo {
DashInfo& operator=(const DashInfo& that) {