diff options
author | Matt Sarett <msarett@google.com> | 2017-03-14 09:58:45 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-14 14:42:37 +0000 |
commit | 98629efdde9236e444d7b3fa644eaab3a1301566 (patch) | |
tree | 036460ce6d6a1dbdebc28c7a61553da41b358a6a /src/image/SkImage_Base.h | |
parent | 30a6b81f4b8c08aa3f1fec55935fc736f2684823 (diff) |
Begin implementation of SkImage_Base::makeColorSpace
BUG=skia:
Change-Id: Idf946faa64dad32a28070a430926a8225dbf6e5a
Reviewed-on: https://skia-review.googlesource.com/9622
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/image/SkImage_Base.h')
-rw-r--r-- | src/image/SkImage_Base.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h index e08d7610f7..284af0d1a6 100644 --- a/src/image/SkImage_Base.h +++ b/src/image/SkImage_Base.h @@ -81,14 +81,18 @@ public: fAddedToCache.store(true); } - virtual sk_sp<SkImage> onMakeColorSpace(sk_sp<SkColorSpace>) { - // TODO: Implement this. - return sk_ref_sp(this); - } + // Transforms image into the input color space. + sk_sp<SkImage> makeColorSpace(sk_sp<SkColorSpace> target) const; virtual bool onPinAsTexture(GrContext*) const { return false; } virtual void onUnpinAsTexture(GrContext*) const {} +protected: + virtual sk_sp<SkImage> onMakeColorSpace(sk_sp<SkColorSpace>) const { + // TODO: Make this pure virtual. + return sk_ref_sp(const_cast<SkImage_Base*>(this)); + } + private: // Set true by caches when they cache content that's derived from the current pixels. mutable SkAtomic<bool> fAddedToCache; |