diff options
Diffstat (limited to 'libs/hwui/font/CacheTexture.h')
-rw-r--r-- | libs/hwui/font/CacheTexture.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libs/hwui/font/CacheTexture.h b/libs/hwui/font/CacheTexture.h index 208b1ff..028b611 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 "../PixelBuffer.h" #include "../Rect.h" #include "../Vertex.h" @@ -31,7 +32,6 @@ namespace android { namespace uirenderer { class Caches; -class PixelBuffer; /** * CacheBlock is a node in a linked list of current free space areas in a CacheTexture. @@ -74,7 +74,7 @@ struct CacheBlock { class CacheTexture { public: - CacheTexture(uint16_t width, uint16_t height, uint32_t maxQuadCount); + CacheTexture(uint16_t width, uint16_t height, GLenum format, uint32_t maxQuadCount); ~CacheTexture(); void reset(); @@ -100,6 +100,14 @@ public: return mHeight; } + inline GLenum getFormat() const { + return mFormat; + } + + inline uint32_t getOffset(uint16_t x, uint16_t y) const { + return (y * mWidth + x) * PixelBuffer::formatSize(mFormat); + } + inline const Rect* getDirtyRect() const { return &mDirtyRect; } @@ -173,6 +181,7 @@ private: GLuint mTextureId; uint16_t mWidth; uint16_t mHeight; + GLenum mFormat; bool mLinearFiltering; bool mDirty; uint16_t mNumGlyphs; |