OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |