From 46f2d0ad0d0e4f4cf0e7d6f158b3fb9fe4f615fa Mon Sep 17 00:00:00 2001 From: reed Date: Sun, 11 Sep 2016 05:40:31 -0700 Subject: [PATCH] use expected name for setDrawLooper/getDrawLooper Needed for future pipe cl. Next cl should be to guard the looper entirely (since its deprecated) BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2326173002 TBR= Review-Url: https://codereview.chromium.org/2326173002 --- include/core/SkPaint.h | 9 ++++----- src/core/SkPaint.cpp | 15 ++++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index ea7eedd65f..e28d2fc92d 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -653,19 +653,18 @@ public: * Return the paint's SkDrawLooper (if any). Does not affect the looper's * reference count. */ - SkDrawLooper* getLooper() const { return fLooper.get(); } - + SkDrawLooper* getDrawLooper() const { return fDrawLooper.get(); } + SkDrawLooper* getLooper() const { return fDrawLooper.get(); } /** * Set or clear the looper object. *

* Pass NULL to clear any previous looper. - * As a convenience, the parameter passed is also returned. * If a previous looper exists in the paint, its reference count is * decremented. If looper is not NULL, its reference count is * incremented. * @param looper May be NULL. The new looper to be installed in the paint. - * @return looper */ + void setDrawLooper(sk_sp); #ifdef SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR SkDrawLooper* setLooper(SkDrawLooper* looper); #endif @@ -1095,7 +1094,7 @@ private: sk_sp fMaskFilter; sk_sp fColorFilter; sk_sp fRasterizer; - sk_sp fLooper; + sk_sp fDrawLooper; sk_sp fImageFilter; SkScalar fTextSize; diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 58d6a0f95c..42b1a532de 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -73,7 +73,7 @@ SkPaint::SkPaint(const SkPaint& src) , COPY(fMaskFilter) , COPY(fColorFilter) , COPY(fRasterizer) - , COPY(fLooper) + , COPY(fDrawLooper) , COPY(fImageFilter) , COPY(fTextSize) , COPY(fTextScaleX) @@ -94,7 +94,7 @@ SkPaint::SkPaint(SkPaint&& src) { MOVE(fMaskFilter); MOVE(fColorFilter); MOVE(fRasterizer); - MOVE(fLooper); + MOVE(fDrawLooper); MOVE(fImageFilter); MOVE(fTextSize); MOVE(fTextScaleX); @@ -121,7 +121,7 @@ SkPaint& SkPaint::operator=(const SkPaint& src) { ASSIGN(fMaskFilter); ASSIGN(fColorFilter); ASSIGN(fRasterizer); - ASSIGN(fLooper); + ASSIGN(fDrawLooper); ASSIGN(fImageFilter); ASSIGN(fTextSize); ASSIGN(fTextScaleX); @@ -148,7 +148,7 @@ SkPaint& SkPaint::operator=(SkPaint&& src) { MOVE(fMaskFilter); MOVE(fColorFilter); MOVE(fRasterizer); - MOVE(fLooper); + MOVE(fDrawLooper); MOVE(fImageFilter); MOVE(fTextSize); MOVE(fTextScaleX); @@ -171,7 +171,7 @@ bool operator==(const SkPaint& a, const SkPaint& b) { && EQUAL(fMaskFilter) && EQUAL(fColorFilter) && EQUAL(fRasterizer) - && EQUAL(fLooper) + && EQUAL(fDrawLooper) && EQUAL(fImageFilter) && EQUAL(fTextSize) && EQUAL(fTextScaleX) @@ -363,8 +363,9 @@ MOVE_FIELD(ColorFilter) MOVE_FIELD(Xfermode) MOVE_FIELD(PathEffect) MOVE_FIELD(MaskFilter) +MOVE_FIELD(DrawLooper) #undef MOVE_FIELD -void SkPaint::setLooper(sk_sp looper) { fLooper = std::move(looper); } +void SkPaint::setLooper(sk_sp looper) { fDrawLooper = std::move(looper); } #define SET_PTR(Field) \ Sk##Field* SkPaint::set##Field(Sk##Field* f) { \ @@ -2359,7 +2360,7 @@ static bool affects_alpha(const SkImageFilter* imf) { } bool SkPaint::nothingToDraw() const { - if (fLooper) { + if (fDrawLooper) { return false; } SkXfermode::Mode mode;