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,8 +34,8 @@ public:
|
||||
protected:
|
||||
FailImageFilter() : INHERITED(0, nullptr) {}
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -76,8 +76,8 @@ public:
|
||||
protected:
|
||||
IdentityImageFilter(SkImageFilter* input) : INHERITED(1, &input) {}
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
*result = src;
|
||||
offset->set(0, 0);
|
||||
return true;
|
||||
|
@ -39,16 +39,16 @@ public:
|
||||
return new SimpleOffsetFilter(dx, dy, input);
|
||||
}
|
||||
|
||||
virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const override {
|
||||
bool onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const override {
|
||||
SkBitmap source = src;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(0, proxy, src, ctx, &source, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, src, ctx, &source, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SkIRect bounds;
|
||||
if (!this->applyCropRect(ctx, proxy, source, &srcOffset, &bounds, &source)) {
|
||||
if (!this->applyCropRectDeprecated(ctx, proxy, source, &srcOffset, &bounds, &source)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -145,8 +145,8 @@ public:
|
||||
* If the result image cannot be created, return false, in which case both
|
||||
* the result and offset parameters will be ignored by the caller.
|
||||
*/
|
||||
bool filterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
bool filterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
|
||||
enum MapDirection {
|
||||
kForward_MapDirection,
|
||||
@ -185,8 +185,8 @@ public:
|
||||
* relative to the src when it is drawn. The default implementation does
|
||||
* single-pass processing using asFragmentProcessor().
|
||||
*/
|
||||
virtual bool filterImageGPU(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
virtual bool filterImageGPUDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
|
||||
/**
|
||||
* Returns whether this image filter is a color filter and puts the color filter into the
|
||||
@ -267,8 +267,9 @@ public:
|
||||
// has a GPU implementation, it will be invoked directly.
|
||||
// Otherwise, the filter will be processed in software and
|
||||
// uploaded to the GPU.
|
||||
bool filterInputGPU(int index, SkImageFilter::Proxy* proxy, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
bool filterInputGPUDeprecated(int index, SkImageFilter::Proxy* proxy,
|
||||
const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
#endif
|
||||
|
||||
SK_TO_STRING_PUREVIRT()
|
||||
@ -341,8 +342,8 @@ protected:
|
||||
* case both the result and offset parameters will be ignored by the
|
||||
* caller.
|
||||
*/
|
||||
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
virtual bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
|
||||
/**
|
||||
* This function recurses into its inputs with the given clip rect (first
|
||||
@ -379,8 +380,8 @@ protected:
|
||||
// "offset" untouched, and returns true. If the input is non-null, it
|
||||
// calls filterImage() on that input, and returns true on success.
|
||||
// i.e., return !getInput(index) || getInput(index)->filterImage(...);
|
||||
bool filterInput(int index, Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
bool filterInputDeprecated(int index, Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const;
|
||||
|
||||
/**
|
||||
* Return true (and return a ref'd colorfilter) if this node in the DAG is just a
|
||||
@ -410,8 +411,8 @@ protected:
|
||||
* which are not capable of processing a smaller source bitmap into a
|
||||
* larger destination.
|
||||
*/
|
||||
bool applyCropRect(const Context&, Proxy* proxy, const SkBitmap& src, SkIPoint* srcOffset,
|
||||
SkIRect* bounds, SkBitmap* result) const;
|
||||
bool applyCropRectDeprecated(const Context&, Proxy* proxy, const SkBitmap& src,
|
||||
SkIPoint* srcOffset, SkIRect* bounds, SkBitmap* result) const;
|
||||
|
||||
/**
|
||||
* Returns true if the filter can be expressed a single-pass
|
||||
|
@ -28,13 +28,13 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* offset) const override;
|
||||
void onFilterNodeBounds(const SkIRect& src, const SkMatrix&,
|
||||
SkIRect* dst, MapDirection) const override;
|
||||
bool canFilterImageGPU() const override { return true; }
|
||||
bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, SkBitmap* result,
|
||||
SkIPoint* offset) const override;
|
||||
bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
|
||||
private:
|
||||
SkBlurImageFilter(SkScalar sigmaX,
|
||||
|
@ -22,8 +22,8 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
bool onIsColorFilterNode(SkColorFilter**) const override;
|
||||
bool canComputeFastBounds() const override;
|
||||
|
||||
|
@ -34,8 +34,8 @@ protected:
|
||||
SkASSERT(inputs[0]);
|
||||
SkASSERT(inputs[1]);
|
||||
}
|
||||
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* loc) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* loc) const override;
|
||||
bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override;
|
||||
|
||||
private:
|
||||
|
@ -31,11 +31,11 @@ public:
|
||||
|
||||
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDisplacementMapEffect)
|
||||
|
||||
virtual bool onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const override;
|
||||
void computeFastBounds(const SkRect& src, SkRect* dst) const override;
|
||||
|
||||
virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&,
|
||||
@ -44,7 +44,7 @@ public:
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
bool canFilterImageGPU() const override { return true; }
|
||||
virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#endif
|
||||
|
||||
|
@ -33,8 +33,8 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& source, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& source, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
void onFilterNodeBounds(const SkIRect& src, const SkMatrix&,
|
||||
SkIRect* dst, MapDirection) const override;
|
||||
|
||||
|
@ -28,8 +28,8 @@ public:
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
|
||||
private:
|
||||
explicit SkImageSource(const SkImage*);
|
||||
|
@ -23,8 +23,8 @@ protected:
|
||||
SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter* input);
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#if SK_SUPPORT_GPU
|
||||
bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
|
||||
const SkIRect& bounds) const override;
|
||||
|
@ -77,8 +77,8 @@ protected:
|
||||
const CropRect* cropRect);
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* loc) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* loc) const override;
|
||||
void onFilterNodeBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override;
|
||||
bool canComputeFastBounds() const override;
|
||||
|
||||
|
@ -35,8 +35,8 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
|
||||
private:
|
||||
SkMergeImageFilter(SkImageFilter* filters[], int count, const SkXfermode::Mode modes[],
|
||||
|
@ -60,12 +60,12 @@ public:
|
||||
return new SkDilateImageFilter(radiusX, radiusY, input, cropRect);
|
||||
}
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#endif
|
||||
|
||||
SK_TO_STRING_OVERRIDE()
|
||||
@ -89,12 +89,12 @@ public:
|
||||
return new SkErodeImageFilter(radiusX, radiusY, input, cropRect);
|
||||
}
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#endif
|
||||
|
||||
SK_TO_STRING_OVERRIDE()
|
||||
|
@ -28,8 +28,8 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
void onFilterNodeBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override;
|
||||
|
||||
private:
|
||||
|
@ -31,8 +31,8 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
|
||||
private:
|
||||
SkPaintImageFilter(const SkPaint& paint, const CropRect* rect);
|
||||
|
@ -61,8 +61,8 @@ protected:
|
||||
* @param SkReadBuffer Serialized picture data.
|
||||
*/
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* offset) const override;
|
||||
|
||||
private:
|
||||
explicit SkPictureImageFilter(const SkPicture* picture);
|
||||
|
@ -30,8 +30,8 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result,
|
||||
SkIPoint* loc) const override;
|
||||
|
||||
private:
|
||||
SkDownSampleImageFilter(SkScalar scale, SkImageFilter* input)
|
||||
|
@ -21,8 +21,8 @@ public:
|
||||
*/
|
||||
static SkImageFilter* Create(const SkRect& src, const SkRect& dst, SkImageFilter* input);
|
||||
|
||||
bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const override;
|
||||
bool onFilterBounds(const SkIRect& src, const SkMatrix&,
|
||||
SkIRect* dst, MapDirection) const override;
|
||||
void onFilterNodeBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override;
|
||||
|
@ -31,15 +31,15 @@ public:
|
||||
SK_TO_STRING_OVERRIDE()
|
||||
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkXfermodeImageFilter)
|
||||
|
||||
bool onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const override;
|
||||
#if SK_SUPPORT_GPU
|
||||
bool canFilterImageGPU() const override;
|
||||
bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
@ -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,9 +231,9 @@ void SkImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeUInt(fCropRect.flags());
|
||||
}
|
||||
|
||||
bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& context,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkImageFilter::filterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& context,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
SkASSERT(result);
|
||||
SkASSERT(offset);
|
||||
uint32_t srcGenID = fUsesSrcInput ? src.getGenerationID() : 0;
|
||||
@ -248,7 +248,7 @@ bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src,
|
||||
* the filter to do it.
|
||||
*/
|
||||
if ((proxy && proxy->filterImage(this, src, context, result, offset)) ||
|
||||
this->onFilterImage(proxy, src, context, result, offset)) {
|
||||
this->onFilterImageDeprecated(proxy, src, context, result, offset)) {
|
||||
if (context.cache()) {
|
||||
context.cache()->set(key, *result, *offset);
|
||||
SkAutoMutexAcquire mutex(fMutex);
|
||||
@ -259,14 +259,14 @@ bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SkImageFilter::filterInput(int index, Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkImageFilter::filterInputDeprecated(int index, Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
SkImageFilter* input = this->getInput(index);
|
||||
if (!input) {
|
||||
return true;
|
||||
}
|
||||
return input->filterImage(proxy, src, this->mapContext(ctx), result, offset);
|
||||
return input->filterImageDeprecated(proxy, src, this->mapContext(ctx), result, offset);
|
||||
}
|
||||
|
||||
bool SkImageFilter::filterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst,
|
||||
@ -319,8 +319,8 @@ bool SkImageFilter::canComputeFastBounds() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const Context&,
|
||||
SkBitmap*, SkIPoint*) const {
|
||||
bool SkImageFilter::onFilterImageDeprecated(Proxy*, const SkBitmap&, const Context&,
|
||||
SkBitmap*, SkIPoint*) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -328,18 +328,18 @@ bool SkImageFilter::canFilterImageGPU() const {
|
||||
return this->asFragmentProcessor(nullptr, nullptr, SkMatrix::I(), SkIRect());
|
||||
}
|
||||
|
||||
bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkImageFilter::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
#if SK_SUPPORT_GPU
|
||||
SkBitmap input = src;
|
||||
SkASSERT(fInputCount == 1);
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) {
|
||||
if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &input, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
GrTexture* srcTexture = input.getTexture();
|
||||
SkIRect bounds;
|
||||
if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &bounds, &input)) {
|
||||
if (!this->applyCropRectDeprecated(ctx, proxy, input, &srcOffset, &bounds, &input)) {
|
||||
return false;
|
||||
}
|
||||
GrContext* context = srcTexture->getContext();
|
||||
@ -406,8 +406,9 @@ bool SkImageFilter::applyCropRect(const Context& ctx, const SkIRect& srcBounds,
|
||||
return dstBounds->intersect(ctx.clipBounds());
|
||||
}
|
||||
|
||||
bool SkImageFilter::applyCropRect(const Context& ctx, Proxy* proxy, const SkBitmap& src,
|
||||
SkIPoint* srcOffset, SkIRect* bounds, SkBitmap* dst) const {
|
||||
bool SkImageFilter::applyCropRectDeprecated(const Context& ctx, Proxy* proxy, const SkBitmap& src,
|
||||
SkIPoint* srcOffset, SkIRect* bounds,
|
||||
SkBitmap* dst) const {
|
||||
SkIRect srcBounds;
|
||||
src.getBounds(&srcBounds);
|
||||
srcBounds.offset(*srcOffset);
|
||||
@ -495,9 +496,9 @@ SkImageFilter* SkImageFilter::newWithLocalMatrix(const SkMatrix& matrix) const {
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
|
||||
bool SkImageFilter::filterInputGPU(int index, SkImageFilter::Proxy* proxy,
|
||||
const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkImageFilter::filterInputGPUDeprecated(int index, SkImageFilter::Proxy* proxy,
|
||||
const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
SkImageFilter* input = this->getInput(index);
|
||||
if (!input) {
|
||||
return true;
|
||||
@ -506,7 +507,7 @@ bool SkImageFilter::filterInputGPU(int index, SkImageFilter::Proxy* proxy,
|
||||
// matrix with no clip and that the matrix, clip, and render target set before this function was
|
||||
// called are restored before we return to the caller.
|
||||
GrContext* context = src.getTexture()->getContext();
|
||||
if (input->filterImage(proxy, src, this->mapContext(ctx), result, offset)) {
|
||||
if (input->filterImageDeprecated(proxy, src, this->mapContext(ctx), result, offset)) {
|
||||
if (!result->getTexture()) {
|
||||
const SkImageInfo info = result->info();
|
||||
if (kUnknown_SkColorType == info.colorType()) {
|
||||
|
@ -38,10 +38,11 @@ void SkLocalMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeMatrix(fLocalM);
|
||||
}
|
||||
|
||||
bool SkLocalMatrixImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkLocalMatrixImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
Context localCtx(SkMatrix::Concat(ctx.ctm(), fLocalM), ctx.clipBounds(), ctx.cache());
|
||||
return this->filterInput(0, proxy, src, localCtx, result, offset);
|
||||
return this->filterInputDeprecated(0, proxy, src, localCtx, result, offset);
|
||||
}
|
||||
|
||||
bool SkLocalMatrixImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& matrix,
|
||||
|
@ -25,8 +25,8 @@ public:
|
||||
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool onFilterBounds(const SkIRect& src, const SkMatrix&, SkIRect* dst,
|
||||
MapDirection) const override;
|
||||
|
||||
|
@ -46,14 +46,14 @@ void SkMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
SkMatrixImageFilter::~SkMatrixImageFilter() {
|
||||
}
|
||||
|
||||
bool SkMatrixImageFilter::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
bool SkMatrixImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap src = source;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -44,10 +44,10 @@ protected:
|
||||
SkImageFilter* input);
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* loc) const override;
|
||||
virtual void onFilterNodeBounds(const SkIRect& src, const SkMatrix&,
|
||||
SkIRect* dst, MapDirection) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* loc) const override;
|
||||
void onFilterNodeBounds(const SkIRect& src, const SkMatrix&,
|
||||
SkIRect* dst, MapDirection) const override;
|
||||
|
||||
private:
|
||||
SkMatrix fTransform;
|
||||
|
@ -27,8 +27,8 @@ public:
|
||||
protected:
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#if SK_SUPPORT_GPU
|
||||
bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
|
||||
const SkIRect& bounds) const override;
|
||||
@ -331,9 +331,9 @@ void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeRegion(fRegion);
|
||||
}
|
||||
|
||||
bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx, SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
bool SkAlphaThresholdFilterImpl::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx, SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
SkASSERT(src.colorType() == kN32_SkColorType);
|
||||
|
||||
if (src.colorType() != kN32_SkColorType) {
|
||||
|
@ -69,12 +69,12 @@ static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lo
|
||||
}
|
||||
}
|
||||
|
||||
bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& source, const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const {
|
||||
bool SkBlurImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& source, const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const {
|
||||
SkBitmap src = source;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -198,12 +198,13 @@ void SkBlurImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& c
|
||||
SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3))));
|
||||
}
|
||||
|
||||
bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkBlurImageFilter::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
#if SK_SUPPORT_GPU
|
||||
SkBitmap input = src;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) {
|
||||
if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &input, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
SkIRect srcBounds = input.bounds();
|
||||
|
@ -55,13 +55,13 @@ SkColorFilterImageFilter::~SkColorFilterImageFilter() {
|
||||
fColorFilter->unref();
|
||||
}
|
||||
|
||||
bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
bool SkColorFilterImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap src = source;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -22,15 +22,15 @@ void SkComposeImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) con
|
||||
outer->computeFastBounds(tmp, dst);
|
||||
}
|
||||
|
||||
bool SkComposeImageFilter::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
bool SkComposeImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap tmp;
|
||||
SkIPoint innerOffset = SkIPoint::Make(0, 0);
|
||||
SkIPoint outerOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(1, proxy, src, ctx, &tmp, &innerOffset))
|
||||
if (!this->filterInputDeprecated(1, proxy, src, ctx, &tmp, &innerOffset))
|
||||
return false;
|
||||
|
||||
SkMatrix outerMatrix(ctx.ctm());
|
||||
@ -38,7 +38,7 @@ bool SkComposeImageFilter::onFilterImage(Proxy* proxy,
|
||||
SkIRect clipBounds = ctx.clipBounds();
|
||||
clipBounds.offset(-innerOffset.x(), -innerOffset.y());
|
||||
Context outerContext(outerMatrix, clipBounds, ctx.cache());
|
||||
if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, tmp, outerContext, result, &outerOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -210,15 +210,15 @@ void SkDisplacementMapEffect::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeScalar(fScale);
|
||||
}
|
||||
|
||||
bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
bool SkDisplacementMapEffect::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap displ = src, color = src;
|
||||
SkIPoint colorOffset = SkIPoint::Make(0, 0), displOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(1, proxy, src, ctx, &color, &colorOffset) ||
|
||||
!this->filterInput(0, proxy, src, ctx, &displ, &displOffset)) {
|
||||
if (!this->filterInputDeprecated(1, proxy, src, ctx, &color, &colorOffset) ||
|
||||
!this->filterInputDeprecated(0, proxy, src, ctx, &displ, &displOffset)) {
|
||||
return false;
|
||||
}
|
||||
if ((displ.colorType() != kN32_SkColorType) ||
|
||||
@ -234,7 +234,7 @@ bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy,
|
||||
return false;
|
||||
}
|
||||
SkIRect displBounds;
|
||||
if (!this->applyCropRect(ctx, proxy, displ, &displOffset, &displBounds, &displ)) {
|
||||
if (!this->applyCropRectDeprecated(ctx, proxy, displ, &displOffset, &displBounds, &displ)) {
|
||||
return false;
|
||||
}
|
||||
if (!bounds.intersect(displBounds)) {
|
||||
@ -386,16 +386,17 @@ private:
|
||||
typedef GrFragmentProcessor INHERITED;
|
||||
};
|
||||
|
||||
bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkDisplacementMapEffect::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
SkBitmap colorBM = src;
|
||||
SkIPoint colorOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInputGPU(1, proxy, src, ctx, &colorBM, &colorOffset)) {
|
||||
if (!this->filterInputGPUDeprecated(1, proxy, src, ctx, &colorBM, &colorOffset)) {
|
||||
return false;
|
||||
}
|
||||
SkBitmap displacementBM = src;
|
||||
SkIPoint displacementOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInputGPU(0, proxy, src, ctx, &displacementBM, &displacementOffset)) {
|
||||
if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &displacementBM, &displacementOffset)) {
|
||||
return false;
|
||||
}
|
||||
SkIRect srcBounds = colorBM.bounds();
|
||||
@ -407,8 +408,8 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
|
||||
return false;
|
||||
}
|
||||
SkIRect displBounds;
|
||||
if (!this->applyCropRect(ctx, proxy, displacementBM,
|
||||
&displacementOffset, &displBounds, &displacementBM)) {
|
||||
if (!this->applyCropRectDeprecated(ctx, proxy, displacementBM,
|
||||
&displacementOffset, &displBounds, &displacementBM)) {
|
||||
return false;
|
||||
}
|
||||
if (!bounds.intersect(displBounds)) {
|
||||
|
@ -53,13 +53,12 @@ void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
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();
|
||||
|
@ -64,8 +64,8 @@ void SkImageSource::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeImage(fImage);
|
||||
}
|
||||
|
||||
bool SkImageSource::onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkImageSource::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
SkRect dstRect;
|
||||
ctx.ctm().mapRect(&dstRect, fDstRect);
|
||||
SkRect bounds = SkRect::MakeIWH(fImage->width(), fImage->height());
|
||||
|
@ -355,8 +355,8 @@ protected:
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
bool canFilterImageGPU() const override { return true; }
|
||||
bool filterImageGPU(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool filterImageGPUDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
virtual GrFragmentProcessor* getFragmentProcessor(GrTexture*,
|
||||
const SkMatrix&,
|
||||
const SkIRect* srcBounds,
|
||||
@ -393,14 +393,14 @@ void SkLightingImageFilterInternal::drawRect(GrDrawContext* drawContext,
|
||||
drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
|
||||
}
|
||||
|
||||
bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
bool SkLightingImageFilterInternal::filterImageGPUDeprecated(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap input = src;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) {
|
||||
if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &input, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
SkIRect srcBounds = input.bounds();
|
||||
@ -487,8 +487,8 @@ protected:
|
||||
SkDiffuseLightingImageFilter(SkImageFilterLight* light, SkScalar surfaceScale,
|
||||
SkScalar kd, SkImageFilter* input, const CropRect* cropRect);
|
||||
void flatten(SkWriteBuffer& buffer) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#if SK_SUPPORT_GPU
|
||||
GrFragmentProcessor* getFragmentProcessor(GrTexture*, const SkMatrix&, const SkIRect* bounds,
|
||||
BoundaryMode) const override;
|
||||
@ -515,8 +515,8 @@ protected:
|
||||
SkSpecularLightingImageFilter(SkImageFilterLight* light, SkScalar surfaceScale, SkScalar ks,
|
||||
SkScalar shininess, SkImageFilter* input, const CropRect*);
|
||||
void flatten(SkWriteBuffer& buffer) const override;
|
||||
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override;
|
||||
#if SK_SUPPORT_GPU
|
||||
GrFragmentProcessor* getFragmentProcessor(GrTexture*, const SkMatrix&, const SkIRect* bounds,
|
||||
BoundaryMode) const override;
|
||||
@ -1223,14 +1223,14 @@ void SkDiffuseLightingImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeScalar(fKD);
|
||||
}
|
||||
|
||||
bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
bool SkDiffuseLightingImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap src = source;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1367,14 +1367,14 @@ void SkSpecularLightingImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeScalar(fShininess);
|
||||
}
|
||||
|
||||
bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
bool SkSpecularLightingImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap src = source;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -294,9 +294,9 @@ void SkMagnifierImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeScalar(fInset);
|
||||
}
|
||||
|
||||
bool SkMagnifierImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
||||
const Context&, SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
bool SkMagnifierImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context&, SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
if ((src.colorType() != kN32_SkColorType) ||
|
||||
(fSrcRect.width() >= src.width()) ||
|
||||
(fSrcRect.height() >= src.height())) {
|
||||
|
@ -264,14 +264,14 @@ static SkBitmap unpremultiplyBitmap(SkImageFilter::Proxy* proxy, const SkBitmap&
|
||||
return result;
|
||||
}
|
||||
|
||||
bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
bool SkMatrixConvolutionImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap src = source;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -280,7 +280,8 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy,
|
||||
}
|
||||
|
||||
SkIRect bounds;
|
||||
if (!this->applyCropRect(this->mapContext(ctx), proxy, src, &srcOffset, &bounds, &src)) {
|
||||
if (!this->applyCropRectDeprecated(this->mapContext(ctx), proxy, src, &srcOffset,
|
||||
&bounds, &src)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -55,9 +55,9 @@ SkMergeImageFilter::~SkMergeImageFilter() {
|
||||
}
|
||||
}
|
||||
|
||||
bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkMergeImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
int inputCount = this->countInputs();
|
||||
if (inputCount < 1) {
|
||||
return false;
|
||||
@ -73,7 +73,7 @@ bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
||||
for (int i = 0; i < inputCount; ++i) {
|
||||
inputs[i] = src;
|
||||
offsets[i].setZero();
|
||||
if (!this->filterInput(i, proxy, src, ctx, &inputs[i], &offsets[i])) {
|
||||
if (!this->filterInputDeprecated(i, proxy, src, ctx, &inputs[i], &offsets[i])) {
|
||||
inputs[i].reset();
|
||||
continue;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap src = source;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -71,7 +71,8 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p
|
||||
}
|
||||
|
||||
SkIRect bounds;
|
||||
if (!this->applyCropRect(this->mapContext(ctx), proxy, src, &srcOffset, &bounds, &src)) {
|
||||
if (!this->applyCropRectDeprecated(this->mapContext(ctx), proxy, src, &srcOffset,
|
||||
&bounds, &src)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -127,16 +128,16 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SkErodeImageFilter::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& source, const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const {
|
||||
bool SkErodeImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& source, const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const {
|
||||
return this->filterImageGeneric(SkOpts::erode_x, SkOpts::erode_y,
|
||||
proxy, source, ctx, dst, offset);
|
||||
}
|
||||
|
||||
bool SkDilateImageFilter::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& source, const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const {
|
||||
bool SkDilateImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& source, const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const {
|
||||
return this->filterImageGeneric(SkOpts::dilate_x, SkOpts::dilate_y,
|
||||
proxy, source, ctx, dst, offset);
|
||||
}
|
||||
@ -607,11 +608,12 @@ bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap input = src;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) {
|
||||
if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &input, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
SkIRect bounds;
|
||||
if (!this->applyCropRect(this->mapContext(ctx), proxy, input, &srcOffset, &bounds, &input)) {
|
||||
if (!this->applyCropRectDeprecated(this->mapContext(ctx), proxy, input, &srcOffset,
|
||||
&bounds, &input)) {
|
||||
return false;
|
||||
}
|
||||
SkVector radius = SkVector::Make(SkIntToScalar(this->radius().width()),
|
||||
@ -643,13 +645,15 @@ bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SkDilateImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkDilateImageFilter::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset);
|
||||
}
|
||||
|
||||
bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkErodeImageFilter::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset);
|
||||
}
|
||||
|
||||
|
@ -14,14 +14,14 @@
|
||||
#include "SkMatrix.h"
|
||||
#include "SkPaint.h"
|
||||
|
||||
bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
bool SkOffsetImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap src = source;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!cropRectIsSet()) {
|
||||
if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
|
||||
offset->fY = srcOffset.fY + SkScalarRoundToInt(vec.fY);
|
||||
*result = src;
|
||||
} else {
|
||||
if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, source, ctx, &src, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -33,11 +33,11 @@ void SkPaintImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writePaint(fPaint);
|
||||
}
|
||||
|
||||
bool SkPaintImageFilter::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
bool SkPaintImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& source,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
SkIRect bounds;
|
||||
if (!this->applyCropRect(ctx, source.bounds(), &bounds)) {
|
||||
return false;
|
||||
|
@ -84,8 +84,9 @@ void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
}
|
||||
}
|
||||
|
||||
bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
bool SkPictureImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap&,
|
||||
const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const {
|
||||
if (!fPicture) {
|
||||
offset->fX = offset->fY = 0;
|
||||
return true;
|
||||
|
@ -27,9 +27,9 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool SkDownSampleImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
||||
const Context&,
|
||||
SkBitmap* result, SkIPoint*) const {
|
||||
bool SkDownSampleImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context&,
|
||||
SkBitmap* result, SkIPoint*) const {
|
||||
SkScalar scale = fScale;
|
||||
if (scale > SK_Scalar1 || scale <= 0) {
|
||||
return false;
|
||||
|
@ -35,12 +35,12 @@ SkImageFilter* SkTileImageFilter::Create(const SkRect& srcRect, const SkRect& ds
|
||||
return new SkTileImageFilter(srcRect, dstRect, input);
|
||||
}
|
||||
|
||||
bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const {
|
||||
bool SkTileImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst, SkIPoint* offset) const {
|
||||
SkBitmap source = src;
|
||||
SkIPoint srcOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(0, proxy, src, ctx, &source, &srcOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, src, ctx, &source, &srcOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -41,18 +41,18 @@ void SkXfermodeImageFilter::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeFlattenable(fMode);
|
||||
}
|
||||
|
||||
bool SkXfermodeImageFilter::onFilterImage(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
bool SkXfermodeImageFilter::onFilterImageDeprecated(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* dst,
|
||||
SkIPoint* offset) const {
|
||||
SkBitmap background = src, foreground = src;
|
||||
SkIPoint backgroundOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(0, proxy, src, ctx, &background, &backgroundOffset)) {
|
||||
if (!this->filterInputDeprecated(0, proxy, src, ctx, &background, &backgroundOffset)) {
|
||||
background.reset();
|
||||
}
|
||||
SkIPoint foregroundOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInput(1, proxy, src, ctx, &foreground, &foregroundOffset)) {
|
||||
if (!this->filterInputDeprecated(1, proxy, src, ctx, &foreground, &foregroundOffset)) {
|
||||
foreground.reset();
|
||||
}
|
||||
|
||||
@ -126,15 +126,15 @@ bool SkXfermodeImageFilter::canFilterImageGPU() const {
|
||||
|
||||
#include "SkXfermode_proccoeff.h"
|
||||
|
||||
bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
bool SkXfermodeImageFilter::filterImageGPUDeprecated(Proxy* proxy,
|
||||
const SkBitmap& src,
|
||||
const Context& ctx,
|
||||
SkBitmap* result,
|
||||
SkIPoint* offset) const {
|
||||
GrContext* context = nullptr;
|
||||
SkBitmap background = src;
|
||||
SkIPoint backgroundOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInputGPU(0, proxy, src, ctx, &background, &backgroundOffset)) {
|
||||
if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &background, &backgroundOffset)) {
|
||||
background.reset();
|
||||
}
|
||||
GrTexture* backgroundTex = background.getTexture();
|
||||
@ -144,7 +144,7 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
|
||||
|
||||
SkBitmap foreground = src;
|
||||
SkIPoint foregroundOffset = SkIPoint::Make(0, 0);
|
||||
if (!this->filterInputGPU(1, proxy, src, ctx, &foreground, &foregroundOffset)) {
|
||||
if (!this->filterInputGPUDeprecated(1, proxy, src, ctx, &foreground, &foregroundOffset)) {
|
||||
foreground.reset();
|
||||
}
|
||||
GrTexture* foregroundTex = foreground.getTexture();
|
||||
|
@ -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,8 +53,8 @@ public:
|
||||
: SkImageFilter(0, nullptr), fReporter(reporter), fExpectedMatrix(expectedMatrix) {
|
||||
}
|
||||
|
||||
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix);
|
||||
return true;
|
||||
}
|
||||
@ -321,8 +321,10 @@ static void test_crop_rects(SkImageFilter::Proxy* proxy, skiatest::Reporter* rep
|
||||
SkString str;
|
||||
str.printf("filter %d", static_cast<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,8 +369,8 @@ class DummyImageFilter : public SkImageFilter {
|
||||
public:
|
||||
DummyImageFilter(bool visited = false) : SkImageFilter(0, nullptr), fVisited(visited) {}
|
||||
~DummyImageFilter() override {}
|
||||
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
|
||||
SkBitmap* result, SkIPoint* offset) const override {
|
||||
fVisited = true;
|
||||
offset->fX = offset->fY = 0;
|
||||
*result = src;
|
||||
|
Loading…
Reference in New Issue
Block a user