summaryrefslogtreecommitdiff
path: root/libs/hwui/LayerCache.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2013-01-08 11:15:30 -0800
committer Romain Guy <romainguy@google.com> 2013-01-08 15:21:42 -0800
commite3a9b24b5e3f9b2058486814a6d27729e51ad466 (patch)
tree17830a6fd61c286854cebb07638d3c2dea6277cd /libs/hwui/LayerCache.cpp
parent5b4628aeeaa0462cd99256d28b636c06b1845930 (diff)
Add plumbing for better text scaling
Fonts are now described by a transform matrix. This lead to switching from a vector to a hashmap. This change therefore adds new comparators and hash computations to Font. Change-Id: I2daffa7d6287c18554c606b8bfa06640d28b4530
Diffstat (limited to 'libs/hwui/LayerCache.cpp')
-rw-r--r--libs/hwui/LayerCache.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/LayerCache.cpp b/libs/hwui/LayerCache.cpp
index ce74ceec1b27..cfc5b04f2183 100644
--- a/libs/hwui/LayerCache.cpp
+++ b/libs/hwui/LayerCache.cpp
@@ -67,6 +67,14 @@ void LayerCache::setMaxSize(uint32_t maxSize) {
// Caching
///////////////////////////////////////////////////////////////////////////////
+int LayerCache::LayerEntry::compare(const LayerCache::LayerEntry& lhs,
+ const LayerCache::LayerEntry& rhs) {
+ int deltaInt = int(lhs.mWidth) - int(rhs.mWidth);
+ if (deltaInt != 0) return deltaInt;
+
+ return int(lhs.mHeight) - int(rhs.mHeight);
+}
+
void LayerCache::deleteLayer(Layer* layer) {
if (layer) {
LAYER_LOGD("Destroying layer %dx%d, fbo %d", layer->getWidth(), layer->getHeight(),