diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp index fbe4681da4..a55328a999 100644 --- a/gm/imagefiltersbase.cpp +++ b/gm/imagefiltersbase.cpp @@ -34,8 +34,8 @@ public: protected: FailImageFilter() : INHERITED(0, nullptr) {} - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override { + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override { return false; } @@ -76,8 +76,8 @@ public: protected: IdentityImageFilter(SkImageFilter* input) : INHERITED(1, &input) {} - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override { + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override { *result = src; offset->set(0, 0); return true; diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp index e783789124..26ebc4df7d 100644 --- a/gm/imagefiltersgraph.cpp +++ b/gm/imagefiltersgraph.cpp @@ -39,16 +39,16 @@ public: return new SimpleOffsetFilter(dx, dy, input); } - virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx, - SkBitmap* dst, SkIPoint* offset) const override { + bool onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx, + SkBitmap* dst, SkIPoint* offset) const override { SkBitmap source = src; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, src, ctx, &source, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, src, ctx, &source, &srcOffset)) { return false; } SkIRect bounds; - if (!this->applyCropRect(ctx, proxy, source, &srcOffset, &bounds, &source)) { + if (!this->applyCropRectDeprecated(ctx, proxy, source, &srcOffset, &bounds, &source)) { return false; } diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h index b5f98d29ba..29f6f7b760 100644 --- a/include/core/SkImageFilter.h +++ b/include/core/SkImageFilter.h @@ -145,8 +145,8 @@ public: * If the result image cannot be created, return false, in which case both * the result and offset parameters will be ignored by the caller. */ - bool filterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const; + bool filterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const; enum MapDirection { kForward_MapDirection, @@ -185,8 +185,8 @@ public: * relative to the src when it is drawn. The default implementation does * single-pass processing using asFragmentProcessor(). */ - virtual bool filterImageGPU(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const; + virtual bool filterImageGPUDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const; /** * Returns whether this image filter is a color filter and puts the color filter into the @@ -267,8 +267,9 @@ public: // has a GPU implementation, it will be invoked directly. // Otherwise, the filter will be processed in software and // uploaded to the GPU. - bool filterInputGPU(int index, SkImageFilter::Proxy* proxy, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const; + bool filterInputGPUDeprecated(int index, SkImageFilter::Proxy* proxy, + const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const; #endif SK_TO_STRING_PUREVIRT() @@ -341,8 +342,8 @@ protected: * case both the result and offset parameters will be ignored by the * caller. */ - virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const; + virtual bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const; /** * This function recurses into its inputs with the given clip rect (first @@ -379,8 +380,8 @@ protected: // "offset" untouched, and returns true. If the input is non-null, it // 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) const; + bool filterInputDeprecated(int index, Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const; /** * Return true (and return a ref'd colorfilter) if this node in the DAG is just a @@ -410,8 +411,8 @@ protected: * which are not capable of processing a smaller source bitmap into a * larger destination. */ - bool applyCropRect(const Context&, Proxy* proxy, const SkBitmap& src, SkIPoint* srcOffset, - SkIRect* bounds, SkBitmap* result) const; + bool applyCropRectDeprecated(const Context&, Proxy* proxy, const SkBitmap& src, + SkIPoint* srcOffset, SkIRect* bounds, SkBitmap* result) const; /** * Returns true if the filter can be expressed a single-pass diff --git a/include/effects/SkBlurImageFilter.h b/include/effects/SkBlurImageFilter.h index 5ae013d78e..6612b212cc 100644 --- a/include/effects/SkBlurImageFilter.h +++ b/include/effects/SkBlurImageFilter.h @@ -28,13 +28,13 @@ public: protected: void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, - SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, + SkIPoint* offset) const override; void onFilterNodeBounds(const SkIRect& src, const SkMatrix&, SkIRect* dst, MapDirection) const override; bool canFilterImageGPU() const override { return true; } - bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, SkBitmap* result, - SkIPoint* offset) const override; + bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx, + SkBitmap* result, SkIPoint* offset) const override; private: SkBlurImageFilter(SkScalar sigmaX, diff --git a/include/effects/SkColorFilterImageFilter.h b/include/effects/SkColorFilterImageFilter.h index db5d842c2f..6dd9df2495 100644 --- a/include/effects/SkColorFilterImageFilter.h +++ b/include/effects/SkColorFilterImageFilter.h @@ -22,8 +22,8 @@ public: protected: void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, - SkIPoint* loc) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, + SkIPoint* loc) const override; bool onIsColorFilterNode(SkColorFilter**) const override; bool canComputeFastBounds() const override; diff --git a/include/effects/SkComposeImageFilter.h b/include/effects/SkComposeImageFilter.h index 94f5dae19d..6ad6525fbd 100644 --- a/include/effects/SkComposeImageFilter.h +++ b/include/effects/SkComposeImageFilter.h @@ -34,8 +34,8 @@ protected: SkASSERT(inputs[0]); SkASSERT(inputs[1]); } - virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* loc) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* loc) const override; bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override; private: diff --git a/include/effects/SkDisplacementMapEffect.h b/include/effects/SkDisplacementMapEffect.h index b486a8fdf0..6aee97f43a 100644 --- a/include/effects/SkDisplacementMapEffect.h +++ b/include/effects/SkDisplacementMapEffect.h @@ -31,11 +31,11 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDisplacementMapEffect) - virtual bool onFilterImage(Proxy* proxy, - const SkBitmap& src, - const Context& ctx, - SkBitmap* dst, - SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& src, + const Context& ctx, + SkBitmap* dst, + SkIPoint* offset) const override; void computeFastBounds(const SkRect& src, SkRect* dst) const override; virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, @@ -44,7 +44,7 @@ public: #if SK_SUPPORT_GPU bool canFilterImageGPU() const override { return true; } - virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, + bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx, SkBitmap* result, SkIPoint* offset) const override; #endif diff --git a/include/effects/SkDropShadowImageFilter.h b/include/effects/SkDropShadowImageFilter.h index bff1a42013..2be77ce1a9 100644 --- a/include/effects/SkDropShadowImageFilter.h +++ b/include/effects/SkDropShadowImageFilter.h @@ -33,8 +33,8 @@ public: protected: void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& source, const Context&, SkBitmap* result, - SkIPoint* loc) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& source, const Context&, SkBitmap* result, + SkIPoint* loc) const override; void onFilterNodeBounds(const SkIRect& src, const SkMatrix&, SkIRect* dst, MapDirection) const override; diff --git a/include/effects/SkImageSource.h b/include/effects/SkImageSource.h index 56c6a6e96a..606bb0efd8 100644 --- a/include/effects/SkImageSource.h +++ b/include/effects/SkImageSource.h @@ -28,8 +28,8 @@ public: protected: void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; private: explicit SkImageSource(const SkImage*); diff --git a/include/effects/SkMagnifierImageFilter.h b/include/effects/SkMagnifierImageFilter.h index af142e9eff..bea03adab3 100644 --- a/include/effects/SkMagnifierImageFilter.h +++ b/include/effects/SkMagnifierImageFilter.h @@ -23,8 +23,8 @@ protected: SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter* input); void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; #if SK_SUPPORT_GPU bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&, const SkIRect& bounds) const override; diff --git a/include/effects/SkMatrixConvolutionImageFilter.h b/include/effects/SkMatrixConvolutionImageFilter.h index 7a2026c86b..40ebe20292 100644 --- a/include/effects/SkMatrixConvolutionImageFilter.h +++ b/include/effects/SkMatrixConvolutionImageFilter.h @@ -77,8 +77,8 @@ protected: const CropRect* cropRect); void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* loc) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* loc) const override; void onFilterNodeBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override; bool canComputeFastBounds() const override; diff --git a/include/effects/SkMergeImageFilter.h b/include/effects/SkMergeImageFilter.h index 10c29131ed..668e06f6da 100644 --- a/include/effects/SkMergeImageFilter.h +++ b/include/effects/SkMergeImageFilter.h @@ -35,8 +35,8 @@ public: protected: void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, - SkIPoint* loc) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, + SkIPoint* loc) const override; private: SkMergeImageFilter(SkImageFilter* filters[], int count, const SkXfermode::Mode modes[], diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h index 422bc01943..62e6f532da 100644 --- a/include/effects/SkMorphologyImageFilter.h +++ b/include/effects/SkMorphologyImageFilter.h @@ -60,12 +60,12 @@ public: return new SkDilateImageFilter(radiusX, radiusY, input, cropRect); } - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; #if SK_SUPPORT_GPU - bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; #endif SK_TO_STRING_OVERRIDE() @@ -89,12 +89,12 @@ public: return new SkErodeImageFilter(radiusX, radiusY, input, cropRect); } - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; #if SK_SUPPORT_GPU - bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; #endif SK_TO_STRING_OVERRIDE() diff --git a/include/effects/SkOffsetImageFilter.h b/include/effects/SkOffsetImageFilter.h index 66b5515b37..04b896a956 100644 --- a/include/effects/SkOffsetImageFilter.h +++ b/include/effects/SkOffsetImageFilter.h @@ -28,8 +28,8 @@ public: protected: void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, - SkIPoint* loc) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, + SkIPoint* loc) const override; void onFilterNodeBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override; private: diff --git a/include/effects/SkPaintImageFilter.h b/include/effects/SkPaintImageFilter.h index eee3630f31..74f700f590 100644 --- a/include/effects/SkPaintImageFilter.h +++ b/include/effects/SkPaintImageFilter.h @@ -31,8 +31,8 @@ public: protected: void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, - SkIPoint* loc) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, + SkIPoint* loc) const override; private: SkPaintImageFilter(const SkPaint& paint, const CropRect* rect); diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h index 934d1324c0..dbc87f7768 100644 --- a/include/effects/SkPictureImageFilter.h +++ b/include/effects/SkPictureImageFilter.h @@ -61,8 +61,8 @@ protected: * @param SkReadBuffer Serialized picture data. */ void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, - SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, + SkIPoint* offset) const override; private: explicit SkPictureImageFilter(const SkPicture* picture); diff --git a/include/effects/SkTestImageFilters.h b/include/effects/SkTestImageFilters.h index 06a3ff31a1..2b3ca84da8 100644 --- a/include/effects/SkTestImageFilters.h +++ b/include/effects/SkTestImageFilters.h @@ -30,8 +30,8 @@ public: protected: void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, - SkIPoint* loc) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, + SkIPoint* loc) const override; private: SkDownSampleImageFilter(SkScalar scale, SkImageFilter* input) diff --git a/include/effects/SkTileImageFilter.h b/include/effects/SkTileImageFilter.h index b29b7b2940..eef337fc68 100644 --- a/include/effects/SkTileImageFilter.h +++ b/include/effects/SkTileImageFilter.h @@ -21,8 +21,8 @@ public: */ static SkImageFilter* Create(const SkRect& src, const SkRect& dst, SkImageFilter* input); - bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx, - SkBitmap* dst, SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx, + SkBitmap* dst, SkIPoint* offset) const override; bool onFilterBounds(const SkIRect& src, const SkMatrix&, SkIRect* dst, MapDirection) const override; void onFilterNodeBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override; diff --git a/include/effects/SkXfermodeImageFilter.h b/include/effects/SkXfermodeImageFilter.h index 693425ed05..6df7903fa4 100644 --- a/include/effects/SkXfermodeImageFilter.h +++ b/include/effects/SkXfermodeImageFilter.h @@ -31,15 +31,15 @@ public: SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkXfermodeImageFilter) - bool onFilterImage(Proxy* proxy, - const SkBitmap& src, - const Context& ctx, - SkBitmap* dst, - SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& src, + const Context& ctx, + SkBitmap* dst, + SkIPoint* offset) const override; #if SK_SUPPORT_GPU bool canFilterImageGPU() const override; - bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const override; + bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx, + SkBitmap* result, SkIPoint* offset) const override; #endif protected: diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index c8c4b8749b..653f4b117f 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1382,7 +1382,7 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y, SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x(), -pos.y()); SkAutoTUnref cache(dstDev->getImageFilterCache()); SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); - if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) { + if (filter->filterImageDeprecated(&proxy, src, ctx, &dst, &offset)) { SkPaint tmpUnfiltered(*paint); tmpUnfiltered.setImageFilter(nullptr); dstDev->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + offset.y(), diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index 78aa3ee52f..7adb0f4b3c 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -415,7 +415,7 @@ void SkBaseDevice::drawBitmapAsSprite(const SkDraw& draw, const SkBitmap& bitmap const SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y); SkAutoTUnref cache(this->getImageFilterCache()); SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); - if (filter->filterImage(&proxy, bitmap, ctx, &dst, &offset)) { + if (filter->filterImageDeprecated(&proxy, bitmap, ctx, &dst, &offset)) { SkPaint tmpUnfiltered(paint); tmpUnfiltered.setImageFilter(nullptr); this->drawSprite(draw, dst, x + offset.x(), y + offset.y(), tmpUnfiltered); diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index 55abb8887f..a38124b0e6 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -231,9 +231,9 @@ void SkImageFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeUInt(fCropRect.flags()); } -bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src, - const Context& context, - SkBitmap* result, SkIPoint* offset) const { +bool SkImageFilter::filterImageDeprecated(Proxy* proxy, const SkBitmap& src, + const Context& context, + SkBitmap* result, SkIPoint* offset) const { SkASSERT(result); SkASSERT(offset); uint32_t srcGenID = fUsesSrcInput ? src.getGenerationID() : 0; @@ -248,7 +248,7 @@ bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src, * the filter to do it. */ if ((proxy && proxy->filterImage(this, src, context, result, offset)) || - this->onFilterImage(proxy, src, context, result, offset)) { + this->onFilterImageDeprecated(proxy, src, context, result, offset)) { if (context.cache()) { context.cache()->set(key, *result, *offset); SkAutoMutexAcquire mutex(fMutex); @@ -259,14 +259,14 @@ bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src, return false; } -bool SkImageFilter::filterInput(int index, Proxy* proxy, const SkBitmap& src, - const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkImageFilter::filterInputDeprecated(int index, Proxy* proxy, const SkBitmap& src, + const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { SkImageFilter* input = this->getInput(index); if (!input) { return true; } - return input->filterImage(proxy, src, this->mapContext(ctx), result, offset); + return input->filterImageDeprecated(proxy, src, this->mapContext(ctx), result, offset); } bool SkImageFilter::filterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst, @@ -319,8 +319,8 @@ bool SkImageFilter::canComputeFastBounds() const { return true; } -bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const Context&, - SkBitmap*, SkIPoint*) const { +bool SkImageFilter::onFilterImageDeprecated(Proxy*, const SkBitmap&, const Context&, + SkBitmap*, SkIPoint*) const { return false; } @@ -328,18 +328,18 @@ bool SkImageFilter::canFilterImageGPU() const { return this->asFragmentProcessor(nullptr, nullptr, SkMatrix::I(), SkIRect()); } -bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkImageFilter::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { #if SK_SUPPORT_GPU SkBitmap input = src; SkASSERT(fInputCount == 1); SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) { + if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &input, &srcOffset)) { return false; } GrTexture* srcTexture = input.getTexture(); SkIRect bounds; - if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &bounds, &input)) { + if (!this->applyCropRectDeprecated(ctx, proxy, input, &srcOffset, &bounds, &input)) { return false; } GrContext* context = srcTexture->getContext(); @@ -406,8 +406,9 @@ bool SkImageFilter::applyCropRect(const Context& ctx, const SkIRect& srcBounds, return dstBounds->intersect(ctx.clipBounds()); } -bool SkImageFilter::applyCropRect(const Context& ctx, Proxy* proxy, const SkBitmap& src, - SkIPoint* srcOffset, SkIRect* bounds, SkBitmap* dst) const { +bool SkImageFilter::applyCropRectDeprecated(const Context& ctx, Proxy* proxy, const SkBitmap& src, + SkIPoint* srcOffset, SkIRect* bounds, + SkBitmap* dst) const { SkIRect srcBounds; src.getBounds(&srcBounds); srcBounds.offset(*srcOffset); @@ -495,9 +496,9 @@ SkImageFilter* SkImageFilter::newWithLocalMatrix(const SkMatrix& matrix) const { #if SK_SUPPORT_GPU -bool SkImageFilter::filterInputGPU(int index, SkImageFilter::Proxy* proxy, - const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkImageFilter::filterInputGPUDeprecated(int index, SkImageFilter::Proxy* proxy, + const SkBitmap& src, const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { SkImageFilter* input = this->getInput(index); if (!input) { return true; @@ -506,7 +507,7 @@ 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(); - if (input->filterImage(proxy, src, this->mapContext(ctx), result, offset)) { + if (input->filterImageDeprecated(proxy, src, this->mapContext(ctx), result, offset)) { if (!result->getTexture()) { const SkImageInfo info = result->info(); if (kUnknown_SkColorType == info.colorType()) { diff --git a/src/core/SkLocalMatrixImageFilter.cpp b/src/core/SkLocalMatrixImageFilter.cpp index 5dce4190a9..4a9dea35bb 100644 --- a/src/core/SkLocalMatrixImageFilter.cpp +++ b/src/core/SkLocalMatrixImageFilter.cpp @@ -38,10 +38,11 @@ void SkLocalMatrixImageFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeMatrix(fLocalM); } -bool SkLocalMatrixImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkLocalMatrixImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, + const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { Context localCtx(SkMatrix::Concat(ctx.ctm(), fLocalM), ctx.clipBounds(), ctx.cache()); - return this->filterInput(0, proxy, src, localCtx, result, offset); + return this->filterInputDeprecated(0, proxy, src, localCtx, result, offset); } bool SkLocalMatrixImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& matrix, diff --git a/src/core/SkLocalMatrixImageFilter.h b/src/core/SkLocalMatrixImageFilter.h index 1d546e75e2..f2fd062f6c 100644 --- a/src/core/SkLocalMatrixImageFilter.h +++ b/src/core/SkLocalMatrixImageFilter.h @@ -25,8 +25,8 @@ public: protected: void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; bool onFilterBounds(const SkIRect& src, const SkMatrix&, SkIRect* dst, MapDirection) const override; diff --git a/src/core/SkMatrixImageFilter.cpp b/src/core/SkMatrixImageFilter.cpp index dd9e79f2cc..5a585efffc 100644 --- a/src/core/SkMatrixImageFilter.cpp +++ b/src/core/SkMatrixImageFilter.cpp @@ -46,14 +46,14 @@ void SkMatrixImageFilter::flatten(SkWriteBuffer& buffer) const { SkMatrixImageFilter::~SkMatrixImageFilter() { } -bool SkMatrixImageFilter::onFilterImage(Proxy* proxy, - const SkBitmap& source, - const Context& ctx, - SkBitmap* result, - SkIPoint* offset) const { +bool SkMatrixImageFilter::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& source, + const Context& ctx, + SkBitmap* result, + SkIPoint* offset) const { SkBitmap src = source; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) { return false; } diff --git a/src/core/SkMatrixImageFilter.h b/src/core/SkMatrixImageFilter.h index 09bfca9fe1..4d5b52d127 100644 --- a/src/core/SkMatrixImageFilter.h +++ b/src/core/SkMatrixImageFilter.h @@ -44,10 +44,10 @@ protected: SkImageFilter* input); void flatten(SkWriteBuffer&) const override; - virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* loc) const override; - virtual void onFilterNodeBounds(const SkIRect& src, const SkMatrix&, - SkIRect* dst, MapDirection) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* loc) const override; + void onFilterNodeBounds(const SkIRect& src, const SkMatrix&, + SkIRect* dst, MapDirection) const override; private: SkMatrix fTransform; diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index 07a46ad157..c1f9141a71 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -27,8 +27,8 @@ public: protected: void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; #if SK_SUPPORT_GPU bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&, const SkIRect& bounds) const override; @@ -331,9 +331,9 @@ void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const { buffer.writeRegion(fRegion); } -bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy* proxy, const SkBitmap& src, - const Context& ctx, SkBitmap* dst, - SkIPoint* offset) const { +bool SkAlphaThresholdFilterImpl::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, + const Context& ctx, SkBitmap* dst, + SkIPoint* offset) const { SkASSERT(src.colorType() == kN32_SkColorType); if (src.colorType() != kN32_SkColorType) { diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index 6ba9e0b640..151398213d 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -69,12 +69,12 @@ static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lo } } -bool SkBlurImageFilter::onFilterImage(Proxy* proxy, - const SkBitmap& source, const Context& ctx, - SkBitmap* dst, SkIPoint* offset) const { +bool SkBlurImageFilter::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& source, const Context& ctx, + SkBitmap* dst, SkIPoint* offset) const { SkBitmap src = source; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) { return false; } @@ -198,12 +198,13 @@ void SkBlurImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& c SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3)))); } -bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkBlurImageFilter::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, + const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { #if SK_SUPPORT_GPU SkBitmap input = src; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) { + if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &input, &srcOffset)) { return false; } SkIRect srcBounds = input.bounds(); diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp index 5b97d1bc36..96ce5d9690 100644 --- a/src/effects/SkColorFilterImageFilter.cpp +++ b/src/effects/SkColorFilterImageFilter.cpp @@ -55,13 +55,13 @@ SkColorFilterImageFilter::~SkColorFilterImageFilter() { fColorFilter->unref(); } -bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, - const Context& ctx, - SkBitmap* result, - SkIPoint* offset) const { +bool SkColorFilterImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& source, + const Context& ctx, + SkBitmap* result, + SkIPoint* offset) const { SkBitmap src = source; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) { return false; } diff --git a/src/effects/SkComposeImageFilter.cpp b/src/effects/SkComposeImageFilter.cpp index f7fc6c09c4..2ec7683e9b 100644 --- a/src/effects/SkComposeImageFilter.cpp +++ b/src/effects/SkComposeImageFilter.cpp @@ -22,15 +22,15 @@ void SkComposeImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) con outer->computeFastBounds(tmp, dst); } -bool SkComposeImageFilter::onFilterImage(Proxy* proxy, - const SkBitmap& src, - const Context& ctx, - SkBitmap* result, - SkIPoint* offset) const { +bool SkComposeImageFilter::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& src, + const Context& ctx, + SkBitmap* result, + SkIPoint* offset) const { SkBitmap tmp; SkIPoint innerOffset = SkIPoint::Make(0, 0); SkIPoint outerOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(1, proxy, src, ctx, &tmp, &innerOffset)) + if (!this->filterInputDeprecated(1, proxy, src, ctx, &tmp, &innerOffset)) return false; SkMatrix outerMatrix(ctx.ctm()); @@ -38,7 +38,7 @@ bool SkComposeImageFilter::onFilterImage(Proxy* proxy, SkIRect clipBounds = ctx.clipBounds(); clipBounds.offset(-innerOffset.x(), -innerOffset.y()); Context outerContext(outerMatrix, clipBounds, ctx.cache()); - if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset)) { + if (!this->filterInputDeprecated(0, proxy, tmp, outerContext, result, &outerOffset)) { return false; } diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 2f95474a76..5aef212f3d 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -210,15 +210,15 @@ void SkDisplacementMapEffect::flatten(SkWriteBuffer& buffer) const { buffer.writeScalar(fScale); } -bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, - const SkBitmap& src, - const Context& ctx, - SkBitmap* dst, - SkIPoint* offset) const { +bool SkDisplacementMapEffect::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& src, + const Context& ctx, + SkBitmap* dst, + SkIPoint* offset) const { SkBitmap displ = src, color = src; SkIPoint colorOffset = SkIPoint::Make(0, 0), displOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(1, proxy, src, ctx, &color, &colorOffset) || - !this->filterInput(0, proxy, src, ctx, &displ, &displOffset)) { + if (!this->filterInputDeprecated(1, proxy, src, ctx, &color, &colorOffset) || + !this->filterInputDeprecated(0, proxy, src, ctx, &displ, &displOffset)) { return false; } if ((displ.colorType() != kN32_SkColorType) || @@ -234,7 +234,7 @@ bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, return false; } SkIRect displBounds; - if (!this->applyCropRect(ctx, proxy, displ, &displOffset, &displBounds, &displ)) { + if (!this->applyCropRectDeprecated(ctx, proxy, displ, &displOffset, &displBounds, &displ)) { return false; } if (!bounds.intersect(displBounds)) { @@ -386,16 +386,17 @@ private: typedef GrFragmentProcessor INHERITED; }; -bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkDisplacementMapEffect::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, + const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { SkBitmap colorBM = src; SkIPoint colorOffset = SkIPoint::Make(0, 0); - if (!this->filterInputGPU(1, proxy, src, ctx, &colorBM, &colorOffset)) { + if (!this->filterInputGPUDeprecated(1, proxy, src, ctx, &colorBM, &colorOffset)) { return false; } SkBitmap displacementBM = src; SkIPoint displacementOffset = SkIPoint::Make(0, 0); - if (!this->filterInputGPU(0, proxy, src, ctx, &displacementBM, &displacementOffset)) { + if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &displacementBM, &displacementOffset)) { return false; } SkIRect srcBounds = colorBM.bounds(); @@ -407,8 +408,8 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src, return false; } SkIRect displBounds; - if (!this->applyCropRect(ctx, proxy, displacementBM, - &displacementOffset, &displBounds, &displacementBM)) { + if (!this->applyCropRectDeprecated(ctx, proxy, displacementBM, + &displacementOffset, &displBounds, &displacementBM)) { return false; } if (!bounds.intersect(displBounds)) { diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp index 5f8736f3a5..e2e72c1097 100644 --- a/src/effects/SkDropShadowImageFilter.cpp +++ b/src/effects/SkDropShadowImageFilter.cpp @@ -53,13 +53,12 @@ void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeInt(static_cast(fShadowMode)); } -bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, - const Context& ctx, - SkBitmap* result, SkIPoint* offset) const -{ +bool SkDropShadowImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& source, + const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { SkBitmap src = source; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) + if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) return false; SkIRect srcBounds = src.bounds(); diff --git a/src/effects/SkImageSource.cpp b/src/effects/SkImageSource.cpp index 2686fcb6c6..e9c98dc6ff 100644 --- a/src/effects/SkImageSource.cpp +++ b/src/effects/SkImageSource.cpp @@ -64,8 +64,8 @@ void SkImageSource::flatten(SkWriteBuffer& buffer) const { buffer.writeImage(fImage); } -bool SkImageSource::onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkImageSource::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { SkRect dstRect; ctx.ctm().mapRect(&dstRect, fDstRect); SkRect bounds = SkRect::MakeIWH(fImage->width(), fImage->height()); diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index 78a24649b6..76133ba354 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -355,8 +355,8 @@ protected: #if SK_SUPPORT_GPU bool canFilterImageGPU() const override { return true; } - bool filterImageGPU(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool filterImageGPUDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; virtual GrFragmentProcessor* getFragmentProcessor(GrTexture*, const SkMatrix&, const SkIRect* srcBounds, @@ -393,14 +393,14 @@ void SkLightingImageFilterInternal::drawRect(GrDrawContext* drawContext, drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect); } -bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy, - const SkBitmap& src, - const Context& ctx, - SkBitmap* result, - SkIPoint* offset) const { +bool SkLightingImageFilterInternal::filterImageGPUDeprecated(Proxy* proxy, + const SkBitmap& src, + const Context& ctx, + SkBitmap* result, + SkIPoint* offset) const { SkBitmap input = src; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) { + if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &input, &srcOffset)) { return false; } SkIRect srcBounds = input.bounds(); @@ -487,8 +487,8 @@ protected: SkDiffuseLightingImageFilter(SkImageFilterLight* light, SkScalar surfaceScale, SkScalar kd, SkImageFilter* input, const CropRect* cropRect); void flatten(SkWriteBuffer& buffer) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; #if SK_SUPPORT_GPU GrFragmentProcessor* getFragmentProcessor(GrTexture*, const SkMatrix&, const SkIRect* bounds, BoundaryMode) const override; @@ -515,8 +515,8 @@ protected: SkSpecularLightingImageFilter(SkImageFilterLight* light, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect*); void flatten(SkWriteBuffer& buffer) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; #if SK_SUPPORT_GPU GrFragmentProcessor* getFragmentProcessor(GrTexture*, const SkMatrix&, const SkIRect* bounds, BoundaryMode) const override; @@ -1223,14 +1223,14 @@ void SkDiffuseLightingImageFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeScalar(fKD); } -bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy, - const SkBitmap& source, - const Context& ctx, - SkBitmap* dst, - SkIPoint* offset) const { +bool SkDiffuseLightingImageFilter::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& source, + const Context& ctx, + SkBitmap* dst, + SkIPoint* offset) const { SkBitmap src = source; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) { return false; } @@ -1367,14 +1367,14 @@ void SkSpecularLightingImageFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeScalar(fShininess); } -bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy, - const SkBitmap& source, - const Context& ctx, - SkBitmap* dst, - SkIPoint* offset) const { +bool SkSpecularLightingImageFilter::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& source, + const Context& ctx, + SkBitmap* dst, + SkIPoint* offset) const { SkBitmap src = source; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) { return false; } diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp index 81f55d43f1..3d185d655a 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/SkMagnifierImageFilter.cpp @@ -294,9 +294,9 @@ void SkMagnifierImageFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeScalar(fInset); } -bool SkMagnifierImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, - const Context&, SkBitmap* dst, - SkIPoint* offset) const { +bool SkMagnifierImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, + const Context&, SkBitmap* dst, + SkIPoint* offset) const { if ((src.colorType() != kN32_SkColorType) || (fSrcRect.width() >= src.width()) || (fSrcRect.height() >= src.height())) { diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp index a80ba45fdb..0d14caf131 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -264,14 +264,14 @@ static SkBitmap unpremultiplyBitmap(SkImageFilter::Proxy* proxy, const SkBitmap& return result; } -bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, - const SkBitmap& source, - const Context& ctx, - SkBitmap* result, - SkIPoint* offset) const { +bool SkMatrixConvolutionImageFilter::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& source, + const Context& ctx, + SkBitmap* result, + SkIPoint* offset) const { SkBitmap src = source; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) { return false; } @@ -280,7 +280,8 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, } SkIRect bounds; - if (!this->applyCropRect(this->mapContext(ctx), proxy, src, &srcOffset, &bounds, &src)) { + if (!this->applyCropRectDeprecated(this->mapContext(ctx), proxy, src, &srcOffset, + &bounds, &src)) { return false; } diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp index 12fff9533a..79e5329ef1 100755 --- a/src/effects/SkMergeImageFilter.cpp +++ b/src/effects/SkMergeImageFilter.cpp @@ -55,9 +55,9 @@ SkMergeImageFilter::~SkMergeImageFilter() { } } -bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, - const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkMergeImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, + const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { int inputCount = this->countInputs(); if (inputCount < 1) { return false; @@ -73,7 +73,7 @@ bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, for (int i = 0; i < inputCount; ++i) { inputs[i] = src; offsets[i].setZero(); - if (!this->filterInput(i, proxy, src, ctx, &inputs[i], &offsets[i])) { + if (!this->filterInputDeprecated(i, proxy, src, ctx, &inputs[i], &offsets[i])) { inputs[i].reset(); continue; } diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 3657e33bf6..2a2b76e513 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -62,7 +62,7 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p SkIPoint* offset) const { SkBitmap src = source; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) { return false; } @@ -71,7 +71,8 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p } SkIRect bounds; - if (!this->applyCropRect(this->mapContext(ctx), proxy, src, &srcOffset, &bounds, &src)) { + if (!this->applyCropRectDeprecated(this->mapContext(ctx), proxy, src, &srcOffset, + &bounds, &src)) { return false; } @@ -127,16 +128,16 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p return true; } -bool SkErodeImageFilter::onFilterImage(Proxy* proxy, - const SkBitmap& source, const Context& ctx, - SkBitmap* dst, SkIPoint* offset) const { +bool SkErodeImageFilter::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& source, const Context& ctx, + SkBitmap* dst, SkIPoint* offset) const { return this->filterImageGeneric(SkOpts::erode_x, SkOpts::erode_y, proxy, source, ctx, dst, offset); } -bool SkDilateImageFilter::onFilterImage(Proxy* proxy, - const SkBitmap& source, const Context& ctx, - SkBitmap* dst, SkIPoint* offset) const { +bool SkDilateImageFilter::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& source, const Context& ctx, + SkBitmap* dst, SkIPoint* offset) const { return this->filterImageGeneric(SkOpts::dilate_x, SkOpts::dilate_y, proxy, source, ctx, dst, offset); } @@ -607,11 +608,12 @@ bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate, SkIPoint* offset) const { SkBitmap input = src; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) { + if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &input, &srcOffset)) { return false; } SkIRect bounds; - if (!this->applyCropRect(this->mapContext(ctx), proxy, input, &srcOffset, &bounds, &input)) { + if (!this->applyCropRectDeprecated(this->mapContext(ctx), proxy, input, &srcOffset, + &bounds, &input)) { return false; } SkVector radius = SkVector::Make(SkIntToScalar(this->radius().width()), @@ -643,13 +645,15 @@ bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate, return true; } -bool SkDilateImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkDilateImageFilter::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, + const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); } -bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkErodeImageFilter::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, + const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); } diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp index 2aac4f32d1..ddc8be8f95 100644 --- a/src/effects/SkOffsetImageFilter.cpp +++ b/src/effects/SkOffsetImageFilter.cpp @@ -14,14 +14,14 @@ #include "SkMatrix.h" #include "SkPaint.h" -bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, - const Context& ctx, - SkBitmap* result, - SkIPoint* offset) const { +bool SkOffsetImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& source, + const Context& ctx, + SkBitmap* result, + SkIPoint* offset) const { SkBitmap src = source; SkIPoint srcOffset = SkIPoint::Make(0, 0); if (!cropRectIsSet()) { - if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) { return false; } @@ -32,7 +32,7 @@ bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, offset->fY = srcOffset.fY + SkScalarRoundToInt(vec.fY); *result = src; } else { - if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) { return false; } diff --git a/src/effects/SkPaintImageFilter.cpp b/src/effects/SkPaintImageFilter.cpp index c0210513ac..ed5d9db4d8 100644 --- a/src/effects/SkPaintImageFilter.cpp +++ b/src/effects/SkPaintImageFilter.cpp @@ -33,11 +33,11 @@ void SkPaintImageFilter::flatten(SkWriteBuffer& buffer) const { buffer.writePaint(fPaint); } -bool SkPaintImageFilter::onFilterImage(Proxy* proxy, - const SkBitmap& source, - const Context& ctx, - SkBitmap* result, - SkIPoint* offset) const { +bool SkPaintImageFilter::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& source, + const Context& ctx, + SkBitmap* result, + SkIPoint* offset) const { SkIRect bounds; if (!this->applyCropRect(ctx, source.bounds(), &bounds)) { return false; diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp index d85024e225..d1a7fc59cf 100644 --- a/src/effects/SkPictureImageFilter.cpp +++ b/src/effects/SkPictureImageFilter.cpp @@ -84,8 +84,9 @@ void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const { } } -bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const { +bool SkPictureImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap&, + const Context& ctx, + SkBitmap* result, SkIPoint* offset) const { if (!fPicture) { offset->fX = offset->fY = 0; return true; diff --git a/src/effects/SkTestImageFilters.cpp b/src/effects/SkTestImageFilters.cpp index 432b576c15..b8b0e187ed 100755 --- a/src/effects/SkTestImageFilters.cpp +++ b/src/effects/SkTestImageFilters.cpp @@ -27,9 +27,9 @@ public: /////////////////////////////////////////////////////////////////////////////// -bool SkDownSampleImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, - const Context&, - SkBitmap* result, SkIPoint*) const { +bool SkDownSampleImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, + const Context&, + SkBitmap* result, SkIPoint*) const { SkScalar scale = fScale; if (scale > SK_Scalar1 || scale <= 0) { return false; diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp index 01f9d29305..66cad47ad0 100644 --- a/src/effects/SkTileImageFilter.cpp +++ b/src/effects/SkTileImageFilter.cpp @@ -35,12 +35,12 @@ SkImageFilter* SkTileImageFilter::Create(const SkRect& srcRect, const SkRect& ds return new SkTileImageFilter(srcRect, dstRect, input); } -bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, - const Context& ctx, - SkBitmap* dst, SkIPoint* offset) const { +bool SkTileImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, + const Context& ctx, + SkBitmap* dst, SkIPoint* offset) const { SkBitmap source = src; SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, src, ctx, &source, &srcOffset)) { + if (!this->filterInputDeprecated(0, proxy, src, ctx, &source, &srcOffset)) { return false; } diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp index 3f702e69c4..09651b632c 100644 --- a/src/effects/SkXfermodeImageFilter.cpp +++ b/src/effects/SkXfermodeImageFilter.cpp @@ -41,18 +41,18 @@ void SkXfermodeImageFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeFlattenable(fMode); } -bool SkXfermodeImageFilter::onFilterImage(Proxy* proxy, - const SkBitmap& src, - const Context& ctx, - SkBitmap* dst, - SkIPoint* offset) const { +bool SkXfermodeImageFilter::onFilterImageDeprecated(Proxy* proxy, + const SkBitmap& src, + const Context& ctx, + SkBitmap* dst, + SkIPoint* offset) const { SkBitmap background = src, foreground = src; SkIPoint backgroundOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(0, proxy, src, ctx, &background, &backgroundOffset)) { + if (!this->filterInputDeprecated(0, proxy, src, ctx, &background, &backgroundOffset)) { background.reset(); } SkIPoint foregroundOffset = SkIPoint::Make(0, 0); - if (!this->filterInput(1, proxy, src, ctx, &foreground, &foregroundOffset)) { + if (!this->filterInputDeprecated(1, proxy, src, ctx, &foreground, &foregroundOffset)) { foreground.reset(); } @@ -126,15 +126,15 @@ bool SkXfermodeImageFilter::canFilterImageGPU() const { #include "SkXfermode_proccoeff.h" -bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, - const SkBitmap& src, - const Context& ctx, - SkBitmap* result, - SkIPoint* offset) const { +bool SkXfermodeImageFilter::filterImageGPUDeprecated(Proxy* proxy, + const SkBitmap& src, + const Context& ctx, + SkBitmap* result, + SkIPoint* offset) const { GrContext* context = nullptr; SkBitmap background = src; SkIPoint backgroundOffset = SkIPoint::Make(0, 0); - if (!this->filterInputGPU(0, proxy, src, ctx, &background, &backgroundOffset)) { + if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &background, &backgroundOffset)) { background.reset(); } GrTexture* backgroundTex = background.getTexture(); @@ -144,7 +144,7 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, SkBitmap foreground = src; SkIPoint foregroundOffset = SkIPoint::Make(0, 0); - if (!this->filterInputGPU(1, proxy, src, ctx, &foreground, &foregroundOffset)) { + if (!this->filterInputGPUDeprecated(1, proxy, src, ctx, &foreground, &foregroundOffset)) { foreground.reset(); } GrTexture* foregroundTex = foreground.getTexture(); diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp index 842ab56dfb..c39aa2007f 100644 --- a/src/gpu/GrLayerHoister.cpp +++ b/src/gpu/GrLayerHoister.cpp @@ -308,7 +308,8 @@ void GrLayerHoister::FilterLayer(GrContext* context, GrWrapTextureInBitmap(layer->texture(), layer->texture()->width(), layer->texture()->height(), false, &src); - if (!layer->filter()->filterImage(&proxy, src, filterContext, &filteredBitmap, &offset)) { + if (!layer->filter()->filterImageDeprecated(&proxy, src, filterContext, + &filteredBitmap, &offset)) { // Filtering failed. Press on with the unfiltered version. return; } diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index cb92ab3edf..df5c7a73a1 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1129,7 +1129,7 @@ bool SkGpuDevice::filterTexture(GrContext* context, GrTexture* texture, if (filter->canFilterImageGPU()) { SkBitmap bm; GrWrapTextureInBitmap(texture, width, height, false, &bm); - return filter->filterImageGPU(&proxy, bm, ctx, result, offset); + return filter->filterImageGPUDeprecated(&proxy, bm, ctx, result, offset); } else { return false; } diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index c4e431f4ed..60480ec629 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -53,8 +53,8 @@ public: : SkImageFilter(0, nullptr), fReporter(reporter), fExpectedMatrix(expectedMatrix) { } - virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const override { + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context& ctx, + SkBitmap* result, SkIPoint* offset) const override { REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix); return true; } @@ -321,8 +321,10 @@ static void test_crop_rects(SkImageFilter::Proxy* proxy, skiatest::Reporter* rep SkString str; str.printf("filter %d", static_cast(i)); 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, + filter->filterImageDeprecated(proxy, bitmap, ctx, + &result, &offset), + str.c_str()); REPORTER_ASSERT_MESSAGE(reporter, offset.fX == 20 && offset.fY == 30, str.c_str()); } @@ -366,13 +368,21 @@ static void test_negative_blur_sigma(SkImageFilter::Proxy* proxy, skiatest::Repo SkBitmap positiveResult2, negativeResult2; SkIPoint offset; 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)); + REPORTER_ASSERT(reporter, + positiveFilter->filterImageDeprecated(proxy, gradient, ctx, + &positiveResult1, &offset)); + REPORTER_ASSERT(reporter, + negativeFilter->filterImageDeprecated(proxy, gradient, ctx, + &negativeResult1, &offset)); SkMatrix negativeScale; negativeScale.setScale(-SK_Scalar1, SK_Scalar1); 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)); + REPORTER_ASSERT(reporter, + positiveFilter->filterImageDeprecated(proxy, gradient, negativeCTX, + &negativeResult2, &offset)); + REPORTER_ASSERT(reporter, + negativeFilter->filterImageDeprecated(proxy, gradient, negativeCTX, + &positiveResult2, &offset)); SkAutoLockPixels lockP1(positiveResult1); SkAutoLockPixels lockP2(positiveResult2); SkAutoLockPixels lockN1(negativeResult1); @@ -662,7 +672,7 @@ DEF_TEST(ImageFilterMergeResultSize, reporter) { 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)); + REPORTER_ASSERT(reporter, merge->filterImageDeprecated(&proxy, bitmap, ctx, &result, &offset)); REPORTER_ASSERT(reporter, result.width() == 20 && result.height() == 20); } @@ -912,7 +922,8 @@ DEF_TEST(ImageFilterClippedPictureImageFilter, reporter) { const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); SkBitmapDevice device(bitmap, props); SkImageFilter::DeviceProxy proxy(&device); - REPORTER_ASSERT(reporter, !imageFilter->filterImage(&proxy, bitmap, ctx, &result, &offset)); + REPORTER_ASSERT(reporter, + !imageFilter->filterImageDeprecated(&proxy, bitmap, ctx, &result, &offset)); } DEF_TEST(ImageFilterEmptySaveLayer, reporter) { @@ -1160,7 +1171,8 @@ DEF_TEST(ComposedImageFilterOffset, reporter) { SkBitmap result; SkIPoint offset; SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr); - REPORTER_ASSERT(reporter, composedFilter->filterImage(&proxy, bitmap, ctx, &result, &offset)); + REPORTER_ASSERT(reporter, + composedFilter->filterImageDeprecated(&proxy, bitmap, ctx, &result, &offset)); REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); } @@ -1178,7 +1190,8 @@ DEF_TEST(PartialCropRect, reporter) { SkBitmap result; SkIPoint offset; SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr); - REPORTER_ASSERT(reporter, filter->filterImage(&proxy, bitmap, ctx, &result, &offset)); + REPORTER_ASSERT(reporter, + filter->filterImageDeprecated(&proxy, bitmap, ctx, &result, &offset)); REPORTER_ASSERT(reporter, offset.fX == 0); REPORTER_ASSERT(reporter, offset.fY == 0); REPORTER_ASSERT(reporter, result.width() == 20); diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp index 5fce53ea0a..9ca1bd619a 100644 --- a/tests/PDFPrimitivesTest.cpp +++ b/tests/PDFPrimitivesTest.cpp @@ -369,8 +369,8 @@ class DummyImageFilter : public SkImageFilter { public: DummyImageFilter(bool visited = false) : SkImageFilter(0, nullptr), fVisited(visited) {} ~DummyImageFilter() override {} - virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override { + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override { fVisited = true; offset->fX = offset->fY = 0; *result = src;