diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h index e197664294..13fe6530c7 100644 --- a/include/core/SkImageFilter.h +++ b/include/core/SkImageFilter.h @@ -45,31 +45,22 @@ public: virtual void purgeByImageFilterId(uint32_t) {} }; - enum SizeConstraint { - kExact_SizeConstraint, - kApprox_SizeConstraint, - }; - class Context { public: - Context(const SkMatrix& ctm, const SkIRect& clipBounds, Cache* cache, - SizeConstraint constraint) + Context(const SkMatrix& ctm, const SkIRect& clipBounds, Cache* cache) : fCTM(ctm) , fClipBounds(clipBounds) , fCache(cache) - , fSizeConstraint(constraint) {} const SkMatrix& ctm() const { return fCTM; } const SkIRect& clipBounds() const { return fClipBounds; } Cache* cache() const { return fCache; } - SizeConstraint sizeConstraint() const { return fSizeConstraint; } private: SkMatrix fCTM; SkIRect fClipBounds; Cache* fCache; - SizeConstraint fSizeConstraint; }; class CropRect { @@ -373,7 +364,7 @@ protected: // calls filterImage() on that input, and returns true on success. // i.e., return !getInput(index) || getInput(index)->filterImage(...); bool filterInput(int index, Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset, bool relaxSizeConstraint = true) const; + SkBitmap* result, SkIPoint* offset) const; /** * Return true (and return a ref'd colorfilter) if this node in the DAG is just a diff --git a/include/gpu/GrTextureProvider.h b/include/gpu/GrTextureProvider.h index 46f381da81..338dddbaca 100644 --- a/include/gpu/GrTextureProvider.h +++ b/include/gpu/GrTextureProvider.h @@ -64,31 +64,6 @@ public: */ GrTexture* createApproxTexture(const GrSurfaceDesc&); - enum SizeConstraint { - kExact_SizeConstraint, - kApprox_SizeConstraint, - }; - - GrTexture* createTexture(const GrSurfaceDesc& desc, SizeConstraint constraint) { - switch (constraint) { - case kExact_SizeConstraint: - return this->createTexture(desc, true); - case kApprox_SizeConstraint: - return this->createApproxTexture(desc); - } - sk_throw(); - return nullptr; - } - - static SizeConstraint FromImageFilter(SkImageFilter::SizeConstraint constraint) { - if (SkImageFilter::kExact_SizeConstraint == constraint) { - return kExact_SizeConstraint; - } else { - SkASSERT(SkImageFilter::kApprox_SizeConstraint == constraint); - return kApprox_SizeConstraint; - } - } - /** Legacy function that no longer should be used. */ enum ScratchTexMatch { kExact_ScratchTexMatch, diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 8f28ea4b77..e577b21932 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1439,8 +1439,7 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y, SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x(), -pos.y()); #endif SkAutoTUnref cache(dstDev->getImageFilterCache()); - SkImageFilter::Context ctx(matrix, clipBounds, cache.get(), - SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) { SkPaint tmpUnfiltered(*paint); tmpUnfiltered.setImageFilter(nullptr); diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index cc2f318713..8ff5827ada 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -418,8 +418,7 @@ void SkBaseDevice::drawBitmapAsSprite(const SkDraw& draw, const SkBitmap& bitmap const SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y); #endif SkAutoTUnref cache(this->getImageFilterCache()); - SkImageFilter::Context ctx(matrix, clipBounds, cache.get(), - SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); if (filter->filterImage(&proxy, bitmap, ctx, &dst, &offset)) { SkPaint tmpUnfiltered(paint); tmpUnfiltered.setImageFilter(nullptr); diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index 7518501aa5..e64cf7200a 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -265,25 +265,16 @@ bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src, } bool SkImageFilter::filterInput(int index, Proxy* proxy, const SkBitmap& src, - const Context& origCtx, - SkBitmap* result, SkIPoint* offset, - bool relaxSizeConstraint) const { + const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { SkImageFilter* input = this->getInput(index); if (!input) { return true; } - - SizeConstraint constraint = origCtx.sizeConstraint(); - if (relaxSizeConstraint && (kExact_SizeConstraint == constraint)) { - constraint = kApprox_SizeConstraint; - } - Context ctx(origCtx.ctm(), origCtx.clipBounds(), origCtx.cache(), constraint); - return input->filterImage(proxy, src, this->mapContext(ctx), result, offset); } -bool SkImageFilter::filterBounds(const SkIRect& src, const SkMatrix& ctm, - SkIRect* dst) const { +bool SkImageFilter::filterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst) const { SkASSERT(dst); return this->onFilterBounds(src, ctm, dst); } @@ -353,8 +344,7 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont desc.fHeight = bounds.height(); desc.fConfig = kRGBA_8888_GrPixelConfig; - SkAutoTUnref dst(context->textureProvider()->createTexture(desc, - GrTextureProvider::FromImageFilter(ctx.sizeConstraint()))); + SkAutoTUnref dst(context->textureProvider()->createApproxTexture(desc)); if (!dst) { return false; } @@ -488,7 +478,7 @@ SkImageFilter::Context SkImageFilter::mapContext(const Context& ctx) const { SkIRect clipBounds; this->onFilterNodeBounds(ctx.clipBounds(), ctx.ctm(), &clipBounds, MapDirection::kReverse_MapDirection); - return Context(ctx.ctm(), clipBounds, ctx.cache(), ctx.sizeConstraint()); + return Context(ctx.ctm(), clipBounds, ctx.cache()); #endif } @@ -519,7 +509,7 @@ void SkImageFilter::WrapTexture(GrTexture* texture, int width, int height, SkBit } bool SkImageFilter::filterInputGPU(int index, SkImageFilter::Proxy* proxy, - const SkBitmap& src, const Context& origCtx, + const SkBitmap& src, const Context& ctx, SkBitmap* result, SkIPoint* offset) const { SkImageFilter* input = this->getInput(index); if (!input) { @@ -529,9 +519,6 @@ bool SkImageFilter::filterInputGPU(int index, SkImageFilter::Proxy* proxy, // matrix with no clip and that the matrix, clip, and render target set before this function was // called are restored before we return to the caller. GrContext* context = src.getTexture()->getContext(); - - Context ctx(origCtx.ctm(), origCtx.clipBounds(), origCtx.cache(), kApprox_SizeConstraint); - if (input->filterImage(proxy, src, this->mapContext(ctx), result, offset)) { if (!result->getTexture()) { const SkImageInfo info = result->info(); diff --git a/src/core/SkLocalMatrixImageFilter.cpp b/src/core/SkLocalMatrixImageFilter.cpp index e4fc0ceb00..10d63ede66 100644 --- a/src/core/SkLocalMatrixImageFilter.cpp +++ b/src/core/SkLocalMatrixImageFilter.cpp @@ -40,9 +40,8 @@ void SkLocalMatrixImageFilter::flatten(SkWriteBuffer& buffer) const { bool SkLocalMatrixImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx, SkBitmap* result, SkIPoint* offset) const { - Context localCtx(SkMatrix::Concat(ctx.ctm(), fLocalM), ctx.clipBounds(), ctx.cache(), - ctx.sizeConstraint()); - return this->filterInput(0, proxy, src, localCtx, result, offset, false); + Context localCtx(SkMatrix::Concat(ctx.ctm(), fLocalM), ctx.clipBounds(), ctx.cache()); + return this->filterInput(0, proxy, src, localCtx, result, offset); } bool SkLocalMatrixImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& matrix, diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index 752749b873..97cc8a9544 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -217,15 +217,13 @@ bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const srcBounds.offset(-srcOffset); dstBounds.offset(-srcOffset); SkRect srcBoundsF(SkRect::Make(srcBounds)); - auto constraint = GrTextureProvider::FromImageFilter(ctx.sizeConstraint()); SkAutoTUnref tex(SkGpuBlurUtils::GaussianBlur(source->getContext(), source, false, SkRect::Make(dstBounds), &srcBoundsF, sigma.x(), - sigma.y(), - constraint)); + sigma.y())); if (!tex) { return false; } diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp index a4dd70270b..ca448bc2d0 100644 --- a/src/effects/SkBlurMaskFilter.cpp +++ b/src/effects/SkBlurMaskFilter.cpp @@ -1241,8 +1241,7 @@ bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src, // gaussianBlur. Otherwise, we need to save it for later compositing. bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle); *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOverwriteSrc, - clipRect, nullptr, xformedSigma, xformedSigma, - GrTextureProvider::kApprox_SizeConstraint); + clipRect, nullptr, xformedSigma, xformedSigma); if (nullptr == *result) { return false; } diff --git a/src/effects/SkComposeImageFilter.cpp b/src/effects/SkComposeImageFilter.cpp index 59159551cc..a922d30d1e 100644 --- a/src/effects/SkComposeImageFilter.cpp +++ b/src/effects/SkComposeImageFilter.cpp @@ -37,8 +37,8 @@ bool SkComposeImageFilter::onFilterImage(Proxy* proxy, outerMatrix.postTranslate(SkIntToScalar(-innerOffset.x()), SkIntToScalar(-innerOffset.y())); SkIRect clipBounds = ctx.clipBounds(); clipBounds.offset(-innerOffset.x(), -innerOffset.y()); - Context outerContext(outerMatrix, clipBounds, ctx.cache(), ctx.sizeConstraint()); - if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset, false)) { + Context outerContext(outerMatrix, clipBounds, ctx.cache()); + if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset)) { return false; } diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 2b35036bc5..c50b1f2c18 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -428,8 +428,7 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src, desc.fHeight = bounds.height(); desc.fConfig = kSkia8888_GrPixelConfig; - auto constraint = GrTextureProvider::FromImageFilter(ctx.sizeConstraint()); - SkAutoTUnref dst(context->textureProvider()->createTexture(desc, constraint)); + SkAutoTUnref dst(context->textureProvider()->createApproxTexture(desc)); if (!dst) { return false; diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp index 13b6b0a3bc..77a8501877 100644 --- a/src/effects/SkGpuBlurUtils.cpp +++ b/src/effects/SkGpuBlurUtils.cpp @@ -167,8 +167,7 @@ GrTexture* GaussianBlur(GrContext* context, const SkRect& dstBounds, const SkRect* srcBounds, float sigmaX, - float sigmaY, - GrTextureProvider::SizeConstraint constraint) { + float sigmaY) { SkASSERT(context); SkIRect clearRect; int scaleFactorX, radiusX; @@ -211,12 +210,12 @@ GrTexture* GaussianBlur(GrContext* context, GrTexture* tempTexture; SkAutoTUnref temp1, temp2; - temp1.reset(context->textureProvider()->createTexture(desc, constraint)); + temp1.reset(context->textureProvider()->createApproxTexture(desc)); dstTexture = temp1.get(); if (canClobberSrc) { tempTexture = srcTexture; } else { - temp2.reset(context->textureProvider()->createTexture(desc, constraint)); + temp2.reset(context->textureProvider()->createApproxTexture(desc)); tempTexture = temp2.get(); } diff --git a/src/effects/SkGpuBlurUtils.h b/src/effects/SkGpuBlurUtils.h index 84e3252cc2..013d11b517 100644 --- a/src/effects/SkGpuBlurUtils.h +++ b/src/effects/SkGpuBlurUtils.h @@ -40,8 +40,7 @@ namespace SkGpuBlurUtils { const SkRect& dstBounds, const SkRect* srcBounds, float sigmaX, - float sigmaY, - GrTextureProvider::SizeConstraint); + float sigmaY); #endif }; diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index ac7488be6b..6c2ec72c22 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -383,8 +383,7 @@ bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy, desc.fHeight = bounds.height(); desc.fConfig = kRGBA_8888_GrPixelConfig; - auto constraint = GrTextureProvider::FromImageFilter(ctx.sizeConstraint()); - SkAutoTUnref dst(context->textureProvider()->createTexture(desc, constraint)); + SkAutoTUnref dst(context->textureProvider()->createApproxTexture(desc)); if (!dst) { return false; } diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 205fc0d1eb..895000e86e 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -548,8 +548,7 @@ bool apply_morphology(const SkBitmap& input, const SkIRect& rect, GrMorphologyEffect::MorphologyType morphType, SkISize radius, - SkBitmap* dst, - GrTextureProvider::SizeConstraint constraint) { + SkBitmap* dst) { SkAutoTUnref srcTexture(SkRef(input.getTexture())); SkASSERT(srcTexture); GrContext* context = srcTexture->getContext(); @@ -567,14 +566,7 @@ bool apply_morphology(const SkBitmap& input, SkIRect srcRect = rect; if (radius.fWidth > 0) { - GrTextureProvider::SizeConstraint horiConstraint = constraint; - if (radius.fHeight > 0) { - // Optimization: we will fall through and allocate the "real" texture after this one - // so ours can be approximate (likely faster to allocate) - horiConstraint = GrTextureProvider::kApprox_SizeConstraint; - } - - GrTexture* scratch = context->textureProvider()->createTexture(desc, horiConstraint); + GrTexture* scratch = context->textureProvider()->createApproxTexture(desc); if (nullptr == scratch) { return false; } @@ -598,7 +590,7 @@ bool apply_morphology(const SkBitmap& input, srcRect = dstRect; } if (radius.fHeight > 0) { - GrTexture* scratch = context->textureProvider()->createTexture(desc, constraint); + GrTexture* scratch = context->textureProvider()->createApproxTexture(desc); if (nullptr == scratch) { return false; } @@ -656,8 +648,7 @@ bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate, GrMorphologyEffect::MorphologyType type = dilate ? GrMorphologyEffect::kDilate_MorphologyType : GrMorphologyEffect::kErode_MorphologyType; - if (!apply_morphology(input, srcBounds, type, SkISize::Make(width, height), result, - GrTextureProvider::FromImageFilter(ctx.sizeConstraint()))) { + if (!apply_morphology(input, srcBounds, type, SkISize::Make(width, height), result)) { return false; } offset->fX = bounds.left(); diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp index 38d1e5e6b4..3ff6c491b5 100644 --- a/src/effects/SkXfermodeImageFilter.cpp +++ b/src/effects/SkXfermodeImageFilter.cpp @@ -155,8 +155,7 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, desc.fWidth = src.width(); desc.fHeight = src.height(); desc.fConfig = kSkia8888_GrPixelConfig; - auto constraint = GrTextureProvider::FromImageFilter(ctx.sizeConstraint()); - SkAutoTUnref dst(context->textureProvider()->createTexture(desc, constraint)); + SkAutoTUnref dst(context->textureProvider()->createApproxTexture(desc)); if (!dst) { return false; } diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp index 004e4d0e6e..2c45a7f9e5 100644 --- a/src/gpu/GrLayerHoister.cpp +++ b/src/gpu/GrLayerHoister.cpp @@ -311,7 +311,7 @@ void GrLayerHoister::FilterLayer(GrContext* context, // This cache is transient, and is freed (along with all its contained // textures) when it goes out of scope. SkAutoTUnref cache(SkImageFilter::Cache::Create(kDefaultCacheSize)); - SkImageFilter::Context filterContext(totMat, clipBounds, cache, SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context filterContext(totMat, clipBounds, cache); SkImageFilter::DeviceProxy proxy(device); const SkBitmap src = wrap_texture(layer->texture()); diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 7c77dedecb..40da40aca4 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1157,7 +1157,7 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap, SkAutoTUnref cache(getImageFilterCache()); // This cache is transient, and is freed (along with all its contained // textures) when it goes out of scope. - SkImageFilter::Context ctx(matrix, clipBounds, cache, SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context ctx(matrix, clipBounds, cache); if (this->filterTexture(fContext, texture, w, h, filter, ctx, &filteredBitmap, &offset)) { texture = (GrTexture*) filteredBitmap.getTexture(); @@ -1323,7 +1323,7 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, // This cache is transient, and is freed (along with all its contained // textures) when it goes out of scope. SkAutoTUnref cache(getImageFilterCache()); - SkImageFilter::Context ctx(matrix, clipBounds, cache, SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context ctx(matrix, clipBounds, cache); if (this->filterTexture(fContext, devTex, device->width(), device->height(), filter, ctx, &filteredBitmap, &offset)) { devTex = filteredBitmap.getTexture(); diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index c6991cd052..c9ef55944d 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -319,7 +319,7 @@ static void test_crop_rects(SkImageFilter::Proxy* proxy, skiatest::Reporter* rep SkIPoint offset; SkString str; str.printf("filter %d", static_cast(i)); - SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr, SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr); REPORTER_ASSERT_MESSAGE(reporter, filter->filterImage(proxy, bitmap, ctx, &result, &offset), str.c_str()); REPORTER_ASSERT_MESSAGE(reporter, offset.fX == 20 && offset.fY == 30, str.c_str()); @@ -364,12 +364,12 @@ static void test_negative_blur_sigma(SkImageFilter::Proxy* proxy, skiatest::Repo SkBitmap positiveResult1, negativeResult1; SkBitmap positiveResult2, negativeResult2; SkIPoint offset; - SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(32, 32), nullptr, SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(32, 32), nullptr); REPORTER_ASSERT(reporter, positiveFilter->filterImage(proxy, gradient, ctx, &positiveResult1, &offset)); REPORTER_ASSERT(reporter, negativeFilter->filterImage(proxy, gradient, ctx, &negativeResult1, &offset)); SkMatrix negativeScale; negativeScale.setScale(-SK_Scalar1, SK_Scalar1); - SkImageFilter::Context negativeCTX(negativeScale, SkIRect::MakeWH(32, 32), nullptr, SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context negativeCTX(negativeScale, SkIRect::MakeWH(32, 32), nullptr); REPORTER_ASSERT(reporter, positiveFilter->filterImage(proxy, gradient, negativeCTX, &negativeResult2, &offset)); REPORTER_ASSERT(reporter, negativeFilter->filterImage(proxy, gradient, negativeCTX, &positiveResult2, &offset)); SkAutoLockPixels lockP1(positiveResult1); @@ -658,8 +658,7 @@ DEF_TEST(ImageFilterMergeResultSize, reporter) { const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); SkAutoTUnref device(SkBitmapDevice::Create(info, props)); SkImageFilter::DeviceProxy proxy(device); - SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeXYWH(0, 0, 100, 100), nullptr, - SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeXYWH(0, 0, 100, 100), nullptr); SkBitmap result; SkIPoint offset; REPORTER_ASSERT(reporter, merge->filterImage(&proxy, bitmap, ctx, &result, &offset)); @@ -906,7 +905,7 @@ DEF_TEST(ImageFilterClippedPictureImageFilter, reporter) { SkBitmap result; SkIPoint offset; - SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeXYWH(1, 1, 1, 1), nullptr, SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeXYWH(1, 1, 1, 1), nullptr); SkBitmap bitmap; bitmap.allocN32Pixels(2, 2); const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); @@ -1159,7 +1158,7 @@ DEF_TEST(ComposedImageFilterOffset, reporter) { offsetFilter.get())); SkBitmap result; SkIPoint offset; - SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr, SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr); REPORTER_ASSERT(reporter, composedFilter->filterImage(&proxy, bitmap, ctx, &result, &offset)); REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); } @@ -1177,7 +1176,7 @@ DEF_TEST(PartialCropRect, reporter) { SkAutoTUnref filter(make_grayscale(nullptr, &cropRect)); SkBitmap result; SkIPoint offset; - SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr, SkImageFilter::kApprox_SizeConstraint); + SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr); REPORTER_ASSERT(reporter, filter->filterImage(&proxy, bitmap, ctx, &result, &offset)); REPORTER_ASSERT(reporter, offset.fX == 0); REPORTER_ASSERT(reporter, offset.fY == 0);