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

Side by Side Diff: tests/GifTest.cpp

Issue 2045293002: Add support for multiple frames in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix a test - we now draw transparent background for missing color table Created 4 years, 1 month 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 | « tests/CodecTest.cpp ('k') | third_party/gif/GIFImageReader.h » ('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 "CodecPriv.h" 8 #include "CodecPriv.h"
9 #include "Resources.h" 9 #include "Resources.h"
10 #include "SkAndroidCodec.h" 10 #include "SkAndroidCodec.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 static void test_gif_data_no_colormap(skiatest::Reporter* r, 45 static void test_gif_data_no_colormap(skiatest::Reporter* r,
46 void* data, 46 void* data,
47 size_t size) { 47 size_t size) {
48 SkBitmap bm; 48 SkBitmap bm;
49 bool imageDecodeSuccess = decode_memory(data, size, &bm); 49 bool imageDecodeSuccess = decode_memory(data, size, &bm);
50 REPORTER_ASSERT(r, imageDecodeSuccess); 50 REPORTER_ASSERT(r, imageDecodeSuccess);
51 REPORTER_ASSERT(r, bm.width() == 1); 51 REPORTER_ASSERT(r, bm.width() == 1);
52 REPORTER_ASSERT(r, bm.height() == 1); 52 REPORTER_ASSERT(r, bm.height() == 1);
53 REPORTER_ASSERT(r, !(bm.empty())); 53 REPORTER_ASSERT(r, !(bm.empty()));
54 if (!(bm.empty())) { 54 if (!(bm.empty())) {
55 REPORTER_ASSERT(r, bm.getColor(0, 0) == 0xFF000000); 55 REPORTER_ASSERT(r, bm.getColor(0, 0) == 0x00000000);
56 } 56 }
57 } 57 }
58 static void test_gif_data(skiatest::Reporter* r, void* data, size_t size) { 58 static void test_gif_data(skiatest::Reporter* r, void* data, size_t size) {
59 SkBitmap bm; 59 SkBitmap bm;
60 bool imageDecodeSuccess = decode_memory(data, size, &bm); 60 bool imageDecodeSuccess = decode_memory(data, size, &bm);
61 REPORTER_ASSERT(r, imageDecodeSuccess); 61 REPORTER_ASSERT(r, imageDecodeSuccess);
62 REPORTER_ASSERT(r, bm.width() == 3); 62 REPORTER_ASSERT(r, bm.width() == 3);
63 REPORTER_ASSERT(r, bm.height() == 3); 63 REPORTER_ASSERT(r, bm.height() == 3);
64 REPORTER_ASSERT(r, !(bm.empty())); 64 REPORTER_ASSERT(r, !(bm.empty()));
65 if (!(bm.empty())) { 65 if (!(bm.empty())) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 options.fSampleSize = 4; 220 options.fSampleSize = 4;
221 options.fColorPtr = colorPtr; 221 options.fColorPtr = colorPtr;
222 options.fColorCount = colorCountPtr; 222 options.fColorCount = colorCountPtr;
223 223
224 SkBitmap bm; 224 SkBitmap bm;
225 bm.allocPixels(codec->getInfo(), nullptr, colorTable.get()); 225 bm.allocPixels(codec->getInfo(), nullptr, colorTable.get());
226 const SkCodec::Result result = codec->getAndroidPixels(codec->getInfo(), bm. getPixels(), 226 const SkCodec::Result result = codec->getAndroidPixels(codec->getInfo(), bm. getPixels(),
227 bm.rowBytes(), &options); 227 bm.rowBytes(), &options);
228 REPORTER_ASSERT(r, result == SkCodec::kSuccess); 228 REPORTER_ASSERT(r, result == SkCodec::kSuccess);
229 } 229 }
OLDNEW
« no previous file with comments | « tests/CodecTest.cpp ('k') | third_party/gif/GIFImageReader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698