diff --git a/bench/BlurRoundRectBench.cpp b/bench/BlurRoundRectBench.cpp index 5b7bcd8b1e..085a8eb0e6 100644 --- a/bench/BlurRoundRectBench.cpp +++ b/bench/BlurRoundRectBench.cpp @@ -62,9 +62,7 @@ public: dullPaint.setAntiAlias(true); SkPaint loopedPaint; -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER loopedPaint.setLooper(looperBuilder.detach()); -#endif loopedPaint.setAntiAlias(true); loopedPaint.setColor(SK_ColorCYAN); diff --git a/bench/RectoriBench.cpp b/bench/RectoriBench.cpp index 990a8a90ab..c0d21552f9 100644 --- a/bench/RectoriBench.cpp +++ b/bench/RectoriBench.cpp @@ -52,9 +52,7 @@ protected: SkScalar translate = 2.0f * size; SkPaint paint; -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint.setLooper(this->createLooper(-translate, blurSigma)); -#endif paint.setColor(0xff000000 | Random.nextU()); paint.setAntiAlias(true); diff --git a/gm/blurroundrect.cpp b/gm/blurroundrect.cpp index 411663828e..b7d0800a86 100644 --- a/gm/blurroundrect.cpp +++ b/gm/blurroundrect.cpp @@ -69,9 +69,7 @@ public: SkPaint paint; canvas->drawRect(fRRect.rect(), paint); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint.setLooper(looperBuilder.detach()); -#endif paint.setColor(SK_ColorCYAN); paint.setAntiAlias(true); diff --git a/gm/circles.cpp b/gm/circles.cpp index 0c874691ff..9127c0a8fe 100644 --- a/gm/circles.cpp +++ b/gm/circles.cpp @@ -70,7 +70,6 @@ protected: fPaints.push_back(p); } -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER { // AA with blur SkPaint p; @@ -80,7 +79,6 @@ protected: SkIntToScalar(5), SkIntToScalar(10))); fPaints.push_back(p); } -#endif { // AA with stroke style diff --git a/gm/drawlooper.cpp b/gm/drawlooper.cpp index 017ec26b90..a9fe09f32e 100644 --- a/gm/drawlooper.cpp +++ b/gm/drawlooper.cpp @@ -37,9 +37,7 @@ protected: SkPaint paint; paint.setAntiAlias(true); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint.setLooper(fLooper); -#endif SkFont font(sk_tool_utils::create_portable_typeface(), 72); diff --git a/gm/megalooper.cpp b/gm/megalooper.cpp index 16c07ae948..e2e53e75fa 100644 --- a/gm/megalooper.cpp +++ b/gm/megalooper.cpp @@ -130,9 +130,7 @@ private: for (int i = 0; i < 4; ++i) { SkPaint loopPaint; -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER loopPaint.setLooper(create1Looper(-kOffsetToOutsideClip, 0, gColors[i])); -#endif loopPaint.setAntiAlias(true); SkRect outerClip = { @@ -193,9 +191,7 @@ private: SkPaint paint; paint.setAntiAlias(true); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint.setLooper(create4Looper(-kOffsetToOutsideClip-kHalfSquareSize, 0)); -#endif canvas->save(); canvas->clipRect(outerClip, kIntersect_SkClipOp); diff --git a/gm/rects.cpp b/gm/rects.cpp index 1da6878954..2786be74ad 100644 --- a/gm/rects.cpp +++ b/gm/rects.cpp @@ -85,7 +85,6 @@ protected: fPaints.push_back(p); } -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER { // AA with blur SkPaint p; @@ -96,7 +95,6 @@ protected: SkIntToScalar(5), SkIntToScalar(10))); fPaints.push_back(p); } -#endif { // AA with stroke style diff --git a/gm/shadows.cpp b/gm/shadows.cpp index e0a2d0167d..1160e498f9 100644 --- a/gm/shadows.cpp +++ b/gm/shadows.cpp @@ -88,9 +88,7 @@ protected: for (size_t i = 0; i < SK_ARRAY_COUNT(shadowLoopers); ++i) { SkAutoCanvasRestore acr(canvas, true); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint.setLooper(shadowLoopers[i]); -#endif canvas->translate(SkIntToScalar((unsigned int)i*40), SkIntToScalar(0)); setup(&paint, gRec[0].fColor, gRec[0].fStrokeWidth); diff --git a/gm/textbloblooper.cpp b/gm/textbloblooper.cpp index b2764fa708..51e815524f 100644 --- a/gm/textbloblooper.cpp +++ b/gm/textbloblooper.cpp @@ -230,9 +230,7 @@ protected: int y = 0; for (int looper = 0; looper < fLoopers.count(); looper++) { -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint.setLooper(fLoopers[looper]); -#endif canvas->save(); canvas->translate(0, SkIntToScalar(y)); canvas->drawTextBlob(fBlob, 0, 0, paint); diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index babed4ba2e..3d6a93890c 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -561,7 +561,6 @@ public: */ SkDrawLooper* getLooper() const { return fDrawLooper.get(); } -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER /** Sets SkDrawLooper to drawLooper, decreasing SkRefCnt of the previous drawLooper. Pass nullptr to clear SkDrawLooper and leave SkDrawLooper effect on drawing unaltered. @@ -576,7 +575,6 @@ public: (see skbug.com/6259) */ void setLooper(sk_sp drawLooper); -#endif /** Returns true if SkPaint prevents all drawing; otherwise, the SkPaint may or may not allow drawing. diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp index 21d3cb6208..14e40c4529 100644 --- a/samplecode/SampleTiling.cpp +++ b/samplecode/SampleTiling.cpp @@ -107,9 +107,7 @@ protected: SkPaint p; SkString str; p.setDither(true); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER p.setLooper(fLooper); -#endif str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]); SkTextUtils::DrawString(textCanvas, str.c_str(), x + r.width()/2, y, SkFont(), p, @@ -141,9 +139,7 @@ protected: } if (textCanvas) { SkPaint p; -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER p.setLooper(fLooper); -#endif textCanvas->drawString( SkStringPrintf("%s, %s", gConfigNames[i], gFilterNames[j]), x, y + r.height() * 2 / 3, SkFont(), p); diff --git a/samplecode/SampleUnpremul.cpp b/samplecode/SampleUnpremul.cpp index e2b34da5e4..da7e42dbbe 100644 --- a/samplecode/SampleUnpremul.cpp +++ b/samplecode/SampleUnpremul.cpp @@ -81,9 +81,7 @@ protected: auto looper( SkBlurDrawLooper::Make(SK_ColorBLUE, SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(2)), 0, 0)); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint.setLooper(looper); -#endif SkScalar height = font.getMetrics(nullptr); if (!fDecodeSucceeded) { SkString failure; diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 12f0ea3c45..bf9b690854 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -472,10 +472,8 @@ bool AutoDrawLooper::doNext() { SkPaint* paint = fLazyPaintPerLooper.set(fLazyPaintInit.isValid() ? *fLazyPaintInit.get() : fOrigPaint); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER // never want our downstream clients (i.e. devices) to see loopers paint->setDrawLooper(nullptr); -#endif if (fTempLayerForImageFilter) { paint->setImageFilter(nullptr); diff --git a/src/core/SkColorSpaceXformer.cpp b/src/core/SkColorSpaceXformer.cpp index d31b0c5e3a..09f399cfa5 100644 --- a/src/core/SkColorSpaceXformer.cpp +++ b/src/core/SkColorSpaceXformer.cpp @@ -169,11 +169,9 @@ SkPaint SkColorSpaceXformer::apply(const SkPaint& src) { dst.setColorFilter(this->apply(cf)); } -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER if (auto looper = src.getDrawLooper()) { dst.setDrawLooper(looper->makeColorSpace(this)); } -#endif if (auto imageFilter = src.getImageFilter()) { dst.setImageFilter(this->apply(imageFilter)); diff --git a/src/core/SkDrawLooper.cpp b/src/core/SkDrawLooper.cpp index 8b1a3b59f5..db6bd5433a 100644 --- a/src/core/SkDrawLooper.cpp +++ b/src/core/SkDrawLooper.cpp @@ -20,9 +20,7 @@ bool SkDrawLooper::canComputeFastBounds(const SkPaint& paint) const { for (;;) { SkPaint p(paint); if (context->next(&canvas, &p)) { -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER p.setLooper(nullptr); -#endif if (!p.canComputeFastBounds()) { return false; } @@ -49,9 +47,7 @@ void SkDrawLooper::computeFastBounds(const SkPaint& paint, const SkRect& s, if (context->next(&canvas, &p)) { SkRect r(src); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER p.setLooper(nullptr); -#endif p.computeFastBounds(r, &r); canvas.getTotalMatrix().mapRect(&r); diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 85dc6ca5fe..150fcceefa 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -243,14 +243,9 @@ MOVE_FIELD(Shader) MOVE_FIELD(ColorFilter) MOVE_FIELD(PathEffect) MOVE_FIELD(MaskFilter) -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER MOVE_FIELD(DrawLooper) -#endif #undef MOVE_FIELD - -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER void SkPaint::setLooper(sk_sp looper) { fDrawLooper = std::move(looper); } -#endif /////////////////////////////////////////////////////////////////////////////// @@ -454,20 +449,14 @@ SkReadPaintResult SkPaintPriv::Unflatten_PreV68(SkPaint* paint, SkReadBuffer& bu paint->setMaskFilter(buffer.readMaskFilter()); paint->setColorFilter(buffer.readColorFilter()); (void)buffer.read32(); // use to be SkRasterizer -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint->setLooper(buffer.readDrawLooper()); -#else - (void)buffer.readDrawLooper(); -#endif paint->setImageFilter(buffer.readImageFilter()); } else { paint->setPathEffect(nullptr); paint->setShader(nullptr); paint->setMaskFilter(nullptr); paint->setColorFilter(nullptr); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint->setLooper(nullptr); -#endif paint->setImageFilter(nullptr); } @@ -500,20 +489,14 @@ SkReadPaintResult SkPaintPriv::Unflatten(SkPaint* paint, SkReadBuffer& buffer, S paint->setShader(buffer.readShader()); paint->setMaskFilter(buffer.readMaskFilter()); paint->setColorFilter(buffer.readColorFilter()); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint->setLooper(buffer.readDrawLooper()); -#else - (void)buffer.readDrawLooper(); -#endif paint->setImageFilter(buffer.readImageFilter()); } else { paint->setPathEffect(nullptr); paint->setShader(nullptr); paint->setMaskFilter(nullptr); paint->setColorFilter(nullptr); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint->setLooper(nullptr); -#endif paint->setImageFilter(nullptr); } diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp index 20187ec91e..762cf1f7c2 100644 --- a/tests/PaintTest.cpp +++ b/tests/PaintTest.cpp @@ -135,9 +135,7 @@ DEF_TEST(Paint_copy, reporter) { paint.setStrokeWidth(SkIntToScalar(2)); // set a few pointers SkLayerDrawLooper::Builder looperBuilder; -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint.setLooper(looperBuilder.detach()); -#endif paint.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, SkBlurMask::ConvertRadiusToSigma(1))); @@ -265,9 +263,7 @@ DEF_TEST(Paint_MoreFlattening, r) { SkPaint paint; paint.setColor(0x00AABBCC); paint.setBlendMode(SkBlendMode::kModulate); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER paint.setLooper(nullptr); // Default value, ignored. -#endif SkBinaryWriteBuffer writer; SkPaintPriv::Flatten(paint, writer); diff --git a/tests/QuickRejectTest.cpp b/tests/QuickRejectTest.cpp index 02752bf086..4bffe1356b 100644 --- a/tests/QuickRejectTest.cpp +++ b/tests/QuickRejectTest.cpp @@ -80,7 +80,6 @@ static void test_drawBitmap(skiatest::Reporter* reporter) { canvas.drawBitmap(src, SkIntToScalar(-10), 0, &paint); REPORTER_ASSERT(reporter, 0 == *dst.getAddr32(5, 5)); -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER // now install our looper, which will draw, since it internally translates // to the left. The test is to ensure that canvas' quickReject machinary // allows us through, even though sans-looper we would look like we should @@ -88,7 +87,6 @@ static void test_drawBitmap(skiatest::Reporter* reporter) { paint.setLooper(sk_make_sp()); canvas.drawBitmap(src, SkIntToScalar(-10), 0, &paint); REPORTER_ASSERT(reporter, 0xFFFFFFFF == *dst.getAddr32(5, 5)); -#endif } static void test_layers(skiatest::Reporter* reporter) { @@ -173,7 +171,6 @@ DEF_TEST(QuickReject_MatrixState, reporter) { canvas.quickReject(SkRect::MakeWH(100.0f, 100.0f)); } -#ifdef SK_SUPPORT_LEGACY_DRAWLOOPER #include "SkLayerDrawLooper.h" #include "SkSurface.h" DEF_TEST(looper_nothingtodraw, reporter) { @@ -199,4 +196,3 @@ DEF_TEST(looper_nothingtodraw, reporter) { // See https://skia-review.googlesource.com/c/skia/+/121220 surf->getCanvas()->drawRect({1, 1, 10, 10}, paint); } -#endif