summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-03-07 19:41:24 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-07 19:41:24 +0000
commitcde786835676f14c4d24cc4769a2de7ead853c5c (patch)
treec6fe4307c7abbbbcd70c9bf40125f5b2df06e7c2 /libs
parent75e20ed78cfa192cd8e7cc4e58b199eae8c876cf (diff)
parentb152473f46d8176e7eb2c55b54342a7a29c525cf (diff)
downloadframeworks_base-cde786835676f14c4d24cc4769a2de7ead853c5c.zip
frameworks_base-cde786835676f14c4d24cc4769a2de7ead853c5c.tar.gz
frameworks_base-cde786835676f14c4d24cc4769a2de7ead853c5c.tar.bz2
am b152473f: am 9fce8535: Merge "AArch64: Make AssetAtlasService 64-bit compatible"
* commit 'b152473f46d8176e7eb2c55b54342a7a29c525cf': AArch64: Make AssetAtlasService 64-bit compatible
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/AssetAtlas.cpp15
-rw-r--r--libs/hwui/AssetAtlas.h4
2 files changed, 12 insertions, 7 deletions
diff --git a/libs/hwui/AssetAtlas.cpp b/libs/hwui/AssetAtlas.cpp
index eb8bb9f..e8c3d3c 100644
--- a/libs/hwui/AssetAtlas.cpp
+++ b/libs/hwui/AssetAtlas.cpp
@@ -28,7 +28,7 @@ namespace uirenderer {
// Lifecycle
///////////////////////////////////////////////////////////////////////////////
-void AssetAtlas::init(sp<GraphicBuffer> buffer, int* map, int count) {
+void AssetAtlas::init(sp<GraphicBuffer> buffer, int64_t* map, int count) {
if (mImage) {
return;
}
@@ -108,14 +108,19 @@ private:
/**
* TODO: This method does not take the rotation flag into account
*/
-void AssetAtlas::createEntries(Caches& caches, int* map, int count) {
+void AssetAtlas::createEntries(Caches& caches, int64_t* map, int count) {
const float width = float(mTexture->width);
const float height = float(mTexture->height);
for (int i = 0; i < count; ) {
- SkBitmap* bitmap = (SkBitmap*) map[i++];
- int x = map[i++];
- int y = map[i++];
+ SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(map[i++]);
+ // NOTE: We're converting from 64 bit signed values to 32 bit
+ // signed values. This is guaranteed to be safe because the "x"
+ // and "y" coordinate values are guaranteed to be representable
+ // with 32 bits. The array is 64 bits wide so that it can carry
+ // pointers on 64 bit architectures.
+ const int x = static_cast<int>(map[i++]);
+ const int y = static_cast<int>(map[i++]);
bool rotated = map[i++] > 0;
// Bitmaps should never be null, we're just extra paranoid
diff --git a/libs/hwui/AssetAtlas.h b/libs/hwui/AssetAtlas.h
index a28efc6..163bdbc 100644
--- a/libs/hwui/AssetAtlas.h
+++ b/libs/hwui/AssetAtlas.h
@@ -121,7 +121,7 @@ public:
* initialized. To re-initialize the atlas, you must
* first call terminate().
*/
- ANDROID_API void init(sp<GraphicBuffer> buffer, int* map, int count);
+ ANDROID_API void init(sp<GraphicBuffer> buffer, int64_t* map, int count);
/**
* Destroys the atlas texture. This object can be
@@ -176,7 +176,7 @@ public:
}
private:
- void createEntries(Caches& caches, int* map, int count);
+ void createEntries(Caches& caches, int64_t* map, int count);
Texture* mTexture;
Image* mImage;