diff options
author | reed <reed@google.com> | 2015-01-07 18:04:45 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-07 18:04:45 -0800 |
commit | 5965c8ae4ee960275da4bc40189bdba85aab8b5e (patch) | |
tree | dc7f14af5cbce088311191a981b6ae67c2286be6 /gm | |
parent | 23d432080cb8506bf8e371b1637ce8f2de9c0c05 (diff) |
add ImageGenerator::NewFromData to porting layer
BUG=skia:3275
Review URL: https://codereview.chromium.org/834633006
Diffstat (limited to 'gm')
-rw-r--r-- | gm/astcbitmap.cpp | 6 | ||||
-rw-r--r-- | gm/colorwheel.cpp | 1 | ||||
-rw-r--r-- | gm/etc1bitmap.cpp | 10 | ||||
-rw-r--r-- | gm/factory.cpp | 7 | ||||
-rw-r--r-- | gm/image.cpp | 4 |
5 files changed, 8 insertions, 20 deletions
diff --git a/gm/astcbitmap.cpp b/gm/astcbitmap.cpp index 3c9079cfa8..b415a82a66 100644 --- a/gm/astcbitmap.cpp +++ b/gm/astcbitmap.cpp @@ -10,7 +10,7 @@ #include "Resources.h" #include "SkCanvas.h" #include "SkData.h" -#include "SkDecodingImageGenerator.h" +#include "SkImageGenerator.h" #include "SkImageDecoder.h" #include "SkOSFile.h" #include "SkTextureCompressor.h" @@ -76,9 +76,7 @@ protected: } SkBitmap bm; - if (!SkInstallDiscardablePixelRef( - SkDecodingImageGenerator::Create( - fileData, SkDecodingImageGenerator::Options()), &bm)) { + if (!SkInstallDiscardablePixelRef(fileData, &bm)) { SkDebugf("Could not install discardable pixel ref.\n"); return; } diff --git a/gm/colorwheel.cpp b/gm/colorwheel.cpp index 93af361720..f74eaf6a98 100644 --- a/gm/colorwheel.cpp +++ b/gm/colorwheel.cpp @@ -7,7 +7,6 @@ #include "Resources.h" #include "SkData.h" -#include "SkDecodingImageGenerator.h" #include "gm.h" #include "sk_tool_utils.h" diff --git a/gm/etc1bitmap.cpp b/gm/etc1bitmap.cpp index fcf521a180..76593f4441 100644 --- a/gm/etc1bitmap.cpp +++ b/gm/etc1bitmap.cpp @@ -10,7 +10,7 @@ #include "Resources.h" #include "SkCanvas.h" #include "SkData.h" -#include "SkDecodingImageGenerator.h" +#include "SkImageGenerator.h" #include "SkImageDecoder.h" #include "SkOSFile.h" @@ -103,9 +103,7 @@ protected: return; } - if (!SkInstallDiscardablePixelRef( - SkDecodingImageGenerator::Create( - fileData, SkDecodingImageGenerator::Options()), &bm)) { + if (!SkInstallDiscardablePixelRef(fileData, &bm)) { SkDebugf("Could not install discardable pixel ref.\n"); return; } @@ -204,9 +202,7 @@ protected: size_t dataSz = etc1_get_encoded_data_size(width, height) + ETC_PKM_HEADER_SIZE; SkAutoDataUnref nonPOTData(SkData::NewWithCopy(am.get(), dataSz)); - if (!SkInstallDiscardablePixelRef( - SkDecodingImageGenerator::Create( - nonPOTData, SkDecodingImageGenerator::Options()), &bm)) { + if (!SkInstallDiscardablePixelRef(nonPOTData, &bm)) { SkDebugf("Could not install discardable pixel ref.\n"); return; } diff --git a/gm/factory.cpp b/gm/factory.cpp index a9bf519c00..9cc5bb8df4 100644 --- a/gm/factory.cpp +++ b/gm/factory.cpp @@ -10,7 +10,6 @@ #include "Resources.h" #include "SkCanvas.h" #include "SkData.h" -#include "SkDecodingImageGenerator.h" #include "SkDiscardableMemoryPool.h" #include "SkDiscardablePixelRef.h" #include "SkImageDecoder.h" @@ -37,10 +36,8 @@ protected: // bitmap is unlocked. SkAutoTUnref<SkDiscardableMemoryPool> pool( SkDiscardableMemoryPool::Create(1)); - SkAssertResult(SkInstallDiscardablePixelRef( - SkDecodingImageGenerator::Create( - data, SkDecodingImageGenerator::Options()), - &fBitmap, pool)); + SkAssertResult(SkInstallDiscardablePixelRef(SkImageGenerator::NewFromData(data), + &fBitmap, pool)); } } diff --git a/gm/image.cpp b/gm/image.cpp index 05a3fab2b4..bd7bbe7952 100644 --- a/gm/image.cpp +++ b/gm/image.cpp @@ -8,7 +8,6 @@ #include "gm.h" #include "SkSurface.h" #include "SkCanvas.h" -#include "SkDecodingImageGenerator.h" #include "SkStream.h" #include "SkData.h" @@ -24,8 +23,7 @@ static void drawJpeg(SkCanvas* canvas, const SkISize& size) { if (NULL == data.get()) { return; } - SkImage* image = SkImage::NewFromGenerator( - SkDecodingImageGenerator::Create(data, SkDecodingImageGenerator::Options())); + SkImage* image = SkImage::NewFromData(data); if (image) { SkAutoCanvasRestore acr(canvas, true); canvas->scale(size.width() * 1.0f / image->width(), |