Index: tools/bench_pictures_main.cpp |
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp |
index d027db96333aea524fd6177d9f52873573b6bdde..cc8bd577f0a373c4f5b1f1e87d2c63d77e9d53d0 100644 |
--- a/tools/bench_pictures_main.cpp |
+++ b/tools/bench_pictures_main.cpp |
@@ -15,6 +15,8 @@ |
#include "SkFlags.h" |
#include "SkGraphics.h" |
#include "SkImageDecoder.h" |
+#include "SkLazyPixelRef.h" |
+#include "SkLruImageCache.h" |
#include "SkMath.h" |
#include "SkOSFile.h" |
#include "SkPicture.h" |
@@ -142,20 +144,9 @@ static SkString filterFlagsUsage() { |
return result; |
} |
-#include "SkData.h" |
-#include "SkLruImageCache.h" |
-#include "SkLazyPixelRef.h" |
- |
-static SkLruImageCache gLruImageCache(1024*1024); |
- |
-static bool lazy_decode_bitmap(const void* buffer, size_t size, SkBitmap* bitmap) { |
- void* copiedBuffer = sk_malloc_throw(size); |
- memcpy(copiedBuffer, buffer, size); |
- SkAutoDataUnref data(SkData::NewFromMalloc(copiedBuffer, size)); |
- SkBitmapFactory factory(&SkImageDecoder::DecodeMemoryToTarget); |
- factory.setImageCache(&gLruImageCache); |
- return factory.installPixelRef(data, bitmap); |
-} |
+// These are defined in PictureRenderingFlags.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; |