summaryrefslogtreecommitdiff
path: root/libs/hwui/FontRenderer.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2013-04-15 14:34:35 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2013-04-15 14:34:35 -0700
commit55709fc1c7b2741ba3cf7f160d7d8644c112bb99 (patch)
tree87a36ca622fe814f1ab4f7a78f56acd1c74dee18 /libs/hwui/FontRenderer.cpp
parent647e4b82fea7e566b7173a9398150f1e26f5834f (diff)
parent55b883b0a960b37aa453253f3ccb614dd95c221c (diff)
am 55b883b0: am 30c990c3: Merge "Draw Operation merging" into jb-mr2-dev
* commit '55b883b0a960b37aa453253f3ccb614dd95c221c': Draw Operation merging
Diffstat (limited to 'libs/hwui/FontRenderer.cpp')
-rw-r--r--libs/hwui/FontRenderer.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 9612a4a913d4..a9bf13e8c7f5 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -59,7 +59,6 @@ FontRenderer::FontRenderer() :
mGammaTable = NULL;
mInitialized = false;
- mMaxNumberOfQuads = 1024;
mCurrentCacheTexture = NULL;
@@ -295,7 +294,7 @@ void FontRenderer::cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyp
}
CacheTexture* FontRenderer::createCacheTexture(int width, int height, bool allocate) {
- CacheTexture* cacheTexture = new CacheTexture(width, height, mMaxNumberOfQuads);
+ CacheTexture* cacheTexture = new CacheTexture(width, height, gMaxNumberOfQuads);
if (allocate) {
Caches::getInstance().activeTexture(0);
@@ -322,12 +321,12 @@ void FontRenderer::initTextTexture() {
// Avoid having to reallocate memory and render quad by quad
void FontRenderer::initVertexArrayBuffers() {
- uint32_t numIndices = mMaxNumberOfQuads * 6;
+ uint32_t numIndices = gMaxNumberOfQuads * 6;
uint32_t indexBufferSizeBytes = numIndices * sizeof(uint16_t);
uint16_t* indexBufferData = (uint16_t*) malloc(indexBufferSizeBytes);
// Four verts, two triangles , six indices per quad
- for (uint32_t i = 0; i < mMaxNumberOfQuads; i++) {
+ for (uint32_t i = 0; i < gMaxNumberOfQuads; i++) {
int i6 = i * 6;
int i4 = i * 4;
@@ -601,7 +600,7 @@ void FontRenderer::endPrecaching() {
bool FontRenderer::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, Functor* functor) {
+ const float* positions, Rect* bounds, Functor* functor, bool forceFinish) {
if (!mCurrentFont) {
ALOGE("No font set");
return false;
@@ -609,7 +608,10 @@ bool FontRenderer::renderPosText(SkPaint* paint, const Rect* clip, const char *t
initRender(clip, bounds, functor);
mCurrentFont->render(paint, text, startIndex, len, numGlyphs, x, y, positions);
- finishRender();
+
+ if (forceFinish) {
+ finishRender();
+ }
return mDrawn;
}