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

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: Respond to comments. 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
« no previous file with comments | « 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 b289d39fc7d65208868420515bb7319eac426c31..5e0ac99945453a2c9e7c8dfafac77b9f7b4df2e9 100644
--- a/tools/render_pictures_main.cpp
+++ b/tools/render_pictures_main.cpp
@@ -7,8 +7,6 @@
#include "CopyTilesRenderer.h"
#include "SkBitmap.h"
-#include "SkBitmapFactory.h"
-#include "SkCanvas.h"
#include "SkDevice.h"
#include "SkFlags.h"
#include "SkGraphics.h"
@@ -19,7 +17,6 @@
#include "SkPicture.h"
#include "SkStream.h"
#include "SkString.h"
-#include "SkTArray.h"
#include "PictureRenderer.h"
#include "PictureRenderingFlags.h"
#include "picture_utils.h"
@@ -45,36 +42,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,
« no previous file with comments | « tools/bench_pictures_main.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698