Revert "call skcms_OptimizeForSpeed()"

This reverts commit 3b8feb331a.

Reason for revert: darks too bright

Original change's description:
> call skcms_OptimizeForSpeed()
> 
> I've guarded src and dst separately, so that we can land,
> rebaseline just the src change, and then later (when it
> does something), rebaseline optimizing dst separately.
> 
> Small threshold tweak to keep a unit test passing.
> 
> Change-Id: I57cc43c54b6065f58fa8f9448ea1d73fc42505f0
> Reviewed-on: https://skia-review.googlesource.com/123181
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=mtklein@chromium.org,brianosman@google.com

Change-Id: I23e59d4dc711e8b112e70f31a5c9abad67551bcd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/123361
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2018-04-24 00:10:58 +00:00 committed by Skia Commit-Bot
parent 0f5972604c
commit 1b4ad0d1eb
2 changed files with 4 additions and 11 deletions

View File

@ -19,14 +19,6 @@ public:
, fDstProfile(dstProfile)
, fPremulFormat(premulFormat) {
skcms_EnsureUsableAsDestination(&fDstProfile, &skcms_sRGB_profile);
#ifndef SK_DONT_OPTIMIZE_SRC_PROFILES_FOR_SPEED
skcms_OptimizeForSpeed(&fSrcProfile);
#endif
#ifndef SK_DONT_OPTIMIZE_DST_PROFILES_FOR_SPEED
// (This doesn't do anything yet, but we'd sure like it to.)
skcms_OptimizeForSpeed(&fDstProfile);
#endif
}
bool apply(ColorFormat, void*, ColorFormat, const void*, int, SkAlphaType) const override;

View File

@ -1126,6 +1126,10 @@ static sk_sp<SkImage> create_picture_image(sk_sp<SkColorSpace> space) {
nullptr, nullptr, SkImage::BitDepth::kU8, std::move(space));
};
static inline bool almost_equal(int a, int b) {
return SkTAbs(a - b) <= 1;
}
DEF_TEST(Image_ColorSpace, r) {
sk_sp<SkColorSpace> srgb = SkColorSpace::MakeSRGB();
sk_sp<SkImage> image = GetResourceAsImage("images/mandrill_512_q075.jpg");
@ -1173,9 +1177,6 @@ DEF_TEST(Image_makeColorSpace, r) {
sk_sp<SkImage> p3Image = srgbImage->makeColorSpace(p3, SkTransferFunctionBehavior::kIgnore);
SkBitmap p3Bitmap;
bool success = p3Image->asLegacyBitmap(&p3Bitmap);
auto almost_equal = [](int a, int b) { return SkTAbs(a - b) <= 2; };
REPORTER_ASSERT(r, success);
REPORTER_ASSERT(r, almost_equal(0x28, SkGetPackedR32(*p3Bitmap.getAddr32(0, 0))));
REPORTER_ASSERT(r, almost_equal(0x40, SkGetPackedG32(*p3Bitmap.getAddr32(0, 0))));