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.setConfig(SkImageInfo::Make(100000000U, 100000000U, | 339 tstSafeSize.setInfo(SkImageInfo::Make(100000000U, 100000000U, |
340 gPairs[i].fColorType, | 340 gPairs[i].fColorType, kPremul_
SkAlphaType)); |
341 kPremul_SkAlphaType)); | |
342 int64_t safeSize = tstSafeSize.computeSafeSize64(); | 341 int64_t safeSize = tstSafeSize.computeSafeSize64(); |
343 if (safeSize < 0) { | 342 if (safeSize < 0) { |
344 ERRORF(reporter, "getSafeSize64() negative: %s", | 343 ERRORF(reporter, "getSafeSize64() negative: %s", |
345 gColorTypeName[tstSafeSize.colorType()]); | 344 gColorTypeName[tstSafeSize.colorType()]); |
346 } | 345 } |
347 bool sizeFail = false; | 346 bool sizeFail = false; |
348 // Compare against hand-computed values. | 347 // Compare against hand-computed values. |
349 switch (gPairs[i].fColorType) { | 348 switch (gPairs[i].fColorType) { |
350 case kUnknown_SkColorType: | 349 case kUnknown_SkColorType: |
351 break; | 350 break; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 // for the transfer. | 535 // for the transfer. |
537 REPORTER_ASSERT(reporter, | 536 REPORTER_ASSERT(reporter, |
538 subset.copyPixelsFrom(buf, 1, subset.rowBytes()) == | 537 subset.copyPixelsFrom(buf, 1, subset.rowBytes()) == |
539 false); | 538 false); |
540 | 539 |
541 #endif | 540 #endif |
542 } | 541 } |
543 } // for (size_t copyCase ... | 542 } // for (size_t copyCase ... |
544 } | 543 } |
545 } | 544 } |
OLD | NEW |