summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsFont.cpp
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2010-08-18 15:46:43 -0700
committerAlex Sakhartchouk <alexst@google.com>2010-08-18 15:46:43 -0700
commit27f50523a45100f3b4861762b6263e0b9ba6e22e (patch)
treeaec97923b179337917c09bdf09c5880417ca52d2 /libs/rs/rsFont.cpp
parent468c3230dafc2d131bdeded7b5a6825988166244 (diff)
downloadframeworks_base-27f50523a45100f3b4861762b6263e0b9ba6e22e.zip
frameworks_base-27f50523a45100f3b4861762b6263e0b9ba6e22e.tar.gz
frameworks_base-27f50523a45100f3b4861762b6263e0b9ba6e22e.tar.bz2
Renderscript samples. Merged two model related projects. Cleanup.
Change-Id: I6fdc70420eee7dfecf0b051fd687e5797c6580ce
Diffstat (limited to 'libs/rs/rsFont.cpp')
-rw-r--r--libs/rs/rsFont.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/libs/rs/rsFont.cpp b/libs/rs/rsFont.cpp
index 1ef9c93..7661d49 100644
--- a/libs/rs/rsFont.cpp
+++ b/libs/rs/rsFont.cpp
@@ -218,6 +218,7 @@ Font::CachedGlyphInfo *Font::cacheGlyph(uint32_t glyph)
Font * Font::create(Context *rsc, const char *name, uint32_t fontSize, uint32_t dpi)
{
+ rsc->mStateFont.checkInit();
Vector<Font*> &activeFonts = rsc->mStateFont.mActiveFonts;
for(uint32_t i = 0; i < activeFonts.size(); i ++) {
@@ -513,6 +514,12 @@ void FontState::checkInit()
initVertexArrayBuffers();
+ // We store a string with letters in a rough frequency of occurrence
+ mLatinPrecache = String8(" eisarntolcdugpmhbyfvkwzxjq");
+ mLatinPrecache += String8("EISARNTOLCDUGPMHBYFVKWZXJQ");
+ mLatinPrecache += String8(",.?!()-+@;:`'");
+ mLatinPrecache += String8("0123456789");
+
mInitialized = true;
}
@@ -622,7 +629,7 @@ void FontState::appendMeshQuad(float x1, float y1, float z1,
uint32_t FontState::getRemainingCacheCapacity() {
uint32_t remainingCapacity = 0;
- float totalPixels = 0;
+ uint32_t totalPixels = 0;
for(uint32_t i = 0; i < mCacheLines.size(); i ++) {
remainingCapacity += (mCacheLines[i]->mMaxWidth - mCacheLines[i]->mCurrentCol);
totalPixels += mCacheLines[i]->mMaxWidth;
@@ -666,12 +673,6 @@ void FontState::renderText(const char *text, uint32_t len, uint32_t startIndex,
issueDrawCommand();
mCurrentQuadIndex = 0;
}
-
- // We store a string with letters in a rough frequency of occurrence
- mLatinPrecache = String8(" eisarntolcdugpmhbyfvkwzxjq");
- mLatinPrecache += String8("EISARNTOLCDUGPMHBYFVKWZXJQ");
- mLatinPrecache += String8(",.?!()-+@;:`'");
- mLatinPrecache += String8("0123456789");
}
void FontState::renderText(const char *text, int x, int y)