aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrStyle.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-01-13 11:02:42 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-13 16:50:25 +0000
commitf809c1ec98854b6d0e604744a1fc5f9a4ff493be (patch)
tree09967949730f4dce1e797aa5bc6748194bb18624 /src/gpu/GrStyle.h
parent5ac8260268618a992582253c4fc06bb5b0c57d61 (diff)
Try out new refFoo pattern on GrStyle
Change-Id: Ic7f30e3730a3431adf365d729320fe50f38dcea8 Reviewed-on: https://skia-review.googlesource.com/6907 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrStyle.h')
-rw-r--r--src/gpu/GrStyle.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gpu/GrStyle.h b/src/gpu/GrStyle.h
index 9091166fe1..a5599f9b1b 100644
--- a/src/gpu/GrStyle.h
+++ b/src/gpu/GrStyle.h
@@ -77,19 +77,19 @@ public:
explicit GrStyle(SkStrokeRec::InitStyle initStyle) : fStrokeRec(initStyle) {}
- GrStyle(const SkStrokeRec& strokeRec, SkPathEffect* pe) : fStrokeRec(strokeRec) {
- this->initPathEffect(pe);
+ GrStyle(const SkStrokeRec& strokeRec, sk_sp<SkPathEffect> pe) : fStrokeRec(strokeRec) {
+ this->initPathEffect(std::move(pe));
}
GrStyle(const GrStyle& that) : fStrokeRec(SkStrokeRec::kFill_InitStyle) { *this = that; }
explicit GrStyle(const SkPaint& paint) : fStrokeRec(paint) {
- this->initPathEffect(paint.getPathEffect());
+ this->initPathEffect(paint.refPathEffect());
}
explicit GrStyle(const SkPaint& paint, SkPaint::Style overrideStyle)
: fStrokeRec(paint, overrideStyle) {
- this->initPathEffect(paint.getPathEffect());
+ this->initPathEffect(paint.refPathEffect());
}
GrStyle& operator=(const GrStyle& that) {
@@ -116,6 +116,7 @@ public:
bool isSimpleHairline() const { return fStrokeRec.isHairlineStyle() && !fPathEffect; }
SkPathEffect* pathEffect() const { return fPathEffect.get(); }
+ sk_sp<SkPathEffect> refPathEffect() const { return fPathEffect; }
bool hasPathEffect() const { return SkToBool(fPathEffect.get()); }
@@ -182,7 +183,7 @@ public:
}
private:
- void initPathEffect(SkPathEffect* pe);
+ void initPathEffect(sk_sp<SkPathEffect> pe);
struct DashInfo {
DashInfo() : fType(SkPathEffect::kNone_DashType) {}