2010-07-21 21:33:20 -07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2010-10-27 18:57:51 -07:00
|
|
|
#ifndef ANDROID_HWUI_FONT_RENDERER_H
|
|
|
|
#define ANDROID_HWUI_FONT_RENDERER_H
|
2010-07-21 21:33:20 -07:00
|
|
|
|
|
|
|
#include <utils/String8.h>
|
2010-07-26 11:09:33 -07:00
|
|
|
#include <utils/String16.h>
|
2010-07-21 21:33:20 -07:00
|
|
|
#include <utils/Vector.h>
|
|
|
|
#include <utils/KeyedVector.h>
|
|
|
|
|
|
|
|
#include <SkScalerContext.h>
|
|
|
|
#include <SkPaint.h>
|
2012-02-28 18:17:02 -08:00
|
|
|
#include <SkPathMeasure.h>
|
|
|
|
#include <SkPoint.h>
|
2010-07-21 21:33:20 -07:00
|
|
|
|
|
|
|
#include <GLES2/gl2.h>
|
|
|
|
|
2010-07-22 13:08:20 -07:00
|
|
|
#include "Rect.h"
|
2010-07-23 00:28:00 -07:00
|
|
|
#include "Properties.h"
|
2010-07-22 13:08:20 -07:00
|
|
|
|
2010-07-21 21:33:20 -07:00
|
|
|
namespace android {
|
|
|
|
namespace uirenderer {
|
|
|
|
|
2011-06-01 14:52:00 -07:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Defines
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#if RENDER_TEXT_AS_GLYPHS
|
|
|
|
typedef uint16_t glyph_t;
|
|
|
|
#define GET_METRICS(paint, glyph) paint->getGlyphMetrics(glyph)
|
|
|
|
#define GET_GLYPH(text) nextGlyph((const uint16_t**) &text)
|
|
|
|
#define IS_END_OF_STRING(glyph) false
|
|
|
|
#else
|
|
|
|
typedef SkUnichar glyph_t;
|
|
|
|
#define GET_METRICS(paint, glyph) paint->getUnicharMetrics(glyph)
|
|
|
|
#define GET_GLYPH(text) SkUTF16_NextUnichar((const uint16_t**) &text)
|
|
|
|
#define IS_END_OF_STRING(glyph) glyph < 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Declarations
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2010-07-21 21:33:20 -07:00
|
|
|
class FontRenderer;
|
|
|
|
|
2011-12-05 16:35:38 -08:00
|
|
|
class CacheTexture {
|
|
|
|
public:
|
|
|
|
CacheTexture(){}
|
|
|
|
CacheTexture(uint8_t* texture, GLuint textureId, uint16_t width, uint16_t height) :
|
2011-12-14 15:22:56 -08:00
|
|
|
mTexture(texture), mTextureId(textureId), mWidth(width), mHeight(height),
|
|
|
|
mLinearFiltering(false) {}
|
2011-12-05 16:35:38 -08:00
|
|
|
~CacheTexture() {
|
|
|
|
if (mTexture != NULL) {
|
|
|
|
delete[] mTexture;
|
|
|
|
}
|
|
|
|
if (mTextureId != 0) {
|
|
|
|
glDeleteTextures(1, &mTextureId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t* mTexture;
|
|
|
|
GLuint mTextureId;
|
|
|
|
uint16_t mWidth;
|
|
|
|
uint16_t mHeight;
|
2011-12-14 15:22:56 -08:00
|
|
|
bool mLinearFiltering;
|
2011-12-05 16:35:38 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CacheTextureLine {
|
|
|
|
public:
|
|
|
|
CacheTextureLine(uint16_t maxWidth, uint16_t maxHeight, uint32_t currentRow,
|
|
|
|
uint32_t currentCol, CacheTexture* cacheTexture):
|
|
|
|
mMaxHeight(maxHeight),
|
|
|
|
mMaxWidth(maxWidth),
|
|
|
|
mCurrentRow(currentRow),
|
|
|
|
mCurrentCol(currentCol),
|
|
|
|
mDirty(false),
|
|
|
|
mCacheTexture(cacheTexture){
|
|
|
|
}
|
|
|
|
|
|
|
|
bool fitBitmap(const SkGlyph& glyph, uint32_t *retOriginX, uint32_t *retOriginY);
|
|
|
|
|
|
|
|
uint16_t mMaxHeight;
|
|
|
|
uint16_t mMaxWidth;
|
|
|
|
uint32_t mCurrentRow;
|
|
|
|
uint32_t mCurrentCol;
|
|
|
|
bool mDirty;
|
|
|
|
CacheTexture *mCacheTexture;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CachedGlyphInfo {
|
|
|
|
// Has the cache been invalidated?
|
|
|
|
bool mIsValid;
|
|
|
|
// Location of the cached glyph in the bitmap
|
|
|
|
// in case we need to resize the texture or
|
|
|
|
// render to bitmap
|
|
|
|
uint32_t mStartX;
|
|
|
|
uint32_t mStartY;
|
|
|
|
uint32_t mBitmapWidth;
|
|
|
|
uint32_t mBitmapHeight;
|
|
|
|
// Also cache texture coords for the quad
|
|
|
|
float mBitmapMinU;
|
|
|
|
float mBitmapMinV;
|
|
|
|
float mBitmapMaxU;
|
|
|
|
float mBitmapMaxV;
|
|
|
|
// Minimize how much we call freetype
|
|
|
|
uint32_t mGlyphIndex;
|
|
|
|
uint32_t mAdvanceX;
|
|
|
|
uint32_t mAdvanceY;
|
|
|
|
// Values below contain a glyph's origin in the bitmap
|
|
|
|
int32_t mBitmapLeft;
|
|
|
|
int32_t mBitmapTop;
|
|
|
|
// Auto-kerning
|
|
|
|
SkFixed mLsbDelta;
|
|
|
|
SkFixed mRsbDelta;
|
|
|
|
CacheTextureLine* mCachedTextureLine;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-06-01 14:52:00 -07:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Font
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2010-07-23 00:28:00 -07:00
|
|
|
/**
|
|
|
|
* Represents a font, defined by a Skia font id and a font size. A font is used
|
|
|
|
* to generate glyphs and cache them in the FontState.
|
|
|
|
*/
|
2010-07-21 21:33:20 -07:00
|
|
|
class Font {
|
|
|
|
public:
|
2011-01-05 15:26:55 -08:00
|
|
|
enum Style {
|
2011-03-23 14:59:20 -07:00
|
|
|
kFakeBold = 1
|
2011-01-05 15:26:55 -08:00
|
|
|
};
|
|
|
|
|
2010-07-21 21:33:20 -07:00
|
|
|
~Font();
|
|
|
|
|
2010-07-23 00:28:00 -07:00
|
|
|
/**
|
|
|
|
* Renders the specified string of text.
|
2010-08-06 14:49:04 -07:00
|
|
|
* If bitmap is specified, it will be used as the render target
|
2010-07-23 00:28:00 -07:00
|
|
|
*/
|
2011-06-01 14:52:00 -07:00
|
|
|
void render(SkPaint* paint, const char *text, uint32_t start, uint32_t len,
|
|
|
|
int numGlyphs, int x, int y, uint8_t *bitmap = NULL,
|
|
|
|
uint32_t bitmapW = 0, uint32_t bitmapH = 0);
|
2012-01-18 12:39:17 -08:00
|
|
|
|
|
|
|
void render(SkPaint* paint, const char *text, uint32_t start, uint32_t len,
|
|
|
|
int numGlyphs, int x, int y, const float* positions);
|
|
|
|
|
2012-02-28 18:17:02 -08:00
|
|
|
void render(SkPaint* paint, const char *text, uint32_t start, uint32_t len,
|
|
|
|
int numGlyphs, SkPath* path, float hOffset, float vOffset);
|
|
|
|
|
2010-07-23 00:28:00 -07:00
|
|
|
/**
|
|
|
|
* Creates a new font associated with the specified font state.
|
|
|
|
*/
|
2011-01-18 13:02:38 -08:00
|
|
|
static Font* create(FontRenderer* state, uint32_t fontId, float fontSize,
|
2011-08-02 17:32:41 -07:00
|
|
|
int flags, uint32_t italicStyle, uint32_t scaleX, SkPaint::Style style,
|
|
|
|
uint32_t strokeWidth);
|
2010-07-21 21:33:20 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
friend class FontRenderer;
|
2012-01-18 12:39:17 -08:00
|
|
|
typedef void (Font::*RenderGlyph)(CachedGlyphInfo*, int, int, uint8_t*,
|
|
|
|
uint32_t, uint32_t, Rect*, const float*);
|
2010-07-21 21:33:20 -07:00
|
|
|
|
2010-08-06 14:49:04 -07:00
|
|
|
enum RenderMode {
|
|
|
|
FRAMEBUFFER,
|
|
|
|
BITMAP,
|
|
|
|
MEASURE,
|
|
|
|
};
|
|
|
|
|
2011-06-01 14:52:00 -07:00
|
|
|
void render(SkPaint* paint, const char *text, uint32_t start, uint32_t len,
|
|
|
|
int numGlyphs, int x, int y, RenderMode mode, uint8_t *bitmap,
|
2012-01-18 12:39:17 -08:00
|
|
|
uint32_t bitmapW, uint32_t bitmapH, Rect *bounds, const float* positions);
|
2010-08-06 14:49:04 -07:00
|
|
|
|
2011-06-01 14:52:00 -07:00
|
|
|
void measure(SkPaint* paint, const char* text, uint32_t start, uint32_t len,
|
|
|
|
int numGlyphs, Rect *bounds);
|
2010-08-06 14:49:04 -07:00
|
|
|
|
2011-03-02 13:51:36 -08:00
|
|
|
Font(FontRenderer* state, uint32_t fontId, float fontSize, int flags, uint32_t italicStyle,
|
2011-08-02 17:32:41 -07:00
|
|
|
uint32_t scaleX, SkPaint::Style style, uint32_t strokeWidth);
|
2010-07-21 21:33:20 -07:00
|
|
|
|
2011-06-01 14:52:00 -07:00
|
|
|
// Cache of glyphs
|
|
|
|
DefaultKeyedVector<glyph_t, CachedGlyphInfo*> mCachedGlyphs;
|
2010-07-21 21:33:20 -07:00
|
|
|
|
2011-12-16 15:44:59 -08:00
|
|
|
void invalidateTextureCache(CacheTextureLine *cacheLine = NULL);
|
2010-07-22 18:50:12 -07:00
|
|
|
|
2011-06-01 14:52:00 -07:00
|
|
|
CachedGlyphInfo* cacheGlyph(SkPaint* paint, glyph_t glyph);
|
2012-01-18 12:39:17 -08:00
|
|
|
void updateGlyphCache(SkPaint* paint, const SkGlyph& skiaGlyph, CachedGlyphInfo* glyph);
|
|
|
|
|
|
|
|
void measureCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
|
|
|
|
uint8_t *bitmap, uint32_t bitmapW, uint32_t bitmapH,
|
|
|
|
Rect* bounds, const float* pos);
|
|
|
|
void drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
|
|
|
|
uint8_t *bitmap, uint32_t bitmapW, uint32_t bitmapH,
|
|
|
|
Rect* bounds, const float* pos);
|
|
|
|
void drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y,
|
|
|
|
uint8_t *bitmap, uint32_t bitmapW, uint32_t bitmapH,
|
|
|
|
Rect* bounds, const float* pos);
|
2012-02-28 18:17:02 -08:00
|
|
|
void drawCachedGlyph(CachedGlyphInfo* glyph, float x, float hOffset, float vOffset,
|
|
|
|
SkPathMeasure& measure, SkPoint* position, SkVector* tangent);
|
2010-07-22 18:50:12 -07:00
|
|
|
|
2011-06-01 14:52:00 -07:00
|
|
|
CachedGlyphInfo* getCachedGlyph(SkPaint* paint, glyph_t textUnit);
|
|
|
|
|
|
|
|
static glyph_t nextGlyph(const uint16_t** srcPtr) {
|
|
|
|
const uint16_t* src = *srcPtr;
|
|
|
|
glyph_t g = *src++;
|
|
|
|
*srcPtr = src;
|
|
|
|
return g;
|
|
|
|
}
|
2010-07-26 11:09:33 -07:00
|
|
|
|
2010-07-22 18:50:12 -07:00
|
|
|
FontRenderer* mState;
|
|
|
|
uint32_t mFontId;
|
|
|
|
float mFontSize;
|
2011-01-05 15:26:55 -08:00
|
|
|
int mFlags;
|
2011-01-18 13:02:38 -08:00
|
|
|
uint32_t mItalicStyle;
|
2011-03-02 13:51:36 -08:00
|
|
|
uint32_t mScaleX;
|
2011-08-02 17:32:41 -07:00
|
|
|
SkPaint::Style mStyle;
|
|
|
|
uint32_t mStrokeWidth;
|
2010-07-21 21:33:20 -07:00
|
|
|
};
|
|
|
|
|
2011-06-01 14:52:00 -07:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Renderer
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2010-07-21 21:33:20 -07:00
|
|
|
class FontRenderer {
|
|
|
|
public:
|
|
|
|
FontRenderer();
|
|
|
|
~FontRenderer();
|
|
|
|
|
|
|
|
void init();
|
|
|
|
void deinit();
|
2011-12-16 15:44:59 -08:00
|
|
|
void flushLargeCaches();
|
2010-07-21 21:33:20 -07:00
|
|
|
|
2010-08-26 20:35:23 -07:00
|
|
|
void setGammaTable(const uint8_t* gammaTable) {
|
|
|
|
mGammaTable = gammaTable;
|
|
|
|
}
|
|
|
|
|
2010-07-26 11:09:33 -07:00
|
|
|
void setFont(SkPaint* paint, uint32_t fontId, float fontSize);
|
2012-01-18 12:39:17 -08:00
|
|
|
// bounds is an out parameter
|
2010-10-27 18:57:51 -07:00
|
|
|
bool renderText(SkPaint* paint, const Rect* clip, const char *text, uint32_t startIndex,
|
|
|
|
uint32_t len, int numGlyphs, int x, int y, Rect* bounds);
|
2012-01-18 12:39:17 -08:00
|
|
|
// bounds is an out parameter
|
|
|
|
bool renderPosText(SkPaint* paint, const Rect* clip, const char *text, uint32_t startIndex,
|
|
|
|
uint32_t len, int numGlyphs, int x, int y, const float* positions, Rect* bounds);
|
2012-02-28 18:17:02 -08:00
|
|
|
// bounds is an out parameter
|
|
|
|
bool renderTextOnPath(SkPaint* paint, const Rect* clip, const char *text, uint32_t startIndex,
|
|
|
|
uint32_t len, int numGlyphs, SkPath* path, float hOffset, float vOffset, Rect* bounds);
|
2010-07-21 21:33:20 -07:00
|
|
|
|
2010-08-06 14:49:04 -07:00
|
|
|
struct DropShadow {
|
2010-08-13 19:39:53 -07:00
|
|
|
DropShadow() { };
|
|
|
|
|
|
|
|
DropShadow(const DropShadow& dropShadow):
|
|
|
|
width(dropShadow.width), height(dropShadow.height),
|
|
|
|
image(dropShadow.image), penX(dropShadow.penX),
|
|
|
|
penY(dropShadow.penY) {
|
|
|
|
}
|
|
|
|
|
2010-08-06 14:49:04 -07:00
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
uint8_t* image;
|
|
|
|
int32_t penX;
|
|
|
|
int32_t penY;
|
|
|
|
};
|
|
|
|
|
|
|
|
// After renderDropShadow returns, the called owns the memory in DropShadow.image
|
|
|
|
// and is responsible for releasing it when it's done with it
|
|
|
|
DropShadow renderDropShadow(SkPaint* paint, const char *text, uint32_t startIndex,
|
2010-08-13 19:39:53 -07:00
|
|
|
uint32_t len, int numGlyphs, uint32_t radius);
|
2010-08-06 14:49:04 -07:00
|
|
|
|
2010-10-04 14:14:11 -07:00
|
|
|
GLuint getTexture(bool linearFiltering = false) {
|
2010-07-21 21:33:20 -07:00
|
|
|
checkInit();
|
2011-12-14 15:22:56 -08:00
|
|
|
if (linearFiltering != mCurrentCacheTexture->mLinearFiltering) {
|
|
|
|
mCurrentCacheTexture->mLinearFiltering = linearFiltering;
|
2010-10-04 14:14:11 -07:00
|
|
|
mLinearFiltering = linearFiltering;
|
|
|
|
const GLenum filtering = linearFiltering ? GL_LINEAR : GL_NEAREST;
|
|
|
|
|
2011-12-05 16:35:38 -08:00
|
|
|
glBindTexture(GL_TEXTURE_2D, mCurrentCacheTexture->mTextureId);
|
2010-10-04 14:14:11 -07:00
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
|
|
|
}
|
2011-12-05 16:35:38 -08:00
|
|
|
return mCurrentCacheTexture->mTextureId;
|
2010-11-10 11:59:15 -08:00
|
|
|
}
|
|
|
|
|
2011-12-05 16:35:38 -08:00
|
|
|
uint32_t getCacheSize() const {
|
|
|
|
uint32_t size = 0;
|
|
|
|
if (mCacheTextureSmall != NULL && mCacheTextureSmall->mTexture != NULL) {
|
|
|
|
size += mCacheTextureSmall->mWidth * mCacheTextureSmall->mHeight;
|
|
|
|
}
|
|
|
|
if (mCacheTexture128 != NULL && mCacheTexture128->mTexture != NULL) {
|
|
|
|
size += mCacheTexture128->mWidth * mCacheTexture128->mHeight;
|
|
|
|
}
|
|
|
|
if (mCacheTexture256 != NULL && mCacheTexture256->mTexture != NULL) {
|
|
|
|
size += mCacheTexture256->mWidth * mCacheTexture256->mHeight;
|
|
|
|
}
|
|
|
|
if (mCacheTexture512 != NULL && mCacheTexture512->mTexture != NULL) {
|
|
|
|
size += mCacheTexture512->mWidth * mCacheTexture512->mHeight;
|
|
|
|
}
|
|
|
|
return size;
|
2010-11-10 11:59:15 -08:00
|
|
|
}
|
|
|
|
|
2010-07-21 21:33:20 -07:00
|
|
|
protected:
|
|
|
|
friend class Font;
|
|
|
|
|
2010-08-26 20:35:23 -07:00
|
|
|
const uint8_t* mGammaTable;
|
|
|
|
|
2011-12-14 15:22:56 -08:00
|
|
|
void allocateTextureMemory(CacheTexture* cacheTexture);
|
2011-12-16 15:44:59 -08:00
|
|
|
void deallocateTextureMemory(CacheTexture* cacheTexture);
|
2011-12-05 16:35:38 -08:00
|
|
|
void initTextTexture();
|
2012-02-28 18:17:02 -08:00
|
|
|
CacheTexture* createCacheTexture(int width, int height, bool allocate);
|
2011-12-05 16:35:38 -08:00
|
|
|
void cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyph,
|
|
|
|
uint32_t *retOriginX, uint32_t *retOriginY);
|
2010-07-21 21:33:20 -07:00
|
|
|
|
|
|
|
void flushAllAndInvalidate();
|
|
|
|
void initVertexArrayBuffers();
|
|
|
|
|
|
|
|
void checkInit();
|
2012-01-18 12:39:17 -08:00
|
|
|
void initRender(const Rect* clip, Rect* bounds);
|
|
|
|
void finishRender();
|
2010-07-21 21:33:20 -07:00
|
|
|
|
2010-07-26 11:09:33 -07:00
|
|
|
String16 mLatinPrecache;
|
|
|
|
void precacheLatin(SkPaint* paint);
|
|
|
|
|
2010-07-21 21:33:20 -07:00
|
|
|
void issueDrawCommand();
|
2012-02-28 18:17:02 -08:00
|
|
|
void appendMeshQuadNoClip(float x1, float y1, float u1, float v1,
|
|
|
|
float x2, float y2, float u2, float v2,
|
|
|
|
float x3, float y3, float u3, float v3,
|
|
|
|
float x4, float y4, float u4, float v4, CacheTexture* texture);
|
2011-12-12 19:03:35 -08:00
|
|
|
void appendMeshQuad(float x1, float y1, float u1, float v1,
|
|
|
|
float x2, float y2, float u2, float v2,
|
|
|
|
float x3, float y3, float u3, float v3,
|
2011-12-05 16:35:38 -08:00
|
|
|
float x4, float y4, float u4, float v4, CacheTexture* texture);
|
2012-02-28 18:17:02 -08:00
|
|
|
void appendRotatedMeshQuad(float x1, float y1, float u1, float v1,
|
|
|
|
float x2, float y2, float u2, float v2,
|
|
|
|
float x3, float y3, float u3, float v3,
|
|
|
|
float x4, float y4, float u4, float v4, CacheTexture* texture);
|
2010-07-21 21:33:20 -07:00
|
|
|
|
2011-12-05 16:35:38 -08:00
|
|
|
uint32_t mSmallCacheWidth;
|
|
|
|
uint32_t mSmallCacheHeight;
|
2010-07-21 21:33:20 -07:00
|
|
|
|
|
|
|
Vector<CacheTextureLine*> mCacheLines;
|
2010-07-26 11:09:33 -07:00
|
|
|
uint32_t getRemainingCacheCapacity();
|
2010-07-21 21:33:20 -07:00
|
|
|
|
2010-07-22 13:08:20 -07:00
|
|
|
Font* mCurrentFont;
|
2010-07-21 21:33:20 -07:00
|
|
|
Vector<Font*> mActiveFonts;
|
|
|
|
|
2011-12-05 16:35:38 -08:00
|
|
|
CacheTexture* mCurrentCacheTexture;
|
|
|
|
CacheTexture* mLastCacheTexture;
|
|
|
|
CacheTexture* mCacheTextureSmall;
|
|
|
|
CacheTexture* mCacheTexture128;
|
|
|
|
CacheTexture* mCacheTexture256;
|
|
|
|
CacheTexture* mCacheTexture512;
|
|
|
|
|
2010-07-23 14:45:49 -07:00
|
|
|
void checkTextureUpdate();
|
2010-07-21 21:33:20 -07:00
|
|
|
bool mUploadTexture;
|
|
|
|
|
|
|
|
// Pointer to vertex data to speed up frame to frame work
|
|
|
|
float *mTextMeshPtr;
|
|
|
|
uint32_t mCurrentQuadIndex;
|
|
|
|
uint32_t mMaxNumberOfQuads;
|
|
|
|
|
|
|
|
uint32_t mIndexBufferID;
|
|
|
|
|
2010-07-22 13:08:20 -07:00
|
|
|
const Rect* mClip;
|
2010-10-27 18:57:51 -07:00
|
|
|
Rect* mBounds;
|
|
|
|
bool mDrawn;
|
2010-07-22 13:08:20 -07:00
|
|
|
|
2010-07-21 21:33:20 -07:00
|
|
|
bool mInitialized;
|
2010-08-02 17:52:30 -07:00
|
|
|
|
2010-10-04 14:14:11 -07:00
|
|
|
bool mLinearFiltering;
|
|
|
|
|
2010-08-02 17:52:30 -07:00
|
|
|
void computeGaussianWeights(float* weights, int32_t radius);
|
|
|
|
void horizontalBlur(float* weights, int32_t radius, const uint8_t *source, uint8_t *dest,
|
2010-08-13 19:39:53 -07:00
|
|
|
int32_t width, int32_t height);
|
2010-08-02 17:52:30 -07:00
|
|
|
void verticalBlur(float* weights, int32_t radius, const uint8_t *source, uint8_t *dest,
|
2010-08-13 19:39:53 -07:00
|
|
|
int32_t width, int32_t height);
|
2010-08-02 17:52:30 -07:00
|
|
|
void blurImage(uint8_t* image, int32_t width, int32_t height, int32_t radius);
|
2010-07-21 21:33:20 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace uirenderer
|
|
|
|
}; // namespace android
|
|
|
|
|
2010-10-27 18:57:51 -07:00
|
|
|
#endif // ANDROID_HWUI_FONT_RENDERER_H
|