Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(949)

Unified Diff: include/core/SkImageFilter.h

Issue 1421493003: tunnel down texture-size-constraint to imagefilters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix formating Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/gpu/GrTextureProvider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | include/gpu/GrTextureProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698