diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2013-11-22 11:18:57 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2013-11-22 11:18:57 -0800 |
commit | dbccd44a638ae8705a5b14bff8b2dd74abc26045 (patch) | |
tree | 14bfabaf3f3c7be86dfc064e919e00433a0cf2bb /libs/hwui/font/CacheTexture.h | |
parent | ecfae4f899873f224e1aeed076dc8a41f8884487 (diff) | |
parent | b873a17ce7be0a9771c24999adca6964431728f6 (diff) | |
download | frameworks_base-dbccd44a638ae8705a5b14bff8b2dd74abc26045.zip frameworks_base-dbccd44a638ae8705a5b14bff8b2dd74abc26045.tar.gz frameworks_base-dbccd44a638ae8705a5b14bff8b2dd74abc26045.tar.bz2 |
Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD
Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
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 |