summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
author Matt Sarett <msarett@google.com> 2016-01-07 18:31:18 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-01-07 18:31:18 +0000
commit055b82aa50fe7a75b36a3c91c2dfdcfd729bacd7 (patch)
tree6ac7ce2a9e138d836fe2aaea4c7cb3784ecbac38 /tools
parentd20aebb3217c1e56f8bf6a3c88ce0dfcf3d58a56 (diff)
parent3b1b68d6c764a4f60d034e57a94879b7df65fd43 (diff)
Merge "Allow ninepatches to be encoded using non-RGBA modes"
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt/Images.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/tools/aapt/Images.cpp b/tools/aapt/Images.cpp
index e4738f5eda7d..5ad337949bee 100644
--- a/tools/aapt/Images.cpp
+++ b/tools/aapt/Images.cpp
@@ -1095,13 +1095,6 @@ static void write_png(const char* imageName,
analyze_image(imageName, imageInfo, grayscaleTolerance, rgbPalette, alphaPalette,
&paletteEntries, &hasTransparency, &color_type, outRows);
- // If the image is a 9-patch, we need to preserve it as a ARGB file to make
- // sure the pixels will not be pre-dithered/clamped until we decide they are
- if (imageInfo.is9Patch && (color_type == PNG_COLOR_TYPE_RGB ||
- color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_PALETTE)) {
- color_type = PNG_COLOR_TYPE_RGB_ALPHA;
- }
-
if (kIsDebug) {
switch (color_type) {
case PNG_COLOR_TYPE_PALETTE:
@@ -1180,18 +1173,11 @@ static void write_png(const char* imageName,
}
for (int i = 0; i < chunk_count; i++) {
- unknowns[i].location = PNG_HAVE_PLTE;
+ unknowns[i].location = PNG_HAVE_IHDR;
}
png_set_keep_unknown_chunks(write_ptr, PNG_HANDLE_CHUNK_ALWAYS,
chunk_names, chunk_count);
png_set_unknown_chunks(write_ptr, write_info, unknowns, chunk_count);
-#if PNG_LIBPNG_VER < 10600
- /* Deal with unknown chunk location bug in 1.5.x and earlier */
- png_set_unknown_chunk_location(write_ptr, write_info, 0, PNG_HAVE_PLTE);
- if (imageInfo.haveLayoutBounds) {
- png_set_unknown_chunk_location(write_ptr, write_info, 1, PNG_HAVE_PLTE);
- }
-#endif
}