From c0c80f14afba322179ac505816cdc51267b3a6ce Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Thu, 31 Jul 2014 13:41:51 +0300 Subject: Android: Fix exceptions in ExtractStyle.java on Android L Android L adds support for 64 bit (arm and x86) and they did lots of changes that are incompatible with old implementation. Task-number: QTBUG-40120 Change-Id: I69b78a9eed896d2ddabc1bf2a55886faeae47974 Reviewed-by: J-P Nurmi --- src/3rdparty/android/extract.h | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'src/3rdparty/android') diff --git a/src/3rdparty/android/extract.h b/src/3rdparty/android/extract.h index f7928e20a8..938ef9abfd 100644 --- a/src/3rdparty/android/extract.h +++ b/src/3rdparty/android/extract.h @@ -114,4 +114,57 @@ struct Res_png_9patch static Res_png_9patch* deserialize(const void* data); }; +struct Res_png_9patch20 +{ + Res_png_9patch20() : wasDeserialized(false), numXDivs(0), numYDivs(0), numColors(0), xDivsOffset(0), + yDivsOffset(0),paddingLeft(0), paddingRight(0), paddingTop(0), paddingBottom(0), + colorsOffset(0) { } + + int8_t wasDeserialized; + int8_t numXDivs; + int8_t numYDivs; + int8_t numColors; + + // The offset (from the start of this structure) to the xDivs & yDivs + // array for this 9patch. To get a pointer to this array, call + // getXDivs or getYDivs. Note that the serialized form for 9patches places + // the xDivs, yDivs and colors arrays immediately after the location + // of the Res_png_9patch struct. + uint32_t xDivsOffset; + uint32_t yDivsOffset; + + int32_t paddingLeft, paddingRight; + int32_t paddingTop, paddingBottom; + + enum { + // The 9 patch segment is not a solid color. + NO_COLOR = 0x00000001, + + // The 9 patch segment is completely transparent. + TRANSPARENT_COLOR = 0x00000000 + }; + + // The offset (from the start of this structure) to the colors array + // for this 9patch. + uint32_t colorsOffset; + + // Deserialize/Unmarshall the patch data + static Res_png_9patch20* deserialize(void* data); + + // These tell where the next section of a patch starts. + // For example, the first patch includes the pixels from + // 0 to xDivs[0]-1 and the second patch includes the pixels + // from xDivs[0] to xDivs[1]-1. + inline int32_t* getXDivs() const { + return reinterpret_cast(reinterpret_cast(this) + xDivsOffset); + } + inline int32_t* getYDivs() const { + return reinterpret_cast(reinterpret_cast(this) + yDivsOffset); + } + inline uint32_t* getColors() const { + return reinterpret_cast(reinterpret_cast(this) + colorsOffset); + } + +} __attribute__((packed)); + #endif -- cgit v1.2.3