summaryrefslogtreecommitdiffstats
path: root/libs/hwui/PatchCache.h
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-11-30 12:04:14 -0800
committerRomain Guy <romainguy@google.com>2010-11-30 12:06:39 -0800
commit6f72bebe92a4db7b5dc83f4ac5b5fd02e3b4e2cd (patch)
tree50c8b82bd203c9c71821a4cf8b649f73d258eeae /libs/hwui/PatchCache.h
parent730666858692ea396f5ad779654b5d86ff90b6ca (diff)
downloadframeworks_base-6f72bebe92a4db7b5dc83f4ac5b5fd02e3b4e2cd.zip
frameworks_base-6f72bebe92a4db7b5dc83f4ac5b5fd02e3b4e2cd.tar.gz
frameworks_base-6f72bebe92a4db7b5dc83f4ac5b5fd02e3b4e2cd.tar.bz2
Update 9patch structure when rendering with different divs/colors.
Bug #3221488 Change-Id: Ifc9e42a991d630feadc9e8032322f37504d09d6d
Diffstat (limited to 'libs/hwui/PatchCache.h')
-rw-r--r--libs/hwui/PatchCache.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/libs/hwui/PatchCache.h b/libs/hwui/PatchCache.h
index c38cd99..951fba3 100644
--- a/libs/hwui/PatchCache.h
+++ b/libs/hwui/PatchCache.h
@@ -61,8 +61,65 @@ public:
}
private:
+ /**
+ * Description of a patch.
+ */
+ struct PatchDescription {
+ PatchDescription(): bitmapWidth(0), bitmapHeight(0), pixelWidth(0), pixelHeight(0),
+ xCount(0), yCount(0), emptyCount(0), colorKey(0) {
+ }
+
+ PatchDescription(const float bitmapWidth, const float bitmapHeight,
+ const float pixelWidth, const float pixelHeight,
+ const uint32_t xCount, const uint32_t yCount,
+ const int8_t emptyCount, const uint32_t colorKey):
+ bitmapWidth(bitmapWidth), bitmapHeight(bitmapHeight),
+ pixelWidth(pixelWidth), pixelHeight(pixelHeight),
+ xCount(xCount), yCount(yCount),
+ emptyCount(emptyCount), colorKey(colorKey) {
+ }
+
+ PatchDescription(const PatchDescription& description):
+ bitmapWidth(description.bitmapWidth), bitmapHeight(description.bitmapHeight),
+ pixelWidth(description.pixelWidth), pixelHeight(description.pixelHeight),
+ xCount(description.xCount), yCount(description.yCount),
+ emptyCount(description.emptyCount), colorKey(description.colorKey) {
+ }
+
+ bool operator<(const PatchDescription& rhs) const {
+ LTE_FLOAT(bitmapWidth) {
+ LTE_FLOAT(bitmapHeight) {
+ LTE_FLOAT(pixelWidth) {
+ LTE_FLOAT(pixelHeight) {
+ LTE_INT(xCount) {
+ LTE_INT(yCount) {
+ LTE_INT(emptyCount) {
+ LTE_INT(colorKey) return false;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private:
+ float bitmapWidth;
+ float bitmapHeight;
+ float pixelWidth;
+ float pixelHeight;
+ uint32_t xCount;
+ uint32_t yCount;
+ int8_t emptyCount;
+ uint32_t colorKey;
+
+ }; // struct PatchDescription
+
uint32_t mMaxEntries;
KeyedVector<PatchDescription, Patch*> mCache;
+
}; // class PatchCache
}; // namespace uirenderer