diff options
author | Matt Sarett <msarett@google.com> | 2017-06-06 10:11:34 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-06 14:34:03 +0000 |
commit | 3928ff8e0b617c3a00eee1963bc31ce5470fba6d (patch) | |
tree | 98bbe9e51b3316c175a8b1ffe1063877ca84eb55 /src/core/SkPixmap.cpp | |
parent | 1608a1dd17187aeeada376e710ecfafb1e229af2 (diff) |
Create an SkColorSpaceXform image generator
This should be immediately useful in the Skia-Android
rendering pipeline.
Possible future uses include creating a "renderable"
SkImage from a bitmap with a funny color space.
Inspired by:
https://skia-review.googlesource.com/c/13981/
Bug: b/62347704
Change-Id: I388c7af1fc43834b8ad22022d0caf3ac90b734c8
Reviewed-on: https://skia-review.googlesource.com/18598
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/core/SkPixmap.cpp')
-rw-r--r-- | src/core/SkPixmap.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp index 02090b77c6..6425b29f92 100644 --- a/src/core/SkPixmap.cpp +++ b/src/core/SkPixmap.cpp @@ -74,8 +74,8 @@ bool SkPixmap::extractSubset(SkPixmap* result, const SkIRect& subset) const { return true; } -bool SkPixmap::readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB, int x, int y) -const { +bool SkPixmap::readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB, int x, int y, + SkTransferFunctionBehavior behavior) const { if (!SkImageInfoValidConversion(dstInfo, fInfo)) { return false; } @@ -88,7 +88,7 @@ const { const void* srcPixels = this->addr(rec.fX, rec.fY); const SkImageInfo srcInfo = fInfo.makeWH(rec.fInfo.width(), rec.fInfo.height()); SkConvertPixels(rec.fInfo, rec.fPixels, rec.fRowBytes, srcInfo, srcPixels, this->rowBytes(), - this->ctable(), SkTransferFunctionBehavior::kRespect); + this->ctable(), behavior); return true; } |