OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkRect.h" | 9 #include "SkRect.h" |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 for (size_t copyCase = 0; copyCase < SK_ARRAY_COUNT(isExtracted); | 329 for (size_t copyCase = 0; copyCase < SK_ARRAY_COUNT(isExtracted); |
330 ++copyCase) { | 330 ++copyCase) { |
331 // Test copying to/from external buffer. | 331 // Test copying to/from external buffer. |
332 // Note: the tests below have hard-coded values --- | 332 // Note: the tests below have hard-coded values --- |
333 // Please take care if modifying. | 333 // Please take care if modifying. |
334 | 334 |
335 // Tests for getSafeSize64(). | 335 // Tests for getSafeSize64(). |
336 // Test with a very large configuration without pixel buffer | 336 // Test with a very large configuration without pixel buffer |
337 // attached. | 337 // attached. |
338 SkBitmap tstSafeSize; | 338 SkBitmap tstSafeSize; |
339 tstSafeSize.setInfo(SkImageInfo::Make(100000000U, 100000000U, | 339 tstSafeSize.setConfig(SkImageInfo::Make(100000000U, 100000000U, |
340 gPairs[i].fColorType, kPremul_
SkAlphaType)); | 340 gPairs[i].fColorType, |
| 341 kPremul_SkAlphaType)); |
341 int64_t safeSize = tstSafeSize.computeSafeSize64(); | 342 int64_t safeSize = tstSafeSize.computeSafeSize64(); |
342 if (safeSize < 0) { | 343 if (safeSize < 0) { |
343 ERRORF(reporter, "getSafeSize64() negative: %s", | 344 ERRORF(reporter, "getSafeSize64() negative: %s", |
344 gColorTypeName[tstSafeSize.colorType()]); | 345 gColorTypeName[tstSafeSize.colorType()]); |
345 } | 346 } |
346 bool sizeFail = false; | 347 bool sizeFail = false; |
347 // Compare against hand-computed values. | 348 // Compare against hand-computed values. |
348 switch (gPairs[i].fColorType) { | 349 switch (gPairs[i].fColorType) { |
349 case kUnknown_SkColorType: | 350 case kUnknown_SkColorType: |
350 break; | 351 break; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 // for the transfer. | 536 // for the transfer. |
536 REPORTER_ASSERT(reporter, | 537 REPORTER_ASSERT(reporter, |
537 subset.copyPixelsFrom(buf, 1, subset.rowBytes()) == | 538 subset.copyPixelsFrom(buf, 1, subset.rowBytes()) == |
538 false); | 539 false); |
539 | 540 |
540 #endif | 541 #endif |
541 } | 542 } |
542 } // for (size_t copyCase ... | 543 } // for (size_t copyCase ... |
543 } | 544 } |
544 } | 545 } |
OLD | NEW |