Avoid initializing SkStrokeRect twice in GrStyle copy constructor.

Change-Id: If4c9c7b8fe0b9aa4b8b3b904c5ccf7ba014dd67b
Reviewed-on: https://skia-review.googlesource.com/90381
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2018-01-02 15:54:42 -05:00 committed by Skia Commit-Bot
parent c89ac122ef
commit 20aaaeebc1

View File

@ -81,7 +81,7 @@ public:
this->initPathEffect(std::move(pe));
}
GrStyle(const GrStyle& that) : fStrokeRec(SkStrokeRec::kFill_InitStyle) { *this = that; }
GrStyle(const GrStyle& that) = default;
explicit GrStyle(const SkPaint& paint) : fStrokeRec(paint) {
this->initPathEffect(paint.refPathEffect());
@ -187,6 +187,7 @@ private:
struct DashInfo {
DashInfo() : fType(SkPathEffect::kNone_DashType) {}
DashInfo(const DashInfo& that) { *this = that; }
DashInfo& operator=(const DashInfo& that) {
fType = that.fType;
fPhase = that.fPhase;