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

Unified Diff: tests/ImageDecodingTest.cpp

Issue 293283002: move ashmem switching logic to SkDiscardableMemory::Create (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: AnotherPatchSet Created 6 years, 7 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 | « src/ports/SkDiscardableMemory_ashmem.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageDecodingTest.cpp
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp
index d5dd11ac85fdb39ac5028b105a833c34dfb27842..7f9ff3042e8657146078006dac05309481f32fd6 100644
--- a/tests/ImageDecodingTest.cpp
+++ b/tests/ImageDecodingTest.cpp
@@ -491,18 +491,8 @@ static SkPixelRef* install_pixel_ref(SkBitmap* bitmap,
SkASSERT(stream->unique());
SkColorType colorType = bitmap->colorType();
SkDecodingImageGenerator::Options opts(sampleSize, ditherImage, colorType);
- SkAutoTDelete<SkImageGenerator> gen(
- SkDecodingImageGenerator::Create(stream, opts));
- SkImageInfo info;
- if ((NULL == gen.get()) || !gen->getInfo(&info)) {
- return NULL;
- }
- SkDiscardableMemory::Factory* factory = NULL;
- if (info.getSafeSize(info.minRowBytes()) < (32 * 1024)) {
- // only use ashmem for large images, since mmaps come at a price
- factory = SkGetGlobalDiscardableMemoryPool();
- }
- if (SkInstallDiscardablePixelRef(gen.detach(), bitmap, factory)) {
+ if (SkInstallDiscardablePixelRef(
+ SkDecodingImageGenerator::Create(stream, opts), bitmap)) {
return bitmap->pixelRef();
}
return NULL;
« no previous file with comments | « src/ports/SkDiscardableMemory_ashmem.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698