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

Unified Diff: tests/ColorSpaceXformTest.cpp

Issue 2409383002: Add SkColorSpaceTransferFn to SkColorSpace (Closed)
Patch Set: Add more comments 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 | « tests/ColorSpaceTest.cpp ('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 f792c6a72c643b1704395091ceab283da239038c..0885d588527fc8954d290e16fc29b0781ba4798f 100644
--- a/tests/ColorSpaceXformTest.cpp
+++ b/tests/ColorSpaceXformTest.cpp
@@ -86,12 +86,13 @@ DEF_TEST(ColorSpaceXform_TableGamma, r) {
DEF_TEST(ColorSpaceXform_ParametricGamma, r) {
// Parametric gamma curves
- void* memory = sk_malloc_throw(sizeof(SkGammas) + sizeof(SkGammas::Params));
+ void* memory = sk_malloc_throw(sizeof(SkGammas) + sizeof(SkColorSpaceTransferFn));
sk_sp<SkGammas> gammas = sk_sp<SkGammas>(new (memory) SkGammas());
gammas->fRedType = gammas->fGreenType = gammas->fBlueType = SkGammas::Type::kParam_Type;
gammas->fRedData.fParamOffset = gammas->fGreenData.fParamOffset =
gammas->fBlueData.fParamOffset = 0;
- SkGammas::Params* params = SkTAddOffset<SkGammas::Params>(memory, sizeof(SkGammas));
+ SkColorSpaceTransferFn* params = SkTAddOffset<SkColorSpaceTransferFn>
+ (memory, sizeof(SkGammas));
// Interval, switch xforms at 0.0031308f
params->fD = 0.04045f;
@@ -129,7 +130,7 @@ DEF_TEST(ColorSpaceXform_NamedGamma, r) {
DEF_TEST(ColorSpaceXform_NonMatchingGamma, r) {
constexpr size_t tableSize = 10;
void* memory = sk_malloc_throw(sizeof(SkGammas) + sizeof(float) * tableSize +
- sizeof(SkGammas::Params));
+ sizeof(SkColorSpaceTransferFn));
sk_sp<SkGammas> gammas = sk_sp<SkGammas>(new (memory) SkGammas());
float* table = SkTAddOffset<float>(memory, sizeof(SkGammas));
@@ -144,8 +145,8 @@ DEF_TEST(ColorSpaceXform_NonMatchingGamma, r) {
table[8] = 0.85f;
table[9] = 1.00f;
- SkGammas::Params* params = SkTAddOffset<SkGammas::Params>(memory, sizeof(SkGammas) +
- sizeof(float) * tableSize);
+ SkColorSpaceTransferFn* params = SkTAddOffset<SkColorSpaceTransferFn>(memory,
+ sizeof(SkGammas) + sizeof(float) * tableSize);
params->fA = 1.0f / 1.055f;
params->fB = 0.055f / 1.055f;
params->fC = 0.0f;
« no previous file with comments | « tests/ColorSpaceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698