Index: tests/ColorSpaceXformTest.cpp |
diff --git a/tests/ColorSpaceXformTest.cpp b/tests/ColorSpaceXformTest.cpp |
index 464801aa62f88075a225db0fb11dfabf8ca23497..415063d46238797c925e32d6952eacda73f8e24b 100644 |
--- a/tests/ColorSpaceXformTest.cpp |
+++ b/tests/ColorSpaceXformTest.cpp |
@@ -19,7 +19,9 @@ public: |
// Logically we can pass any matrix here. For simplicty, pass I(), i.e. D50 XYZ gamut. |
sk_sp<SkColorSpace> space(new SkColorSpace_Base( |
nullptr, SkColorSpace::kNonStandard_GammaNamed, gammas, SkMatrix::I(), nullptr)); |
- return SkColorSpaceXform::New(space, space); |
+ |
+ // Use special testing entry point, so we don't skip the xform, even though src == dst. |
+ return SlowIdentityXform(space); |
} |
}; |
@@ -37,19 +39,19 @@ static void test_identity_xform(skiatest::Reporter* r, const sk_sp<SkGammas>& ga |
// Create and perform an identity xform. |
std::unique_ptr<SkColorSpaceXform> xform = ColorSpaceXformTest::CreateIdentityXform(gammas); |
- xform->apply(dstPixels, srcPixels, width, kRGBA_8888_SkColorType, kOpaque_SkAlphaType); |
+ xform->apply(dstPixels, srcPixels, width, kN32_SkColorType, kOpaque_SkAlphaType); |
// Since the src->dst matrix is the identity, and the gamma curves match, |
// the pixels should be unchanged. |
for (int i = 0; i < width; i++) { |
REPORTER_ASSERT(r, almost_equal(((srcPixels[i] >> 0) & 0xFF), |
- ((dstPixels[i] >> 0) & 0xFF))); |
+ SkGetPackedR32(dstPixels[i]))); |
REPORTER_ASSERT(r, almost_equal(((srcPixels[i] >> 8) & 0xFF), |
- ((dstPixels[i] >> 8) & 0xFF))); |
+ SkGetPackedG32(dstPixels[i]))); |
REPORTER_ASSERT(r, almost_equal(((srcPixels[i] >> 16) & 0xFF), |
- ((dstPixels[i] >> 16) & 0xFF))); |
+ SkGetPackedB32(dstPixels[i]))); |
REPORTER_ASSERT(r, almost_equal(((srcPixels[i] >> 24) & 0xFF), |
- ((dstPixels[i] >> 24) & 0xFF))); |
+ SkGetPackedA32(dstPixels[i]))); |
} |
} |