| Index: include/core/SkImageFilter.h
|
| diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
|
| index 64e1581373d0c6eeb0a3b9e2ed1e4ee4d0d991ea..0c3d4c2ddf4f66a2081591edd42f8b535807236d 100644
|
| --- a/include/core/SkImageFilter.h
|
| +++ b/include/core/SkImageFilter.h
|
| @@ -44,18 +44,31 @@ public:
|
| virtual void purge() {}
|
| };
|
|
|
| + enum SizeConstraint {
|
| + kExact_SizeConstraint,
|
| + kApprox_SizeConstraint,
|
| + };
|
| +
|
| class Context {
|
| public:
|
| - Context(const SkMatrix& ctm, const SkIRect& clipBounds, Cache* cache) :
|
| - fCTM(ctm), fClipBounds(clipBounds), fCache(cache) {
|
| - }
|
| + Context(const SkMatrix& ctm, const SkIRect& clipBounds, Cache* cache,
|
| + SizeConstraint constraint)
|
| + : fCTM(ctm)
|
| + , fClipBounds(clipBounds)
|
| + , fCache(cache)
|
| + , fSizeConstraint(constraint)
|
| + {}
|
| +
|
| const SkMatrix& ctm() const { return fCTM; }
|
| const SkIRect& clipBounds() const { return fClipBounds; }
|
| Cache* cache() const { return fCache; }
|
| + SizeConstraint sizeConstraint() const { return fSizeConstraint; }
|
| +
|
| private:
|
| - SkMatrix fCTM;
|
| - SkIRect fClipBounds;
|
| - Cache* fCache;
|
| + SkMatrix fCTM;
|
| + SkIRect fClipBounds;
|
| + Cache* fCache;
|
| + SizeConstraint fSizeConstraint;
|
| };
|
|
|
| class CropRect {
|
| @@ -255,7 +268,7 @@ public:
|
| // 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;
|
| + SkBitmap* result, SkIPoint* offset, bool relaxSizeConstraint = true) const;
|
| #endif
|
|
|
| SK_TO_STRING_PUREVIRT()
|
| @@ -345,7 +358,7 @@ protected:
|
| // 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;
|
| + SkBitmap* result, SkIPoint* offset, bool relaxSizeConstraint = true) const;
|
|
|
| /**
|
| * Return true (and return a ref'd colorfilter) if this node in the DAG is just a
|
|
|