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
This commit is contained in:
parent
b65fcd4283
commit
48e78468f5
@ -34,7 +34,7 @@ public:
|
||||
protected:
|
||||
FailImageFilter() : INHERITED(0, nullptr) {}
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
return false;
|
||||
}
|
||||
@ -76,7 +76,7 @@ public:
|
||||
protected:
|
||||
IdentityImageFilter(SkImageFilter* input) : INHERITED(1, &input) {}
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
*result = src;
|
||||
offset->set(0, 0);
|
||||
|
@ -39,16 +39,16 @@ public:
|
||||
return new SimpleOffsetFilter(dx, dy, input);
|
||||
}
|
||||
|
||||
virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ 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&,
|
||||
bool filterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
|
||||
enum MapDirection {
|
||||
@ -185,7 +185,7 @@ 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&,
|
||||
virtual bool filterImageGPUDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
|
||||
/**
|
||||
@ -267,7 +267,8 @@ 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&,
|
||||
bool filterInputGPUDeprecated(int index, SkImageFilter::Proxy* proxy,
|
||||
const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
#endif
|
||||
|
||||
@ -341,7 +342,7 @@ protected:
|
||||
* case both the result and offset parameters will be ignored by the
|
||||
* caller.
|
||||
*/
|
||||
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
virtual bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
|
||||
/**
|
||||
@ -379,7 +380,7 @@ 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&,
|
||||
bool filterInputDeprecated(int index, Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
|
||||
/**
|
||||
@ -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
|
||||
|
@ -28,13 +28,13 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
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,
|
||||
|
@ -22,7 +22,7 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
bool onIsColorFilterNode(SkColorFilter**) const override;
|
||||
bool canComputeFastBounds() const override;
|
||||
|
@ -34,7 +34,7 @@ protected:
|
||||
SkASSERT(inputs[0]);
|
||||
SkASSERT(inputs[1]);
|
||||
}
|
||||
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* loc) const override;
|
||||
bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override;
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
|
||||
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDisplacementMapEffect)
|
||||
|
||||
virtual bool onFilterImage(Proxy* proxy,
|
||||
bool onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
@ -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
|
||||
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& source, const Context&, SkBitmap* result,
|
||||
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;
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
|
||||
private:
|
||||
|
@ -23,7 +23,7 @@ protected:
|
||||
SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter* input);
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#if SK_SUPPORT_GPU
|
||||
bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
|
||||
|
@ -77,7 +77,7 @@ protected:
|
||||
const CropRect* cropRect);
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
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;
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
|
||||
private:
|
||||
|
@ -60,11 +60,11 @@ public:
|
||||
return new SkDilateImageFilter(radiusX, radiusY, input, cropRect);
|
||||
}
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
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&,
|
||||
bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#endif
|
||||
|
||||
@ -89,11 +89,11 @@ public:
|
||||
return new SkErodeImageFilter(radiusX, radiusY, input, cropRect);
|
||||
}
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
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&,
|
||||
bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#endif
|
||||
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
void onFilterNodeBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override;
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
|
||||
private:
|
||||
|
@ -61,7 +61,7 @@ protected:
|
||||
* @param SkReadBuffer Serialized picture data.
|
||||
*/
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* offset) const override;
|
||||
|
||||
private:
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
|
||||
private:
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
*/
|
||||
static SkImageFilter* Create(const SkRect& src, const SkRect& dst, SkImageFilter* input);
|
||||
|
||||
bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
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;
|
||||
|
@ -31,14 +31,14 @@ public:
|
||||
SK_TO_STRING_OVERRIDE()
|
||||
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkXfermodeImageFilter)
|
||||
|
||||
bool onFilterImage(Proxy* proxy,
|
||||
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,
|
||||
bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#endif
|
||||
|
||||
|
@ -1382,7 +1382,7 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y,
|
||||
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(),
|
||||
|
@ -415,7 +415,7 @@ void SkBaseDevice::drawBitmapAsSprite(const SkDraw& draw, const SkBitmap& bitmap
|
||||
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);
|
||||
|
@ -231,7 +231,7 @@ void SkImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeUInt(fCropRect.flags());
|
||||
}
|
||||
|
||||
bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src,
|
||||
bool SkImageFilter::filterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& context,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
SkASSERT(result);
|
||||
@ -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,
|
||||
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,7 +319,7 @@ bool SkImageFilter::canComputeFastBounds() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const Context&,
|
||||
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,
|
||||
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,7 +496,7 @@ SkImageFilter* SkImageFilter::newWithLocalMatrix(const SkMatrix& matrix) const {
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
|
||||
bool SkImageFilter::filterInputGPU(int index, SkImageFilter::Proxy* proxy,
|
||||
bool SkImageFilter::filterInputGPUDeprecated(int index, SkImageFilter::Proxy* proxy,
|
||||
const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
SkImageFilter* input = this->getInput(index);
|
||||
@ -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()) {
|
||||
|
@ -38,10 +38,11 @@ void SkLocalMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeMatrix(fLocalM);
|
||||
}
|
||||
|
||||
bool SkLocalMatrixImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
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,
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
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;
|
||||
|
@ -46,14 +46,14 @@ void SkMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
SkMatrixImageFilter::~SkMatrixImageFilter() {
|
||||
}
|
||||
|
||||
bool SkMatrixImageFilter::onFilterImage(Proxy* proxy,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -44,9 +44,9 @@ protected:
|
||||
SkImageFilter* input);
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* loc) const override;
|
||||
virtual void onFilterNodeBounds(const SkIRect& src, const SkMatrix&,
|
||||
void onFilterNodeBounds(const SkIRect& src, const SkMatrix&,
|
||||
SkIRect* dst, MapDirection) const override;
|
||||
|
||||
private:
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#if SK_SUPPORT_GPU
|
||||
bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
|
||||
@ -331,7 +331,7 @@ void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeRegion(fRegion);
|
||||
}
|
||||
|
||||
bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
||||
bool SkAlphaThresholdFilterImpl::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx, SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
SkASSERT(src.colorType() == kN32_SkColorType);
|
||||
|
@ -69,12 +69,12 @@ static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lo
|
||||
}
|
||||
}
|
||||
|
||||
bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
|
||||
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,
|
||||
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();
|
||||
|
@ -55,13 +55,13 @@ SkColorFilterImageFilter::~SkColorFilterImageFilter() {
|
||||
fColorFilter->unref();
|
||||
}
|
||||
|
||||
bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ void SkComposeImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) con
|
||||
outer->computeFastBounds(tmp, dst);
|
||||
}
|
||||
|
||||
bool SkComposeImageFilter::onFilterImage(Proxy* proxy,
|
||||
bool SkComposeImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
@ -30,7 +30,7 @@ bool SkComposeImageFilter::onFilterImage(Proxy* proxy,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -210,15 +210,15 @@ void SkDisplacementMapEffect::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeScalar(fScale);
|
||||
}
|
||||
|
||||
bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy,
|
||||
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,
|
||||
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,7 +408,7 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
|
||||
return false;
|
||||
}
|
||||
SkIRect displBounds;
|
||||
if (!this->applyCropRect(ctx, proxy, displacementBM,
|
||||
if (!this->applyCropRectDeprecated(ctx, proxy, displacementBM,
|
||||
&displacementOffset, &displBounds, &displacementBM)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -53,13 +53,12 @@ void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeInt(static_cast<int>(fShadowMode));
|
||||
}
|
||||
|
||||
bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
|
||||
bool SkDropShadowImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const
|
||||
{
|
||||
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();
|
||||
|
@ -64,7 +64,7 @@ void SkImageSource::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeImage(fImage);
|
||||
}
|
||||
|
||||
bool SkImageSource::onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
bool SkImageSource::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
SkRect dstRect;
|
||||
ctx.ctm().mapRect(&dstRect, fDstRect);
|
||||
|
@ -355,7 +355,7 @@ protected:
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
bool canFilterImageGPU() const override { return true; }
|
||||
bool filterImageGPU(Proxy*, const SkBitmap& src, const Context&,
|
||||
bool filterImageGPUDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
virtual GrFragmentProcessor* getFragmentProcessor(GrTexture*,
|
||||
const SkMatrix&,
|
||||
@ -393,14 +393,14 @@ void SkLightingImageFilterInternal::drawRect(GrDrawContext* drawContext,
|
||||
drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
|
||||
}
|
||||
|
||||
bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy,
|
||||
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,7 +487,7 @@ 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&,
|
||||
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,
|
||||
@ -515,7 +515,7 @@ 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&,
|
||||
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,
|
||||
@ -1223,14 +1223,14 @@ void SkDiffuseLightingImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeScalar(fKD);
|
||||
}
|
||||
|
||||
bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy,
|
||||
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,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ void SkMagnifierImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeScalar(fInset);
|
||||
}
|
||||
|
||||
bool SkMagnifierImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
||||
bool SkMagnifierImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context&, SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
if ((src.colorType() != kN32_SkColorType) ||
|
||||
|
@ -264,14 +264,14 @@ static SkBitmap unpremultiplyBitmap(SkImageFilter::Proxy* proxy, const SkBitmap&
|
||||
return result;
|
||||
}
|
||||
|
||||
bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ SkMergeImageFilter::~SkMergeImageFilter() {
|
||||
}
|
||||
}
|
||||
|
||||
bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
||||
bool SkMergeImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
int inputCount = this->countInputs();
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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,14 +128,14 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SkErodeImageFilter::onFilterImage(Proxy* proxy,
|
||||
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,
|
||||
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,
|
||||
@ -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,12 +645,14 @@ bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SkDilateImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
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,
|
||||
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);
|
||||
}
|
||||
|
@ -14,14 +14,14 @@
|
||||
#include "SkMatrix.h"
|
||||
#include "SkPaint.h"
|
||||
|
||||
bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ void SkPaintImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writePaint(fPaint);
|
||||
}
|
||||
|
||||
bool SkPaintImageFilter::onFilterImage(Proxy* proxy,
|
||||
bool SkPaintImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
|
@ -84,7 +84,8 @@ void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
}
|
||||
}
|
||||
|
||||
bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const Context& ctx,
|
||||
bool SkPictureImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap&,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
if (!fPicture) {
|
||||
offset->fX = offset->fY = 0;
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool SkDownSampleImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
||||
bool SkDownSampleImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context&,
|
||||
SkBitmap* result, SkIPoint*) const {
|
||||
SkScalar scale = fScale;
|
||||
|
@ -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,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -41,18 +41,18 @@ void SkXfermodeImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeFlattenable(fMode);
|
||||
}
|
||||
|
||||
bool SkXfermodeImageFilter::onFilterImage(Proxy* proxy,
|
||||
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,7 +126,7 @@ bool SkXfermodeImageFilter::canFilterImageGPU() const {
|
||||
|
||||
#include "SkXfermode_proccoeff.h"
|
||||
|
||||
bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
|
||||
bool SkXfermodeImageFilter::filterImageGPUDeprecated(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
@ -134,7 +134,7 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
|
||||
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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
: SkImageFilter(0, nullptr), fReporter(reporter), fExpectedMatrix(expectedMatrix) {
|
||||
}
|
||||
|
||||
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx,
|
||||
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<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 @@ 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);
|
||||
|
@ -369,7 +369,7 @@ 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&,
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
fVisited = true;
|
||||
offset->fX = offset->fY = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user