diff options
Diffstat (limited to 'libs/hwui/font/CacheTexture.h')
-rw-r--r-- | libs/hwui/font/CacheTexture.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libs/hwui/font/CacheTexture.h b/libs/hwui/font/CacheTexture.h index ddcc836..61b38f8 100644 --- a/libs/hwui/font/CacheTexture.h +++ b/libs/hwui/font/CacheTexture.h @@ -24,13 +24,14 @@ #include <utils/Log.h> #include "FontUtil.h" +#include "../PixelBuffer.h" #include "../Rect.h" #include "../Vertex.h" namespace android { namespace uirenderer { -class PixelBuffer; +class Caches; /** * CacheBlock is a node in a linked list of current free space areas in a CacheTexture. @@ -73,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(); @@ -99,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; } @@ -150,9 +159,9 @@ public: float x3, float y3, float u3, float v3, float x4, float y4, float u4, float v4) { TextureVertex* mesh = mMesh + mCurrentQuad * 4; - TextureVertex::set(mesh++, x1, y1, u1, v1); TextureVertex::set(mesh++, x2, y2, u2, v2); TextureVertex::set(mesh++, x3, y3, u3, v3); + TextureVertex::set(mesh++, x1, y1, u1, v1); TextureVertex::set(mesh++, x4, y4, u4, v4); mCurrentQuad++; } @@ -172,15 +181,17 @@ private: GLuint mTextureId; uint16_t mWidth; uint16_t mHeight; + GLenum mFormat; bool mLinearFiltering; bool mDirty; uint16_t mNumGlyphs; TextureVertex* mMesh; uint32_t mCurrentQuad; uint32_t mMaxQuadCount; + Caches& mCaches; CacheBlock* mCacheBlocks; + bool mHasUnpackRowLength; Rect mDirtyRect; - bool mHasES3; }; }; // namespace uirenderer |