Add the lazy decoder from PictureFlags to SkImageDecoder
R=caryclark@google.com, scroggo@google.com
Author: sglez@google.com
Review URL: https://chromiumcodereview.appspot.com/19109002
git-svn-id: http://skia.googlecode.com/svn/trunk@10111 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp
index 720621e..eea9644 100644
--- a/tools/bench_pictures_main.cpp
+++ b/tools/bench_pictures_main.cpp
@@ -7,11 +7,11 @@
#include "BenchTimer.h"
#include "CopyTilesRenderer.h"
+#include "LazyDecodeBitmap.h"
#include "PictureBenchmark.h"
#include "PictureRenderingFlags.h"
#include "SkBenchLogger.h"
#include "SkCommandLineFlags.h"
-#include "SkForceLinking.h"
#include "SkGraphics.h"
#include "SkImageDecoder.h"
#if LAZY_CACHE_STATS
@@ -24,8 +24,6 @@
#include "SkStream.h"
#include "picture_utils.h"
-__SK_FORCE_IMAGE_DECODER_LINKING;
-
SkBenchLogger gLogger;
// Flags used by this file, in alphabetical order.
@@ -145,9 +143,8 @@
return result;
}
-// These are defined in PictureRenderingFlags.cpp
+// Defined in LazyDecodeBitmap.cpp
extern SkLruImageCache gLruImageCache;
-extern bool lazy_decode_bitmap(const void* buffer, size_t size, SkBitmap* bitmap);
#if LAZY_CACHE_STATS
static int32_t gTotalCacheHits;
@@ -170,12 +167,12 @@
SkASSERT(gLruImageCache.getImageCacheUsed() == 0);
if (FLAGS_countRAM) {
// Set the limit to zero, so all pixels will be kept
- gLruImageCache.setImageCacheLimit(0);
+ gLruImageCache.setImageCacheLimit(0);
}
SkPicture::InstallPixelRefProc proc;
if (FLAGS_deferImageDecoding) {
- proc = &lazy_decode_bitmap;
+ proc = &sk_tools::LazyDecodeBitmap;
} else {
proc = &SkImageDecoder::DecodeMemory;
}