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

Side by Side Diff: tools/skimage_main.cpp

Issue 418363002: Fix assert in skimage test. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 100 chars per line. Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | 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 "gm_expectations.h" 8 #include "gm_expectations.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 580
581 write_expectations(bitmapAndDigest, filename); 581 write_expectations(bitmapAndDigest, filename);
582 582
583 if (FLAGS_testSubsetDecoding) { 583 if (FLAGS_testSubsetDecoding) {
584 SkDEBUGCODE(bool couldRewind =) stream.rewind(); 584 SkDEBUGCODE(bool couldRewind =) stream.rewind();
585 SkASSERT(couldRewind); 585 SkASSERT(couldRewind);
586 int width, height; 586 int width, height;
587 // Build the tile index for decoding subsets. If the image is 1x1, skip subset 587 // Build the tile index for decoding subsets. If the image is 1x1, skip subset
588 // decoding since there are no smaller subsets. 588 // decoding since there are no smaller subsets.
589 if (codec->buildTileIndex(&stream, &width, &height) && width > 1 && heig ht > 1) { 589 if (codec->buildTileIndex(&stream, &width, &height) && width > 1 && heig ht > 1) {
590 SkASSERT(bitmap.width() == width && bitmap.height() == height); 590 SkASSERT((bitmap.width() == width && bitmap.height() == height)
591 || FLAGS_sampleSize != 1);
591 // Call decodeSubset multiple times: 592 // Call decodeSubset multiple times:
592 SkRandom rand(0); 593 SkRandom rand(0);
593 for (int i = 0; i < 5; i++) { 594 for (int i = 0; i < 5; i++) {
594 SkBitmap bitmapFromDecodeSubset; 595 SkBitmap bitmapFromDecodeSubset;
595 // FIXME: Come up with a more representative set of rectangles. 596 // FIXME: Come up with a more representative set of rectangles.
596 SkIRect rect = generate_random_rect(&rand, width, height); 597 SkIRect rect = generate_random_rect(&rand, width, height);
597 SkString subsetDim = SkStringPrintf("%d_%d_%d_%d", rect.fLeft, r ect.fTop, 598 SkString subsetDim = SkStringPrintf("%d_%d_%d_%d", rect.fLeft, r ect.fTop,
598 rect.fRight, rect.fBottom); 599 rect.fRight, rect.fBottom);
599 if (codec->decodeSubset(&bitmapFromDecodeSubset, rect, gPrefColo rType)) { 600 if (codec->decodeSubset(&bitmapFromDecodeSubset, rect, gPrefColo rType)) {
600 SkString subsetName = SkStringPrintf("%s-%s", filename, subs etDim.c_str()); 601 SkString subsetName = SkStringPrintf("%s-%s", filename, subs etDim.c_str());
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 print_strings("Known failures", gKnownFailures); 834 print_strings("Known failures", gKnownFailures);
834 835
835 return failed ? -1 : 0; 836 return failed ? -1 : 0;
836 } 837 }
837 838
838 #if !defined SK_BUILD_FOR_IOS 839 #if !defined SK_BUILD_FOR_IOS
839 int main(int argc, char * const argv[]) { 840 int main(int argc, char * const argv[]) {
840 return tool_main(argc, (char**) argv); 841 return tool_main(argc, (char**) argv);
841 } 842 }
842 #endif 843 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698