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

Unified Diff: tests/KtxTest.cpp

Issue 1373683003: change pixel-serializer to support reencoding existing data Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: I hate this warning Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/ImageTest.cpp ('k') | tools/sk_tool_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/KtxTest.cpp
diff --git a/tests/KtxTest.cpp b/tests/KtxTest.cpp
index e0d9a27b40236012cc2dc421c1d83f12ec068292..0ad24969c2435fe67d6d5019ee4da67e9743ccad 100644
--- a/tests/KtxTest.cpp
+++ b/tests/KtxTest.cpp
@@ -8,6 +8,7 @@
#include "Resources.h"
#include "SkBitmap.h"
#include "SkData.h"
+#include "SkImage.h"
#include "SkImageGenerator.h"
#include "SkForceLinking.h"
#include "SkImageDecoder.h"
@@ -149,14 +150,11 @@ DEF_TEST(KtxReexportPKM, reporter) {
return;
}
- bool installDiscardablePixelRefSuccess =
- SkDEPRECATED_InstallDiscardablePixelRef(fileData, &etcBitmap);
- REPORTER_ASSERT(reporter, installDiscardablePixelRefSuccess);
+ SkAutoTUnref<SkImage> image(SkImage::NewFromEncoded(fileData));
+ REPORTER_ASSERT(reporter, image.get());
- // Write the bitmap out to a KTX file.
- SkData *ktxDataPtr = SkImageEncoder::EncodeData(etcBitmap, SkImageEncoder::kKTX_Type, 0);
- SkAutoDataUnref newKtxData(ktxDataPtr);
- REPORTER_ASSERT(reporter, ktxDataPtr);
+ SkAutoDataUnref newKtxData(image->encode(SkImageEncoder::kKTX_Type, 0));
+ REPORTER_ASSERT(reporter, newKtxData.get());
// See is this data is identical to data in existing ktx file.
SkString ktxFilename = GetResourcePath("mandrill_128.ktx");
« no previous file with comments | « tests/ImageTest.cpp ('k') | tools/sk_tool_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698