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

Side by Side Diff: tests/BitmapCopyTest.cpp

Issue 308683005: setConfig -> setInfo (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: missed one setConfig (release only) 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.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
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 }
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