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

Unified Diff: include/core/SkImageFilter.h

Issue 2357273002: Add output format properties to SkImageFilter::Context (Closed)
Patch Set: Made constructor explicit, fixed call sites Created 4 years, 3 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/effects/SkXfermodeImageFilter.h » ('j') | src/core/SkBitmapDevice.cpp » ('J')
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 97f84dc596720a2176869b1e97a63adfcb3c41c1..ad9eb11e88bedcbe22f6aa1e469b56fd334b0269 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -34,22 +34,37 @@ struct SkImageFilterCacheKey;
*/
class SK_API SkImageFilter : public SkFlattenable {
public:
robertphillips 2016/09/21 18:44:09 // Basically copy your CL's comment here - why is
Brian Osman 2016/09/21 19:00:31 Done.
+ class OutputProperties {
+ public:
robertphillips 2016/09/21 18:44:09 can this fit on one line? Maybe a comment here ab
Brian Osman 2016/09/21 19:00:31 Done.
+ explicit OutputProperties(SkColorSpace* colorSpace)
+ : fColorSpace(colorSpace) {}
+
+ SkColorSpace* colorSpace() const { return fColorSpace; }
+
+ private:
+ SkColorSpace* fColorSpace;
+ };
+
class Context {
public:
- Context(const SkMatrix& ctm, const SkIRect& clipBounds, SkImageFilterCache* cache)
+ Context(const SkMatrix& ctm, const SkIRect& clipBounds, SkImageFilterCache* cache,
+ const OutputProperties& outputProperties)
: fCTM(ctm)
, fClipBounds(clipBounds)
, fCache(cache)
+ , fOutputProperties(outputProperties)
{}
const SkMatrix& ctm() const { return fCTM; }
const SkIRect& clipBounds() const { return fClipBounds; }
SkImageFilterCache* cache() const { return fCache; }
+ const OutputProperties& outputProperties() const { return fOutputProperties; }
private:
SkMatrix fCTM;
SkIRect fClipBounds;
SkImageFilterCache* fCache;
+ OutputProperties fOutputProperties;
};
class CropRect {
@@ -130,10 +145,10 @@ public:
MapDirection = kReverse_MapDirection) const;
#if SK_SUPPORT_GPU
- static sk_sp<SkSpecialImage> DrawWithFP(GrContext* context,
+ static sk_sp<SkSpecialImage> DrawWithFP(GrContext* context,
sk_sp<GrFragmentProcessor> fp,
const SkIRect& bounds,
- sk_sp<SkColorSpace> colorSpace);
+ const OutputProperties& outputProperties);
#endif
/**
« no previous file with comments | « no previous file | include/effects/SkXfermodeImageFilter.h » ('j') | src/core/SkBitmapDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698