diff options
author | Narayan Kamath <narayan@google.com> | 2014-03-03 17:12:03 +0000 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-03-10 10:00:02 +0000 |
commit | 6381dd4ff212a95be30d2b445d40ff419ab076b4 (patch) | |
tree | ea96f7e229cafae41f7be46a3cf0345edd2dc869 /libs/hwui | |
parent | 3fc3b9fd1bf71351bf1ff2d49d6e10b6acabf068 (diff) | |
download | frameworks_base-6381dd4ff212a95be30d2b445d40ff419ab076b4.zip frameworks_base-6381dd4ff212a95be30d2b445d40ff419ab076b4.tar.gz frameworks_base-6381dd4ff212a95be30d2b445d40ff419ab076b4.tar.bz2 |
LP64: Make 9 patches architecture agnostic.
The Res_png_9patch struct had several pointer members
whose size differed between 32 and 64 bit platforms.
These members have been replaced by uint32_t offsets
to serialized data. The serialized form for 9patches
places a Res_png_9patch object at the beginning of
serialized data, followed by int32_t arrays of xDivs,
yDivs and colors.
Note that these offsets are not strictly required,
since they can be computed from the values of numXDivs,
numYDivs & numColors, however they are called in tight
loops so having them computed once is a beneficial.
This change also removed the unused patch_equals function
from aapt's Image.cpp.
Change-Id: I3b9ac8ae5c05510d41377cae4dff1c69b40c2531
Diffstat (limited to 'libs/hwui')
-rw-r--r-- | libs/hwui/Patch.cpp | 6 | ||||
-rw-r--r-- | libs/hwui/Patch.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libs/hwui/Patch.cpp b/libs/hwui/Patch.cpp index 9b023f9..b2148b0 100644 --- a/libs/hwui/Patch.cpp +++ b/libs/hwui/Patch.cpp @@ -57,7 +57,7 @@ TextureVertex* Patch::createMesh(const float bitmapWidth, const float bitmapHeig if (vertices) return vertices; int8_t emptyQuads = 0; - mColors = patch->colors; + mColors = patch->getColors(); const int8_t numColors = patch->numColors; if (uint8_t(numColors) < sizeof(uint32_t) * 4) { @@ -79,8 +79,8 @@ TextureVertex* Patch::createMesh(const float bitmapWidth, const float bitmapHeig TextureVertex* tempVertices = new TextureVertex[maxVertices]; TextureVertex* vertex = tempVertices; - const int32_t* xDivs = patch->xDivs; - const int32_t* yDivs = patch->yDivs; + const int32_t* xDivs = patch->getXDivs(); + const int32_t* yDivs = patch->getYDivs(); const uint32_t xStretchCount = (xCount + 1) >> 1; const uint32_t yStretchCount = (yCount + 1) >> 1; diff --git a/libs/hwui/Patch.h b/libs/hwui/Patch.h index 763a785..b5e8838 100644 --- a/libs/hwui/Patch.h +++ b/libs/hwui/Patch.h @@ -66,7 +66,7 @@ private: void generateQuad(TextureVertex*& vertex, float x1, float y1, float x2, float y2, float u1, float v1, float u2, float v2, uint32_t& quadCount); - uint32_t* mColors; + const uint32_t* mColors; UvMapper mUvMapper; }; // struct Patch |