diff options
Diffstat (limited to 'libs/hwui/AssetAtlas.h')
-rw-r--r-- | libs/hwui/AssetAtlas.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libs/hwui/AssetAtlas.h b/libs/hwui/AssetAtlas.h index 9afc54d..a28efc6 100644 --- a/libs/hwui/AssetAtlas.h +++ b/libs/hwui/AssetAtlas.h @@ -84,11 +84,20 @@ public: */ const AssetAtlas& atlas; + /** + * Unique identifier used to merge bitmaps and 9-patches stored + * in the atlas. + */ + const void* getMergeId() const { + return texture->blend ? &atlas.mBlendKey : &atlas.mOpaqueKey; + } + private: Entry(SkBitmap* bitmap, int x, int y, bool rotated, Texture* texture, const UvMapper& mapper, const AssetAtlas& atlas): bitmap(bitmap), x(x), y(y), rotated(rotated), - texture(texture), uvMapper(mapper), atlas(atlas) { } + texture(texture), uvMapper(mapper), atlas(atlas) { + } ~Entry() { delete texture; @@ -97,7 +106,8 @@ public: friend class AssetAtlas; }; - AssetAtlas(): mTexture(NULL), mImage(NULL), mGenerationId(0) { } + AssetAtlas(): mTexture(NULL), mImage(NULL), mGenerationId(0), + mBlendKey(true), mOpaqueKey(false) { } ~AssetAtlas() { terminate(); } /** @@ -173,6 +183,9 @@ private: uint32_t mGenerationId; + const bool mBlendKey; + const bool mOpaqueKey; + KeyedVector<SkBitmap*, Entry*> mEntries; }; // class AssetAtlas |