summaryrefslogtreecommitdiffstats
path: root/libs/hwui/font/CacheTexture.h
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-09-21 08:40:46 -0700
committerChet Haase <chet@google.com>2012-09-23 12:16:02 -0700
commitb92d8f7979c29c7c09932578a11b2f8d6eec1d90 (patch)
treeb82c57bffc1eded3b6fd15d9a80019e3228c7f2d /libs/hwui/font/CacheTexture.h
parent7b770b0ec4e5a1b7f1b9601433fb35e55658453d (diff)
downloadframeworks_base-b92d8f7979c29c7c09932578a11b2f8d6eec1d90.zip
frameworks_base-b92d8f7979c29c7c09932578a11b2f8d6eec1d90.tar.gz
frameworks_base-b92d8f7979c29c7c09932578a11b2f8d6eec1d90.tar.bz2
Optimize glyph cache texture uploads
Only upload the changed area of the glyph cache, not the entire bitmap. Note that we can't do the full-on optimization here of copying a sub-rect of the bitmap because of GL ES 2 limitations, but we can at least copy the horizontal stripe containing the dirty rect, which can still be a big savings over uploading the entire bitmap. Issue #7158326 Bad framerates on MR1 (Mako, Manta, Prime) Change-Id: Iab38d53202650f757ead4658cf4287bdad2b3cb9
Diffstat (limited to 'libs/hwui/font/CacheTexture.h')
-rw-r--r--libs/hwui/font/CacheTexture.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/hwui/font/CacheTexture.h b/libs/hwui/font/CacheTexture.h
index bf1f4a9..800bfc4 100644
--- a/libs/hwui/font/CacheTexture.h
+++ b/libs/hwui/font/CacheTexture.h
@@ -24,6 +24,7 @@
#include <utils/Log.h>
#include "FontUtil.h"
+#include "Rect.h"
namespace android {
namespace uirenderer {
@@ -149,6 +150,10 @@ public:
return mHeight;
}
+ inline const Rect* getDirtyRect() const {
+ return &mDirtyRect;
+ }
+
inline uint8_t* getTexture() const {
return mTexture;
}
@@ -163,6 +168,9 @@ public:
inline void setDirty(bool dirty) {
mDirty = dirty;
+ if (!dirty) {
+ mDirtyRect.setEmpty();
+ }
}
inline bool getLinearFiltering() const {
@@ -196,6 +204,7 @@ private:
bool mDirty;
uint16_t mNumGlyphs;
CacheBlock* mCacheBlocks;
+ Rect mDirtyRect;
};
}; // namespace uirenderer