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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 primaries.fWX = 0.3127f; | 306 primaries.fWX = 0.3127f; |
307 primaries.fWY = 0.3290f; | 307 primaries.fWY = 0.3290f; |
308 | 308 |
309 SkMatrix44 toXYZ(SkMatrix44::kUninitialized_Constructor); | 309 SkMatrix44 toXYZ(SkMatrix44::kUninitialized_Constructor); |
310 bool result = primaries.toXYZD50(&toXYZ); | 310 bool result = primaries.toXYZD50(&toXYZ); |
311 REPORTER_ASSERT(r, result); | 311 REPORTER_ASSERT(r, result); |
312 | 312 |
313 sk_sp<SkColorSpace> space = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderT
argetGamma, toXYZ); | 313 sk_sp<SkColorSpace> space = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderT
argetGamma, toXYZ); |
314 REPORTER_ASSERT(r, SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) == spac
e); | 314 REPORTER_ASSERT(r, SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) == spac
e); |
315 } | 315 } |
| 316 |
| 317 DEF_TEST(ColorSpace_Size, r) { |
| 318 int memory[30]; |
| 319 |
| 320 // NewICC() should fail immediately because the size of the input profile is
larger than |
| 321 // the max size allowed. |
| 322 REPORTER_ASSERT(r, !SkColorSpace::NewICC(memory, (2 << 22) + 1)); |
| 323 } |
OLD | NEW |