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

Side by Side Diff: tests/KtxTest.cpp

Issue 656503003: Move SkImage::encode to SkImageEncoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « tests/CachedDecodingPixelRefTest.cpp ('k') | tools/skhello.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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkData.h" 10 #include "SkData.h"
11 #include "SkDecodingImageGenerator.h" 11 #include "SkDecodingImageGenerator.h"
12 #include "SkForceLinking.h" 12 #include "SkForceLinking.h"
13 #include "SkImageDecoder.h" 13 #include "SkImageDecoder.h"
14 #include "SkImageEncoder.h"
14 #include "SkOSFile.h" 15 #include "SkOSFile.h"
15 #include "SkRandom.h" 16 #include "SkRandom.h"
16 #include "SkStream.h" 17 #include "SkStream.h"
17 #include "Test.h" 18 #include "Test.h"
18 19
19 __SK_FORCE_IMAGE_DECODER_LINKING; 20 __SK_FORCE_IMAGE_DECODER_LINKING;
20 21
21 /** 22 /**
22 * First, make sure that writing an 8-bit RGBA KTX file and then 23 * First, make sure that writing an 8-bit RGBA KTX file and then
23 * reading it produces the same bitmap. 24 * reading it produces the same bitmap.
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // Write the bitmap out to a KTX file. 160 // Write the bitmap out to a KTX file.
160 SkData *ktxDataPtr = SkImageEncoder::EncodeData(etcBitmap, SkImageEncoder::k KTX_Type, 0); 161 SkData *ktxDataPtr = SkImageEncoder::EncodeData(etcBitmap, SkImageEncoder::k KTX_Type, 0);
161 SkAutoDataUnref newKtxData(ktxDataPtr); 162 SkAutoDataUnref newKtxData(ktxDataPtr);
162 REPORTER_ASSERT(reporter, ktxDataPtr); 163 REPORTER_ASSERT(reporter, ktxDataPtr);
163 164
164 // See is this data is identical to data in existing ktx file. 165 // See is this data is identical to data in existing ktx file.
165 SkString ktxFilename = GetResourcePath("mandrill_128.ktx"); 166 SkString ktxFilename = GetResourcePath("mandrill_128.ktx");
166 SkAutoDataUnref oldKtxData(SkData::NewFromFileName(ktxFilename.c_str())); 167 SkAutoDataUnref oldKtxData(SkData::NewFromFileName(ktxFilename.c_str()));
167 REPORTER_ASSERT(reporter, oldKtxData->equals(newKtxData)); 168 REPORTER_ASSERT(reporter, oldKtxData->equals(newKtxData));
168 } 169 }
OLDNEW
« no previous file with comments | « tests/CachedDecodingPixelRefTest.cpp ('k') | tools/skhello.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698