aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image
diff options
context:
space:
mode:
authorGravatar Eric Boren <borenet@google.com>2017-03-17 11:18:17 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-17 11:52:14 +0000
commit73e21af21390c2806eb1350253233903808edd6b (patch)
treee917327a738134cbf0936f4788da6c05509aaf1f /src/image
parent14583e11fd622c686993b741499060a6f3527055 (diff)
Revert "Add color spin test for SkColorSpaceXformCanvas"
This reverts commit cb01aec63bcb3dee52afcf3605bcd64166b873c0. Reason for revert: Breaks Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE Original change's description: > Add color spin test for SkColorSpaceXformCanvas > > Also changes behavior to treat nullptr srcs as sRGB. > > Testing locally, it looks like 353 gms have no diffs from 8888. > There are 269 diffs - some are fine (gms that do color space stuff) > and some are bugs. > > BUG=skia: > > Change-Id: I55c2825f4f4b857e0b0a0ec050c6db82ac881492 > Reviewed-on: https://skia-review.googlesource.com/9738 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reviews@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. BUG=skia: Change-Id: I70bb69f747b863d267494e37a60888a51ab0184c Reviewed-on: https://skia-review.googlesource.com/9823 Reviewed-by: Eric Boren <borenet@google.com> Commit-Queue: Eric Boren <borenet@google.com>
Diffstat (limited to 'src/image')
-rw-r--r--src/image/SkImage.cpp5
-rw-r--r--src/image/SkImage_Gpu.cpp3
-rw-r--r--src/image/SkImage_Raster.cpp5
3 files changed, 2 insertions, 11 deletions
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 99b0be161b..2a83eaf0ed 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -8,7 +8,6 @@
#include "SkBitmap.h"
#include "SkBitmapCache.h"
#include "SkCanvas.h"
-#include "SkColorSpace_Base.h"
#include "SkCrossContextImageData.h"
#include "SkData.h"
#include "SkImageEncoder.h"
@@ -319,9 +318,7 @@ sk_sp<SkImage> SkImage_Base::makeColorSpace(sk_sp<SkColorSpace> target) const {
return nullptr;
}
- // Be sure to treat nullptr srcs as "equal to" sRGB.
- if ((!this->colorSpace() && target->isSRGB()) ||
- SkColorSpace_Base::EqualsIgnoreFlags(this->colorSpace(), target.get())) {
+ if (!this->colorSpace() || SkColorSpace::Equals(this->colorSpace(), target.get())) {
return sk_ref_sp(const_cast<SkImage_Base*>(this));
}
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 10a8c0d7ef..b8d9dea951 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -848,8 +848,7 @@ sk_sp<SkImage> SkImage::MakeTextureFromMipMap(GrContext* ctx, const SkImageInfo&
}
sk_sp<SkImage> SkImage_Gpu::onMakeColorSpace(sk_sp<SkColorSpace> colorSpace) const {
- sk_sp<SkColorSpace> srcSpace = fColorSpace ? fColorSpace : SkColorSpace::MakeSRGB();
- auto xform = GrNonlinearColorSpaceXformEffect::Make(srcSpace.get(), colorSpace.get());
+ auto xform = GrNonlinearColorSpaceXformEffect::Make(fColorSpace.get(), colorSpace.get());
if (!xform) {
return sk_ref_sp(const_cast<SkImage_Gpu*>(this));
}
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index be825c64a7..40bb825839 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -382,11 +382,6 @@ sk_sp<SkImage> SkImage_Raster::onMakeColorSpace(sk_sp<SkColorSpace> target) cons
SkPixmap src;
SkAssertResult(this->onPeekPixels(&src));
- // Treat nullptr srcs as sRGB.
- if (!src.colorSpace()) {
- src.setColorSpace(SkColorSpace::MakeSRGB());
- }
-
SkAssertResult(dst.writePixels(src));
dst.setImmutable();
return SkImage::MakeFromBitmap(dst);