aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
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 /samplecode
parent23d432080cb8506bf8e371b1637ce8f2de9c0c05 (diff)
add ImageGenerator::NewFromData to porting layer
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleEncode.cpp7
-rw-r--r--samplecode/SamplePicture.cpp5
2 files changed, 4 insertions, 8 deletions
diff --git a/samplecode/SampleEncode.cpp b/samplecode/SampleEncode.cpp
index e65b2d3855..185208b35b 100644
--- a/samplecode/SampleEncode.cpp
+++ b/samplecode/SampleEncode.cpp
@@ -9,7 +9,7 @@
#include "SkView.h"
#include "SkCanvas.h"
#include "SkData.h"
-#include "SkDecodingImageGenerator.h"
+#include "SkImageGenerator.h"
#include "SkGradientShader.h"
#include "SkGraphics.h"
#include "SkImageDecoder.h"
@@ -193,10 +193,7 @@ protected:
encoded = fEncodedPNGs[i].get();
}
if (encoded) {
- if (!SkInstallDiscardablePixelRef(
- SkDecodingImageGenerator::Create(encoded,
- SkDecodingImageGenerator::Options()),
- &bm)) {
+ if (!SkInstallDiscardablePixelRef(encoded, &bm)) {
SkDebugf("[%s:%d] failed to decode %s%s\n",
__FILE__, __LINE__,gConfigLabels[i], gExt[j]);
}
diff --git a/samplecode/SamplePicture.cpp b/samplecode/SamplePicture.cpp
index 46c57d7f39..c78571a89b 100644
--- a/samplecode/SamplePicture.cpp
+++ b/samplecode/SamplePicture.cpp
@@ -13,7 +13,7 @@
#include "SkColorFilter.h"
#include "SkColorPriv.h"
#include "SkData.h"
-#include "SkDecodingImageGenerator.h"
+#include "SkImageGenerator.h"
#include "SkDumpCanvas.h"
#include "SkGradientShader.h"
#include "SkGraphics.h"
@@ -40,8 +40,7 @@ static SkBitmap load_bitmap() {
SkString pngFilename = GetResourcePath("mandrill_512.png");
SkAutoDataUnref data(SkData::NewFromFileName(pngFilename.c_str()));
if (data.get() != NULL) {
- SkInstallDiscardablePixelRef(SkDecodingImageGenerator::Create(
- data, SkDecodingImageGenerator::Options()), &bm);
+ SkInstallDiscardablePixelRef(data, &bm);
}
return bm;
}