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

Side by Side Diff: tests/BitmapCopyTest.cpp

Issue 302053002: Revert of setConfig -> setInfo (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/views/sdl/SkOSWindow_SDL.cpp ('k') | tests/BitmapTest.cpp » ('j') | 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 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
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
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 }
OLDNEW
« no previous file with comments | « src/views/sdl/SkOSWindow_SDL.cpp ('k') | tests/BitmapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698