From 21efb6827cede06c2ab708de6cdb64d052dddcce Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Wed, 14 Sep 2016 17:35:43 -0700 Subject: AAPT2: Refactor PngCrunching PngCrunching now has a slightly better heuristic of choosing to encode an image as a palette or RGB. For small images, RGB compresses much better than a palette. The original PNG is used as-is (minus some optional chunks being stripped) if the resulting crunched PNG is larger than the original. 9-patch handling is abstracted away from PNGs, paving the way for other 9-patches, like WebP. TODO: handle PNGs with 9-patch chunks already present, which should just be passed through. This will allow for 3rd party tools to generate 9-patches. TODO: implement cheap transparency: when one color is used to represent transparent, and all other colors are opaque. Bug:30053276 Change-Id: I5167f53b91d1efa462d9f03d6b9108d9b541c0c1 --- tools/aapt2/Android.mk | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/aapt2/Android.mk') diff --git a/tools/aapt2/Android.mk b/tools/aapt2/Android.mk index 9ec706fbf9bf..c83a1328fcd7 100644 --- a/tools/aapt2/Android.mk +++ b/tools/aapt2/Android.mk @@ -24,7 +24,10 @@ main := Main.cpp sources := \ compile/IdAssigner.cpp \ compile/InlineXmlFormatParser.cpp \ + compile/NinePatch.cpp \ compile/Png.cpp \ + compile/PngChunkFilter.cpp \ + compile/PngCrunch.cpp \ compile/PseudolocaleGenerator.cpp \ compile/Pseudolocalizer.cpp \ compile/XmlIdCollector.cpp \ @@ -34,6 +37,7 @@ sources := \ flatten/XmlFlattener.cpp \ io/File.cpp \ io/FileSystem.cpp \ + io/Io.cpp \ io/ZipArchive.cpp \ link/AutoVersioner.cpp \ link/ManifestFixer.cpp \ @@ -80,6 +84,7 @@ sources += Format.proto testSources := \ compile/IdAssigner_test.cpp \ compile/InlineXmlFormatParser_test.cpp \ + compile/NinePatch_test.cpp \ compile/PseudolocaleGenerator_test.cpp \ compile/Pseudolocalizer_test.cpp \ compile/XmlIdCollector_test.cpp \ -- cgit v1.2.3-59-g8ed1b