aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-01-07 18:04:45 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-07 18:04:45 -0800
commit5965c8ae4ee960275da4bc40189bdba85aab8b5e (patch)
treedc7f14af5cbce088311191a981b6ae67c2286be6 /tests
parent23d432080cb8506bf8e371b1637ce8f2de9c0c05 (diff)
add ImageGenerator::NewFromData to porting layer
Diffstat (limited to 'tests')
-rw-r--r--tests/CachedDecodingPixelRefTest.cpp9
-rw-r--r--tests/ImageDecodingTest.cpp4
-rw-r--r--tests/KtxTest.cpp6
-rw-r--r--tests/PDFJpegEmbedTest.cpp5
-rw-r--r--tests/PictureTest.cpp5
-rw-r--r--tests/SurfaceTest.cpp4
6 files changed, 9 insertions, 24 deletions
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp
index b3eb5327d9..48100e714b 100644
--- a/tests/CachedDecodingPixelRefTest.cpp
+++ b/tests/CachedDecodingPixelRefTest.cpp
@@ -9,7 +9,6 @@
#include "SkCachingPixelRef.h"
#include "SkCanvas.h"
#include "SkData.h"
-#include "SkDecodingImageGenerator.h"
#include "SkDiscardableMemoryPool.h"
#include "SkImageDecoder.h"
#include "SkImageGeneratorPriv.h"
@@ -143,15 +142,11 @@ static void test_three_encodings(skiatest::Reporter* reporter,
////////////////////////////////////////////////////////////////////////////////
static bool install_skCachingPixelRef(SkData* encoded, SkBitmap* dst) {
- return SkCachingPixelRef::Install(
- SkDecodingImageGenerator::Create(
- encoded, SkDecodingImageGenerator::Options()), dst);
+ return SkCachingPixelRef::Install(SkImageGenerator::NewFromData(encoded), dst);
}
static bool install_skDiscardablePixelRef(SkData* encoded, SkBitmap* dst) {
// Use system-default discardable memory.
- return SkInstallDiscardablePixelRef(
- SkDecodingImageGenerator::Create(
- encoded, SkDecodingImageGenerator::Options()), dst);
+ return SkInstallDiscardablePixelRef(encoded, dst);
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp
index 762852d62a..528c295d93 100644
--- a/tests/ImageDecodingTest.cpp
+++ b/tests/ImageDecodingTest.cpp
@@ -455,9 +455,7 @@ DEF_TEST(WebP, reporter) {
sizeof(encodedWebP)));
SkBitmap bm;
- bool success = SkInstallDiscardablePixelRef(
- SkDecodingImageGenerator::Create(encoded,
- SkDecodingImageGenerator::Options()), &bm);
+ bool success = SkInstallDiscardablePixelRef(encoded, &bm);
REPORTER_ASSERT(reporter, success);
if (!success) {
diff --git a/tests/KtxTest.cpp b/tests/KtxTest.cpp
index 499db6ab48..23c1d70900 100644
--- a/tests/KtxTest.cpp
+++ b/tests/KtxTest.cpp
@@ -8,7 +8,7 @@
#include "Resources.h"
#include "SkBitmap.h"
#include "SkData.h"
-#include "SkDecodingImageGenerator.h"
+#include "SkImageGenerator.h"
#include "SkForceLinking.h"
#include "SkImageDecoder.h"
#include "SkOSFile.h"
@@ -151,9 +151,7 @@ DEF_TEST(KtxReexportPKM, reporter) {
}
bool installDiscardablePixelRefSuccess =
- SkInstallDiscardablePixelRef(
- SkDecodingImageGenerator::Create(
- fileData, SkDecodingImageGenerator::Options()), &etcBitmap);
+ SkInstallDiscardablePixelRef(fileData, &etcBitmap);
REPORTER_ASSERT(reporter, installDiscardablePixelRefSuccess);
// Write the bitmap out to a KTX file.
diff --git a/tests/PDFJpegEmbedTest.cpp b/tests/PDFJpegEmbedTest.cpp
index 422b59a18f..beb949dfc9 100644
--- a/tests/PDFJpegEmbedTest.cpp
+++ b/tests/PDFJpegEmbedTest.cpp
@@ -10,7 +10,6 @@
#include "SkImageGenerator.h"
#include "SkData.h"
#include "SkStream.h"
-#include "SkDecodingImageGenerator.h"
#include "Resources.h"
#include "Test.h"
@@ -19,9 +18,7 @@
static SkBitmap bitmap_from_data(SkData* data) {
SkASSERT(data);
SkBitmap bm;
- SkInstallDiscardablePixelRef(
- SkDecodingImageGenerator::Create(
- data, SkDecodingImageGenerator::Options()), &bm);
+ SkInstallDiscardablePixelRef(data, &bm);
return bm;
}
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index a66185b95b..c2e1bb103c 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -12,7 +12,7 @@
#include "SkColorPriv.h"
#include "SkDashPathEffect.h"
#include "SkData.h"
-#include "SkDecodingImageGenerator.h"
+#include "SkImageGenerator.h"
#include "SkError.h"
#include "SkImageEncoder.h"
#include "SkImageGenerator.h"
@@ -1495,8 +1495,7 @@ static void test_bitmap_with_encoded_data(skiatest::Reporter* reporter) {
SkAutoDataUnref data(wStream.copyToData());
SkBitmap bm;
- bool installSuccess = SkInstallDiscardablePixelRef(
- SkDecodingImageGenerator::Create(data, SkDecodingImageGenerator::Options()), &bm);
+ bool installSuccess = SkInstallDiscardablePixelRef(data, &bm);
REPORTER_ASSERT(reporter, installSuccess);
// Write both bitmaps to pictures, and ensure that the resulting data streams are the same.
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index d8c6d9d76c..c09d97cabe 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -7,7 +7,6 @@
#include "SkCanvas.h"
#include "SkData.h"
-#include "SkDecodingImageGenerator.h"
#include "SkImageEncoder.h"
#include "SkRRect.h"
#include "SkSurface.h"
@@ -139,8 +138,7 @@ static SkImage* createImage(ImageType imageType, GrContext* context, SkColor col
bitmap.installPixels(info, addr, rowBytes);
SkAutoTUnref<SkData> src(
SkImageEncoder::EncodeData(bitmap, SkImageEncoder::kPNG_Type, 100));
- return SkImage::NewFromGenerator(
- SkDecodingImageGenerator::Create(src, SkDecodingImageGenerator::Options()));
+ return SkImage::NewFromData(src);
}
}
SkASSERT(false);