Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Unified Diff: tools/render_pictures_main.cpp

Issue 12433020: Improvements/additions to SkImageCache/SkLazyPixelRef. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Modified a comment. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« include/lazy/SkImageCache.h ('K') | « tools/bench_pictures_main.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/render_pictures_main.cpp
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp
index 5d64e74bb07de4922ef856da53906e3f3b5651e7..23d1c52190da8be5ae32aebb27a1d6f8a6f00fa1 100644
--- a/tools/render_pictures_main.cpp
+++ b/tools/render_pictures_main.cpp
@@ -44,36 +44,8 @@ static void make_output_filepath(SkString* path, const SkString& dir,
path->remove(path->size() - 4, 4);
}
-#include "SkData.h"
-#include "SkLruImageCache.h"
-
-static SkLruImageCache gLruImageCache(1024*1024);
-
-#ifdef SK_BUILD_FOR_ANDROID
-#include "SkAshmemImageCache.h"
-#include "SkImage.h"
-
-static SkImageCache* cache_selector(const SkImage::Info& info) {
- if (info.fWidth * info.fHeight > 32 * 1024) {
- return SkAshmemImageCache::GetAshmemImageCache();
- }
- return &gLruImageCache;
-}
-
-#endif
-
-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);
-#ifdef SK_BUILD_FOR_ANDROID
- factory.setCacheSelector(&cache_selector);
-#else
- factory.setImageCache(&gLruImageCache);
-#endif
- return factory.installPixelRef(data, bitmap);
-}
+// Defined in PictureRenderingFlags.cpp
+extern bool lazy_decode_bitmap(const void* buffer, size_t size, SkBitmap* bitmap);
static bool render_picture(const SkString& inputPath, const SkString* outputDir,
sk_tools::PictureRenderer& renderer,
« include/lazy/SkImageCache.h ('K') | « tools/bench_pictures_main.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698