diff options
-rw-r--r-- | gm/makeRasterImage.cpp | 15 | ||||
-rw-r--r-- | gn/gm.gni | 1 | ||||
-rw-r--r-- | src/image/SkImage.cpp | 2 | ||||
-rw-r--r-- | src/image/SkImage_Gpu.cpp | 8 |
4 files changed, 3 insertions, 23 deletions
diff --git a/gm/makeRasterImage.cpp b/gm/makeRasterImage.cpp deleted file mode 100644 index 06c1af1d8c..0000000000 --- a/gm/makeRasterImage.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "Resources.h" -#include "SkSurface.h" -#include "gm.h" - -DEF_SIMPLE_GM(makeRasterImage, canvas, 128,128) { - auto img = GetResourceAsImage("images/color_wheel.png"); - canvas->drawImage(img->makeRasterImage(), 0,0); -} @@ -204,7 +204,6 @@ gm_sources = [ "$_gm/localmatriximageshader.cpp", "$_gm/lumafilter.cpp", "$_gm/makecolorspace.cpp", - "$_gm/makeRasterImage.cpp", "$_gm/manypaths.cpp", "$_gm/matrixconvolution.cpp", "$_gm/matriximagefilter.cpp", diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp index b5d68bf865..e618f7f454 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.makeColorSpace(nullptr), data->writable_data(), info.minRowBytes() }; + pm = { info, 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 e70ba05be5..a47587f1bc 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -211,13 +211,9 @@ 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) { - if (!dstInfo.colorSpace() || - SkColorSpace::Equals(fColorSpace.get(), dstInfo.colorSpace())) { - surfaceColorSpace = nullptr; - } + if (!flags && SkColorSpace::Equals(fColorSpace.get(), dstInfo.colorSpace())) { + surfaceColorSpace = nullptr; } sk_sp<GrSurfaceContext> sContext = fContext->contextPriv().makeWrappedSurfaceContext( |