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

Side by Side Diff: tests/ColorSpaceTest.cpp

Issue 2304753002: Add SkColorSpacePrimaries to help with making D50 matrices (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix compile bug 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 unified diff | Download patch
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Resources.h" 8 #include "Resources.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkColorSpace.h" 10 #include "SkColorSpace.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 REPORTER_ASSERT(r, !SkColorSpace::Equals(srgb.get(), nullptr)); 264 REPORTER_ASSERT(r, !SkColorSpace::Equals(srgb.get(), nullptr));
265 REPORTER_ASSERT(r, !SkColorSpace::Equals(adobe.get(), srgb.get())); 265 REPORTER_ASSERT(r, !SkColorSpace::Equals(adobe.get(), srgb.get()));
266 REPORTER_ASSERT(r, !SkColorSpace::Equals(z30.get(), srgb.get())); 266 REPORTER_ASSERT(r, !SkColorSpace::Equals(z30.get(), srgb.get()));
267 REPORTER_ASSERT(r, !SkColorSpace::Equals(z32.get(), z30.get())); 267 REPORTER_ASSERT(r, !SkColorSpace::Equals(z32.get(), z30.get()));
268 REPORTER_ASSERT(r, !SkColorSpace::Equals(upperLeft.get(), srgb.get())); 268 REPORTER_ASSERT(r, !SkColorSpace::Equals(upperLeft.get(), srgb.get()));
269 REPORTER_ASSERT(r, !SkColorSpace::Equals(upperLeft.get(), upperRight.get())) ; 269 REPORTER_ASSERT(r, !SkColorSpace::Equals(upperLeft.get(), upperRight.get())) ;
270 REPORTER_ASSERT(r, !SkColorSpace::Equals(z30.get(), upperRight.get())); 270 REPORTER_ASSERT(r, !SkColorSpace::Equals(z30.get(), upperRight.get()));
271 REPORTER_ASSERT(r, !SkColorSpace::Equals(upperRight.get(), adobe.get())); 271 REPORTER_ASSERT(r, !SkColorSpace::Equals(upperRight.get(), adobe.get()));
272 REPORTER_ASSERT(r, !SkColorSpace::Equals(rgb1.get(), rgb2.get())); 272 REPORTER_ASSERT(r, !SkColorSpace::Equals(rgb1.get(), rgb2.get()));
273 } 273 }
274
275 DEF_TEST(ColorSpace_Primaries, r) {
276 // sRGB primaries
277 SkColorSpacePrimaries primaries;
278 primaries.fRX = 0.64f;
279 primaries.fRY = 0.33f;
280 primaries.fGX = 0.30f;
281 primaries.fGY = 0.60f;
282 primaries.fBX = 0.15f;
283 primaries.fBY = 0.06f;
284 primaries.fWX = 0.3127f;
285 primaries.fWY = 0.3290f;
286
287 SkMatrix44 toXYZ(SkMatrix44::kUninitialized_Constructor);
288 bool result = primaries.toXYZD50(&toXYZ);
289 REPORTER_ASSERT(r, result);
290
291 sk_sp<SkColorSpace> space = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderT argetGamma, toXYZ);
292 REPORTER_ASSERT(r, SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) == spac e);
293 }
OLDNEW
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698