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

Side by Side Diff: tests/ImageDecodingTest.cpp

Issue 351133003: Cleanup usage of GetResourcePath() after commit bcbc1788b478b1e54079318ad073e8490aa66fae. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « samplecode/SampleSubpixelTranslate.cpp ('k') | tests/KtxTest.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 2013 Google Inc. 2 * Copyright 2013 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 "Resources.h" 8 #include "Resources.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 SkDecodingImageGenerator::Create(stream, opts), bitmap)) { 496 SkDecodingImageGenerator::Create(stream, opts), bitmap)) {
497 return bitmap->pixelRef(); 497 return bitmap->pixelRef();
498 } 498 }
499 return NULL; 499 return NULL;
500 } 500 }
501 /** 501 /**
502 * A test for the SkDecodingImageGenerator::Create and 502 * A test for the SkDecodingImageGenerator::Create and
503 * SkInstallDiscardablePixelRef functions. 503 * SkInstallDiscardablePixelRef functions.
504 */ 504 */
505 DEF_TEST(ImprovedBitmapFactory, reporter) { 505 DEF_TEST(ImprovedBitmapFactory, reporter) {
506 SkString resourcePath = GetResourcePath(); 506 SkString pngFilename = GetResourcePath("randPixels.png");
507 SkString path = SkOSPath::SkPathJoin( 507 SkAutoTUnref<SkStreamRewindable> stream(SkStream::NewFromFile(pngFilename.c_ str()));
508 resourcePath.c_str(), "randPixels.png"); 508 if (sk_exists(pngFilename.c_str())) {
509 SkAutoTUnref<SkStreamRewindable> stream(
510 SkStream::NewFromFile(path.c_str()));
511 if (sk_exists(path.c_str())) {
512 SkBitmap bm; 509 SkBitmap bm;
513 SkAssertResult(bm.setInfo(SkImageInfo::MakeN32Premul(1, 1))); 510 SkAssertResult(bm.setInfo(SkImageInfo::MakeN32Premul(1, 1)));
514 REPORTER_ASSERT(reporter, 511 REPORTER_ASSERT(reporter,
515 NULL != install_pixel_ref(&bm, stream.detach(), 1, true)); 512 NULL != install_pixel_ref(&bm, stream.detach(), 1, true));
516 SkAutoLockPixels alp(bm); 513 SkAutoLockPixels alp(bm);
517 REPORTER_ASSERT(reporter, NULL != bm.getPixels()); 514 REPORTER_ASSERT(reporter, NULL != bm.getPixels());
518 } 515 }
519 } 516 }
520 517
521 518
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 } 716 }
720 SkDecodingImageGenerator::Options options(scaleList[i], 717 SkDecodingImageGenerator::Options options(scaleList[i],
721 ditherList[j]); 718 ditherList[j]);
722 test_options(reporter, options, encodedStream, encodedData, 719 test_options(reporter, options, encodedStream, encodedData,
723 useDataList[m], path); 720 useDataList[m], path);
724 } 721 }
725 } 722 }
726 } 723 }
727 } 724 }
728 } 725 }
OLDNEW
« no previous file with comments | « samplecode/SampleSubpixelTranslate.cpp ('k') | tests/KtxTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698