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

Side by Side Diff: tests/BadIcoTest.cpp

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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 | « src/xps/SkXPSDevice.cpp ('k') | tests/CachedDecodingPixelRefTest.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 2014 Google Inc. 2 * Copyright 2014 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 "Test.h" 9 #include "Test.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 13 matching lines...) Expand all
24 "skbug3429.webp", 24 "skbug3429.webp",
25 }; 25 };
26 26
27 const char* badImagesFolder = "invalid_images"; 27 const char* badImagesFolder = "invalid_images";
28 28
29 SkString resourcePath = GetResourcePath(badImagesFolder); 29 SkString resourcePath = GetResourcePath(badImagesFolder);
30 30
31 for (size_t i = 0; i < SK_ARRAY_COUNT(badImages); ++i) { 31 for (size_t i = 0; i < SK_ARRAY_COUNT(badImages); ++i) {
32 SkString fullPath = SkOSPath::Join(resourcePath.c_str(), badImages[i]); 32 SkString fullPath = SkOSPath::Join(resourcePath.c_str(), badImages[i]);
33 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(fullPath.c_str())); 33 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(fullPath.c_str()));
34 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.detach())); 34 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.release()));
35 35
36 // These images are corrupt. It's not important whether we succeed/fail in codec 36 // These images are corrupt. It's not important whether we succeed/fail in codec
37 // creation or decoding. We just want to make sure that we don't crash. 37 // creation or decoding. We just want to make sure that we don't crash.
38 if (codec) { 38 if (codec) {
39 SkBitmap bm; 39 SkBitmap bm;
40 bm.allocPixels(codec->getInfo()); 40 bm.allocPixels(codec->getInfo());
41 codec->getPixels(codec->getInfo(), bm.getPixels(), 41 codec->getPixels(codec->getInfo(), bm.getPixels(),
42 bm.rowBytes()); 42 bm.rowBytes());
43 } 43 }
44 } 44 }
45 } 45 }
OLDNEW
« no previous file with comments | « src/xps/SkXPSDevice.cpp ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698