Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Unified Diff: tests/ColorSpaceXformTest.cpp

Issue 2390263002: Add SkColorSpaceXform to the public API (Closed)
Patch Set: Remove type on enum Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkColorSpaceXform_Base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ColorSpaceXformTest.cpp
diff --git a/tests/ColorSpaceXformTest.cpp b/tests/ColorSpaceXformTest.cpp
index ed990fc6c4c4c49fd05ddfac8b996d28468cc2a5..f792c6a72c643b1704395091ceab283da239038c 100644
--- a/tests/ColorSpaceXformTest.cpp
+++ b/tests/ColorSpaceXformTest.cpp
@@ -11,7 +11,7 @@
#include "SkColorPriv.h"
#include "SkColorSpace.h"
#include "SkColorSpace_Base.h"
-#include "SkColorSpaceXform.h"
+#include "SkColorSpaceXform_Base.h"
#include "Test.h"
class ColorSpaceXformTest {
@@ -40,8 +40,10 @@ 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, select_xform_format(kN32_SkColorType),
- SkColorSpaceXform::kBGRA_8888_ColorFormat, kOpaque_SkAlphaType);
+ bool result = xform->apply(select_xform_format(kN32_SkColorType), dstPixels,
+ SkColorSpaceXform::kBGRA_8888_ColorFormat, srcPixels, width,
+ kOpaque_SkAlphaType);
+ REPORTER_ASSERT(r, result);
// Since the src->dst matrix is the identity, and the gamma curves match,
// the pixels should be unchanged.
@@ -182,6 +184,8 @@ DEF_TEST(ColorSpaceXform_applyCLUTMemoryAccess, r) {
sk_sp<SkColorSpace> srcSpace = SkColorSpace::NewICC(iccData->bytes(), iccData->size());
sk_sp<SkColorSpace> dstSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
auto xform = SkColorSpaceXform::New(srcSpace.get(), dstSpace.get());
- xform->apply(dst.get(), src.get(), len, SkColorSpaceXform::kRGBA_8888_ColorFormat,
- SkColorSpaceXform::kRGBA_8888_ColorFormat, kUnpremul_SkAlphaType);
+ bool result = xform->apply(SkColorSpaceXform::kRGBA_8888_ColorFormat, dst.get(),
+ SkColorSpaceXform::kRGBA_8888_ColorFormat, src.get(), len,
+ kUnpremul_SkAlphaType);
+ REPORTER_ASSERT(r, result);
}
« no previous file with comments | « src/core/SkColorSpaceXform_Base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698