Revert of Make GrStyle more sk_sp savy (patchset #1 id:1 of https://codereview.chromi...
authorbsalomon <bsalomon@google.com>
Tue, 3 May 2016 17:11:55 +0000 (10:11 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 3 May 2016 17:11:55 +0000 (10:11 -0700)
Reason for revert:
Crashing Ubuntu/GCC bot (but not clang)

Original issue's description:
> Make GrStyle more sk_sp savy
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947543002
>
> Committed: https://skia.googlesource.com/skia/+/46db22f1cfc65a7a4f1de13d774718347362f60f

TBR=robertphillips@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1943973002

src/gpu/GrStyle.cpp
src/gpu/GrStyle.h

index 330a7d797be16f55ca2267afadadbc1146cc3bd9..40a148bb4a9c6e88063d064aa3232ef6fda50202 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "GrStyle.h"
 
-void GrStyle::initPathEffect(sk_sp<SkPathEffect> pe) {
+void GrStyle::initPathEffect(SkPathEffect* pe) {
     if (!pe) {
         fDashInfo.fType = SkPathEffect::kNone_DashType;
         return;
@@ -17,7 +17,7 @@ void GrStyle::initPathEffect(sk_sp<SkPathEffect> pe) {
         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;
@@ -26,7 +26,7 @@ void GrStyle::initPathEffect(sk_sp<SkPathEffect> pe) {
             return;
         }
     } else {
-        fPathEffect = std::move(pe);
+        fPathEffect.reset(SkSafeRef(pe));
     }
     fDashInfo.fType = SkPathEffect::kNone_DashType;
     fDashInfo.fIntervals.reset(0);
index 62165bf31118140d14af051930bc4067f5560725..4eef252de4f4668244bef8d55ce76ddfb922e24e 100644 (file)
@@ -29,9 +29,9 @@ public:
         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) {
@@ -40,7 +40,7 @@ public:
 
     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) {
@@ -68,7 +68,7 @@ public:
     const SkStrokeRec& strokeRec() const { return fStrokeRec; }
 
 private:
-    void initPathEffect(sk_sp<SkPathEffect> pe);
+    void initPathEffect(SkPathEffect* pe);
 
     struct DashInfo {
         DashInfo& operator=(const DashInfo& that) {