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

Unified Diff: tools/bench_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/PictureRenderingFlags.cpp ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bench_pictures_main.cpp
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp
index d027db96333aea524fd6177d9f52873573b6bdde..31ef48449a55e0c1fdca92d4812e9b626c47af72 100644
--- a/tools/bench_pictures_main.cpp
+++ b/tools/bench_pictures_main.cpp
@@ -10,16 +10,17 @@
#include "PictureBenchmark.h"
#include "PictureRenderingFlags.h"
#include "SkBenchLogger.h"
-#include "SkBitmapFactory.h"
-#include "SkCanvas.h"
#include "SkFlags.h"
#include "SkGraphics.h"
#include "SkImageDecoder.h"
+#if LAZY_CACHE_STATS
+ #include "SkLazyPixelRef.h"
+#endif
+#include "SkLruImageCache.h"
#include "SkMath.h"
#include "SkOSFile.h"
#include "SkPicture.h"
#include "SkStream.h"
-#include "SkTArray.h"
#include "picture_utils.h"
@@ -142,20 +143,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;
« no previous file with comments | « tools/PictureRenderingFlags.cpp ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698