Mark existing image filter entry points that will be going away with Deprecated
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1709753002
Review URL: https://codereview.chromium.org/1709753002
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp
index fbe4681..a55328a 100644
--- a/gm/imagefiltersbase.cpp
+++ b/gm/imagefiltersbase.cpp
@@ -34,8 +34,8 @@
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 @@
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 e783789..26ebc4d 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -39,16 +39,16 @@
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 b5f98d2..29f6f7b 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -145,8 +145,8 @@
* 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 @@
* 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 @@
// 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 @@
* 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 @@
// "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 @@
* 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 5ae013d..6612b21 100644
--- a/include/effects/SkBlurImageFilter.h
+++ b/include/effects/SkBlurImageFilter.h
@@ -28,13 +28,13 @@
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 db5d842..6dd9df2 100644
--- a/include/effects/SkColorFilterImageFilter.h
+++ b/include/effects/SkColorFilterImageFilter.h
@@ -22,8 +22,8 @@
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 94f5dae..6ad6525 100644
--- a/include/effects/SkComposeImageFilter.h
+++ b/include/effects/SkComposeImageFilter.h
@@ -34,8 +34,8 @@
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 b486a8f..6aee97f 100644
--- a/include/effects/SkDisplacementMapEffect.h
+++ b/include/effects/SkDisplacementMapEffect.h
@@ -31,11 +31,11 @@
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 @@
#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 bff1a42..2be77ce 100644
--- a/include/effects/SkDropShadowImageFilter.h
+++ b/include/effects/SkDropShadowImageFilter.h
@@ -33,8 +33,8 @@
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 56c6a6e..606bb0e 100644
--- a/include/effects/SkImageSource.h
+++ b/include/effects/SkImageSource.h
@@ -28,8 +28,8 @@
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 af142e9..bea03ad 100644
--- a/include/effects/SkMagnifierImageFilter.h
+++ b/include/effects/SkMagnifierImageFilter.h
@@ -23,8 +23,8 @@
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 7a2026c..40ebe20 100644
--- a/include/effects/SkMatrixConvolutionImageFilter.h
+++ b/include/effects/SkMatrixConvolutionImageFilter.h
@@ -77,8 +77,8 @@
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 10c2913..668e06f 100644
--- a/include/effects/SkMergeImageFilter.h
+++ b/include/effects/SkMergeImageFilter.h
@@ -35,8 +35,8 @@
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 422bc01..62e6f53 100644
--- a/include/effects/SkMorphologyImageFilter.h
+++ b/include/effects/SkMorphologyImageFilter.h
@@ -60,12 +60,12 @@
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 @@
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 66b5515..04b896a 100644
--- a/include/effects/SkOffsetImageFilter.h
+++ b/include/effects/SkOffsetImageFilter.h
@@ -28,8 +28,8 @@
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 eee3630..74f700f 100644
--- a/include/effects/SkPaintImageFilter.h
+++ b/include/effects/SkPaintImageFilter.h
@@ -31,8 +31,8 @@
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 934d132..dbc87f7 100644
--- a/include/effects/SkPictureImageFilter.h
+++ b/include/effects/SkPictureImageFilter.h
@@ -61,8 +61,8 @@
* @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 06a3ff3..2b3ca84 100644
--- a/include/effects/SkTestImageFilters.h
+++ b/include/effects/SkTestImageFilters.h
@@ -30,8 +30,8 @@
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 b29b7b2..eef337f 100644
--- a/include/effects/SkTileImageFilter.h
+++ b/include/effects/SkTileImageFilter.h
@@ -21,8 +21,8 @@
*/
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 693425e..6df7903 100644
--- a/include/effects/SkXfermodeImageFilter.h
+++ b/include/effects/SkXfermodeImageFilter.h
@@ -31,15 +31,15 @@
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 c8c4b87..653f4b1 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1382,7 +1382,7 @@
SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x(), -pos.y());
SkAutoTUnref<SkImageFilter::Cache> 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 78aa3ee..7adb0f4 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -415,7 +415,7 @@
const SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y);
SkAutoTUnref<SkImageFilter::Cache> 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 55abb88..a38124b 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -231,9 +231,9 @@
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 @@
* 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 @@
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 @@
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 @@
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 @@
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 @@
#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 @@
// 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 5dce419..4a9dea35 100644
--- a/src/core/SkLocalMatrixImageFilter.cpp
+++ b/src/core/SkLocalMatrixImageFilter.cpp
@@ -38,10 +38,11 @@
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 1d546e7..f2fd062 100644
--- a/src/core/SkLocalMatrixImageFilter.h
+++ b/src/core/SkLocalMatrixImageFilter.h
@@ -25,8 +25,8 @@
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 dd9e79f..5a585ef 100644
--- a/src/core/SkMatrixImageFilter.cpp
+++ b/src/core/SkMatrixImageFilter.cpp
@@ -46,14 +46,14 @@
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 09bfca9..4d5b52d 100644
--- a/src/core/SkMatrixImageFilter.h
+++ b/src/core/SkMatrixImageFilter.h
@@ -44,10 +44,10 @@
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 07a46ad..c1f9141 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -27,8 +27,8 @@
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 @@
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 6ba9e0b..1513982 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -69,12 +69,12 @@
}
}
-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 @@
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 5b97d1b..96ce5d9 100644
--- a/src/effects/SkColorFilterImageFilter.cpp
+++ b/src/effects/SkColorFilterImageFilter.cpp
@@ -55,13 +55,13 @@
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 f7fc6c0..2ec7683 100644
--- a/src/effects/SkComposeImageFilter.cpp
+++ b/src/effects/SkComposeImageFilter.cpp
@@ -22,15 +22,15 @@
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 @@
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 2f95474..5aef212 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -210,15 +210,15 @@
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 @@
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 @@
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 @@
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 5f8736f..e2e72c1 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -53,13 +53,12 @@
buffer.writeInt(static_cast<int>(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 2686fcb..e9c98dc 100644
--- a/src/effects/SkImageSource.cpp
+++ b/src/effects/SkImageSource.cpp
@@ -64,8 +64,8 @@
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 78a2464..76133ba 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -355,8 +355,8 @@
#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 @@
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 @@
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 @@
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 @@
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 @@
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 81f55d4..3d185d6 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -294,9 +294,9 @@
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 a80ba45..0d14caf 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -264,14 +264,14 @@
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 @@
}
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 12fff95..79e5329 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -55,9 +55,9 @@
}
}
-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 @@
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 3657e33..2a2b76e 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -62,7 +62,7 @@
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 @@
}
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 @@
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 @@
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 @@
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 2aac4f3..ddc8be8 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 @@
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 c021051..ed5d9db 100644
--- a/src/effects/SkPaintImageFilter.cpp
+++ b/src/effects/SkPaintImageFilter.cpp
@@ -33,11 +33,11 @@
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 d85024e..d1a7fc5 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -84,8 +84,9 @@
}
}
-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 432b576..b8b0e18 100755
--- a/src/effects/SkTestImageFilters.cpp
+++ b/src/effects/SkTestImageFilters.cpp
@@ -27,9 +27,9 @@
///////////////////////////////////////////////////////////////////////////////
-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 01f9d29..66cad47 100644
--- a/src/effects/SkTileImageFilter.cpp
+++ b/src/effects/SkTileImageFilter.cpp
@@ -35,12 +35,12 @@
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 3f702e6..09651b6 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -41,18 +41,18 @@
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 @@
#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 @@
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 842ab56..c39aa20 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -308,7 +308,8 @@
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 cb92ab3..df5c7a7 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1129,7 +1129,7 @@
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 c4e431f..60480ec 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -53,8 +53,8 @@
: 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 @@
SkString str;
str.printf("filter %d", static_cast<int>(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 @@
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 @@
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 @@
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 @@
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 @@
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 5fce53e..9ca1bd6 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -369,8 +369,8 @@
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;