diff options
author | Mike Klein <mtklein@google.com> | 2018-01-12 15:59:53 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-12 16:00:00 +0000 |
commit | 98e38e2ac5e91eb288eaeceb5b0f36f9b2dd412a (patch) | |
tree | 35bac3e36079664a1e2509160548ce2ab076cb0b /src | |
parent | ea560af463c2a791c7c320a81828e5f407360c84 (diff) |
Revert "Revert "fix legacy makeRasterImage()""
This reverts commit ef29e42ef3d81a0e704cf0efcfc9937b531f0327.
Reason for revert: probably not either roll.
Original change's description:
> Revert "fix legacy makeRasterImage()"
>
> This reverts commit 7c4ca043361f6adb3d17a9d3db2397d86bac5a2d.
>
> Reason for revert: layout, cereal tests?
>
> Original change's description:
> > fix legacy makeRasterImage()
> >
> > Passing the color space down into SkImage_Lazy ends up triggering a
> > SkTransferFunctionBehavior::kRespect decode (tf(r*a)), where we want
> > ignore (tf(r)*a) to have any hope of working with the legacy backend.
> >
> > This fix in turn needs another little extension of another old hack in
> > SkImage_Gpu for makeNonTextureImage() to keep working there.
> >
> > Bug: skia:7479
> >
> > Change-Id: If48ca68e95d9eee597f6b10434498049981314ba
> > Reviewed-on: https://skia-review.googlesource.com/93380
> > Commit-Queue: Mike Klein <mtklein@chromium.org>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=mtklein@chromium.org,brianosman@google.com
>
> Change-Id: I65092e01d767ef1fd35563f0b79ceded3c12b267
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:7479
> Reviewed-on: https://skia-review.googlesource.com/93820
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@chromium.org,mtklein@google.com,brianosman@google.com
Change-Id: Ic9b48d311cca152ab2e620363dd4528ed382eb88
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7479
Reviewed-on: https://skia-review.googlesource.com/93960
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/image/SkImage.cpp | 2 | ||||
-rw-r--r-- | src/image/SkImage_Gpu.cpp | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp index e618f7f454..b5d68bf865 100644 --- a/src/image/SkImage.cpp +++ b/src/image/SkImage.cpp @@ -334,7 +334,7 @@ sk_sp<SkImage> SkImage::makeRasterImage() const { } sk_sp<SkData> data = SkData::MakeUninitialized(size); - pm = { info, data->writable_data(), info.minRowBytes() }; + pm = { info.makeColorSpace(nullptr), data->writable_data(), info.minRowBytes() }; if (!this->readPixels(pm, 0, 0)) { return nullptr; } diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index a47587f1bc..e70ba05be5 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -211,9 +211,13 @@ bool SkImage_Gpu::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size // with arbitrary color spaces. Unfortunately, this is one spot where we go from image to // surface (rather than the opposite), and our lenient image rules break our (currently) more // strict surface rules. + // We treat null-dst color space as always equal to fColorSpace for this kind of read-back. sk_sp<SkColorSpace> surfaceColorSpace = fColorSpace; - if (!flags && SkColorSpace::Equals(fColorSpace.get(), dstInfo.colorSpace())) { - surfaceColorSpace = nullptr; + if (!flags) { + if (!dstInfo.colorSpace() || + SkColorSpace::Equals(fColorSpace.get(), dstInfo.colorSpace())) { + surfaceColorSpace = nullptr; + } } sk_sp<GrSurfaceContext> sContext = fContext->contextPriv().makeWrappedSurfaceContext( |