diff --git a/fuzz/FuzzCanvas.cpp b/fuzz/FuzzCanvas.cpp index eed7455ee6..3507eb267b 100644 --- a/fuzz/FuzzCanvas.cpp +++ b/fuzz/FuzzCanvas.cpp @@ -830,7 +830,6 @@ static void fuzz_paint(Fuzz* fuzz, SkPaint* paint, int depth) { paint->setDither( make_fuzz_t(fuzz)); paint->setColor( make_fuzz_t(fuzz)); paint->setBlendMode( make_fuzz_enum_range(fuzz, SkBlendMode::kLastMode)); - SkPaintPriv::SetFQ(paint, make_fuzz_enum_range(fuzz, kLast_SkFilterQuality)); paint->setStyle( make_fuzz_enum_range(fuzz, SkPaint::Style::kStrokeAndFill_Style)); paint->setShader( make_fuzz_shader(fuzz, depth - 1)); diff --git a/fuzz/FuzzDrawFunctions.cpp b/fuzz/FuzzDrawFunctions.cpp index 909ff30087..f35745f1c7 100644 --- a/fuzz/FuzzDrawFunctions.cpp +++ b/fuzz/FuzzDrawFunctions.cpp @@ -47,9 +47,6 @@ static void init_paint(Fuzz* fuzz, SkPaint* p) { fuzz->next(&b); p->setDither(b); - fuzz->nextRange(&tmp_u8, 0, (int)kHigh_SkFilterQuality); - SkPaintPriv::SetFQ(p, static_cast(tmp_u8)); - fuzz->nextRange(&tmp_u8, 0, (int)SkPaint::kLast_Cap); p->setStrokeCap(static_cast(tmp_u8)); diff --git a/modules/particles/src/SkParticleEffect.cpp b/modules/particles/src/SkParticleEffect.cpp index d80a709e5a..b05c17d17c 100644 --- a/modules/particles/src/SkParticleEffect.cpp +++ b/modules/particles/src/SkParticleEffect.cpp @@ -485,7 +485,7 @@ void SkParticleEffect::update(double now) { void SkParticleEffect::draw(SkCanvas* canvas) { if (this->isAlive() && fParams->fDrawable) { SkPaint paint; - SkPaintPriv::SetFQ(&paint, SkFilterQuality::kMedium_SkFilterQuality); + paint.setFilterQuality(SkFilterQuality::kMedium_SkFilterQuality); fParams->fDrawable->draw(canvas, fParticles, fCount, paint); } } diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index cd72d46bd1..ff134a1971 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -8,7 +8,6 @@ #include "include/core/SkBitmap.h" #include "include/core/SkData.h" -#include "include/core/SkFilterQuality.h" #include "include/core/SkMallocPixelRef.h" #include "include/core/SkMath.h" #include "include/core/SkPixelRef.h" diff --git a/src/core/SkMatrixPriv.h b/src/core/SkMatrixPriv.h index b93833a728..347b37e30d 100644 --- a/src/core/SkMatrixPriv.h +++ b/src/core/SkMatrixPriv.h @@ -8,7 +8,6 @@ #ifndef SkMatrixPriv_DEFINE #define SkMatrixPriv_DEFINE -#include "include/core/SkFilterQuality.h" #include "include/core/SkM44.h" #include "include/core/SkMatrix.h" #include "include/private/SkNx.h" diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index f7cf48463c..1ac6fa7e58 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -235,7 +235,7 @@ static uint32_t pack_v68(const SkPaint& paint, unsigned flatFlags) { packed |= shift_bits(paint.getStrokeCap(), 16, 2); packed |= shift_bits(paint.getStrokeJoin(), 18, 2); packed |= shift_bits(paint.getStyle(), 20, 2); - packed |= shift_bits(SkPaintPriv::GetFQ(paint), 22, 2); + packed |= shift_bits(paint.getFilterQuality(), 22, 2); packed |= shift_bits(flatFlags, 24, 8); return packed; } diff --git a/src/core/SkPaintPriv.h b/src/core/SkPaintPriv.h index a06540d743..443e29a5bc 100644 --- a/src/core/SkPaintPriv.h +++ b/src/core/SkPaintPriv.h @@ -73,9 +73,6 @@ public: // Since we may be filtering now, we need to know what color space to filter in, // typically the color space of the device we're drawing into. static void RemoveColorFilter(SkPaint*, SkColorSpace* dstCS); - - static SkFilterQuality GetFQ(const SkPaint& paint) { return paint.getFilterQuality(); } - static void SetFQ(SkPaint* paint, SkFilterQuality fq) { paint->setFilterQuality(fq); } }; #endif diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 6d463ded0e..6a7eefb841 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -226,7 +226,7 @@ static inline bool skpaint_to_grpaint_impl(GrRecordingContext* context, SkBlendMode* primColorMode, GrPaint* grPaint) { // TODO: take sampling directly - SkSamplingOptions sampling(SkPaintPriv::GetFQ(skPaint), + SkSamplingOptions sampling(skPaint.getFilterQuality(), SkSamplingOptions::kMedium_asMipmapLinear); // Convert SkPaint color to 4f format in the destination color space @@ -434,7 +434,7 @@ bool SkPaintToGrPaintWithTexture(GrRecordingContext* context, bool textureIsAlphaOnly, GrPaint* grPaint) { // TODO: take sampling directly - SkSamplingOptions sampling(SkPaintPriv::GetFQ(paint), + SkSamplingOptions sampling(paint.getFilterQuality(), SkSamplingOptions::kMedium_asMipmapLinear); std::unique_ptr shaderFP; diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp index e7f0e4d250..f6bcafdbc5 100644 --- a/src/image/SkSurface.cpp +++ b/src/image/SkSurface.cpp @@ -225,7 +225,7 @@ void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkSamplingO } void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) { - SkSamplingOptions sampling(paint ? SkPaintPriv::GetFQ(*paint) : kNone_SkFilterQuality); + SkSamplingOptions sampling(paint ? paint->getFilterQuality() : kNone_SkFilterQuality); this->draw(canvas, x, y, sampling, paint); } diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp index d18f549a0d..18a4055da8 100755 --- a/src/shaders/SkImageShader.cpp +++ b/src/shaders/SkImageShader.cpp @@ -233,9 +233,9 @@ SkShaderBase::Context* SkImageShader::onMakeContext(const ContextRec& rec, auto supported = [](const SkSamplingOptions& sampling) { const std::tuple supported[] = { - {SkFilterMode::kNearest, SkMipmapMode::kNone}, // legacy kNone_SkFilterQuality - {SkFilterMode::kLinear, SkMipmapMode::kNone}, // legacy kLow_SkFilterQuality - {SkFilterMode::kLinear, SkMipmapMode::kNearest}, // legacy kMedium_SkFilterQuality + {SkFilterMode::kNearest, SkMipmapMode::kNone}, // legacy None + {SkFilterMode::kLinear, SkMipmapMode::kNone}, // legacy Low + {SkFilterMode::kLinear, SkMipmapMode::kNearest}, // legacy Medium }; for (auto [f, m] : supported) { if (sampling.filter == f && sampling.mipmap == m) { @@ -590,16 +590,6 @@ bool SkImageShader::doStages(const SkStageRec& rec, SkImageStageUpdater* updater decal_ctx->limit_y = limit_y->scale; } -#if 0 // TODO: when we support kMedium - if (updator && (quality == kMedium_SkFilterQuality)) { - // if we change levels in mipmap, we need to update the scales (and invScales) - updator->fGather = gather; - updator->fLimitX = limit_x; - updator->fLimitY = limit_y; - updator->fDecal = decal_ctx; - } -#endif - auto append_tiling_and_gather = [&] { if (decal_x_and_y) { p->append(SkRasterPipeline::decal_x_and_y, decal_ctx); diff --git a/tests/CompressedBackendAllocationTest.cpp b/tests/CompressedBackendAllocationTest.cpp index 9fbe9963ad..03ec1d35b5 100644 --- a/tests/CompressedBackendAllocationTest.cpp +++ b/tests/CompressedBackendAllocationTest.cpp @@ -76,7 +76,7 @@ static void check_compressed_mipmaps(GrRecordingContext* rContext, sk_sp