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

Unified Diff: src/images/SkImageRef_ashmem.cpp

Issue 24269006: Add an option on SkImageDecoder to skip writing 0s. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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
Index: src/images/SkImageRef_ashmem.cpp
diff --git a/src/images/SkImageRef_ashmem.cpp b/src/images/SkImageRef_ashmem.cpp
index a4058ff6d77b0d42581194c9bdfa89989788655a..913792fa4fb9a5cd4e54483087541fed733d1ffe 100644
--- a/src/images/SkImageRef_ashmem.cpp
+++ b/src/images/SkImageRef_ashmem.cpp
@@ -134,6 +134,9 @@ bool SkImageRef_ashmem::onDecode(SkImageDecoder* codec, SkStream* stream,
return this->INHERITED::onDecode(codec, stream, bitmap, config, mode);
}
+ // Ashmem memory is guaranteed to be initialized to 0.
+ codec->setSkipWritingZeroes(true);
+
AshmemAllocator alloc(&fRec, this->getURI());
codec->setAllocator(&alloc);

Powered by Google App Engine
This is Rietveld 408576698