Switch SkLocalMatrixImageFilter over to new onFilterImage interface

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1780233002

Review URL: https://codereview.chromium.org/1780233002
This commit is contained in:
robertphillips 2016-03-23 04:40:01 -07:00 committed by Commit bot
parent 0dfe892489
commit ae2f2de1b8
2 changed files with 9 additions and 11 deletions

View File

@ -23,8 +23,9 @@ SkImageFilter* SkLocalMatrixImageFilter::Create(const SkMatrix& localM, SkImageF
} }
SkLocalMatrixImageFilter::SkLocalMatrixImageFilter(const SkMatrix& localM, SkImageFilter* input) SkLocalMatrixImageFilter::SkLocalMatrixImageFilter(const SkMatrix& localM, SkImageFilter* input)
: INHERITED(1, &input), fLocalM(localM) : INHERITED(1, &input)
{} , fLocalM(localM) {
}
SkFlattenable* SkLocalMatrixImageFilter::CreateProc(SkReadBuffer& buffer) { SkFlattenable* SkLocalMatrixImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
@ -38,11 +39,10 @@ void SkLocalMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
buffer.writeMatrix(fLocalM); buffer.writeMatrix(fLocalM);
} }
bool SkLocalMatrixImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, SkSpecialImage* SkLocalMatrixImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
const Context& ctx, SkIPoint* offset) const {
SkBitmap* result, SkIPoint* offset) const {
Context localCtx(SkMatrix::Concat(ctx.ctm(), fLocalM), ctx.clipBounds(), ctx.cache()); Context localCtx(SkMatrix::Concat(ctx.ctm(), fLocalM), ctx.clipBounds(), ctx.cache());
return this->filterInputDeprecated(0, proxy, src, localCtx, result, offset); return this->filterInput(0, source, localCtx, offset);
} }
SkIRect SkLocalMatrixImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& matrix, SkIRect SkLocalMatrixImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& matrix,

View File

@ -9,8 +9,6 @@
#define SkLocalMatrixImageFilter_DEFINED #define SkLocalMatrixImageFilter_DEFINED
#include "SkImageFilter.h" #include "SkImageFilter.h"
#include "SkReadBuffer.h"
#include "SkString.h"
/** /**
* Wraps another imagefilter + matrix, such that using this filter will give the same result * Wraps another imagefilter + matrix, such that using this filter will give the same result
@ -25,8 +23,8 @@ public:
protected: protected:
void flatten(SkWriteBuffer&) const override; void flatten(SkWriteBuffer&) const override;
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, SkSpecialImage* onFilterImage(SkSpecialImage* source, const Context&,
SkBitmap* result, SkIPoint* offset) const override; SkIPoint* offset) const override;
SkIRect onFilterBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override; SkIRect onFilterBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override;
private: private: