summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsFont.cpp
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2010-12-08 16:14:36 -0800
committerJason Sams <rjsams@android.com>2010-12-08 16:14:36 -0800
commit5476b450e50939940dcf3f15c92335cee2fc572d (patch)
tree2129f5a5abfdfa6d43ae3e884d759d4614604c41 /libs/rs/rsFont.cpp
parentaf8962e48ecf0ff3833084f540ca7e2f05295560 (diff)
downloadframeworks_base-5476b450e50939940dcf3f15c92335cee2fc572d.zip
frameworks_base-5476b450e50939940dcf3f15c92335cee2fc572d.tar.gz
frameworks_base-5476b450e50939940dcf3f15c92335cee2fc572d.tar.bz2
Allocation API update.
Change-Id: I9b4a71f9e94c7d3978f06b7971051ab4f8472503
Diffstat (limited to 'libs/rs/rsFont.cpp')
-rw-r--r--libs/rs/rsFont.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/rs/rsFont.cpp b/libs/rs/rsFont.cpp
index 107022d..3d17be2 100644
--- a/libs/rs/rsFont.cpp
+++ b/libs/rs/rsFont.cpp
@@ -501,7 +501,8 @@ void FontState::initRenderState() {
tmp[2] = RS_PROGRAM_PARAM_TEXTURE_TYPE;
tmp[3] = RS_TEXTURE_2D;
- mFontShaderFConstant.set(new Allocation(mRSC, inputType));
+ mFontShaderFConstant.set(new Allocation(mRSC, inputType,
+ RS_ALLOCATION_USAGE_SCRIPT | RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS));
ProgramFragment *pf = new ProgramFragment(mRSC, shaderString.string(),
shaderString.length(), tmp, 4);
mFontShaderF.set(pf);
@@ -526,7 +527,7 @@ void FontState::initTextTexture() {
// We will allocate a texture to initially hold 32 character bitmaps
Type *texType = Type::getType(mRSC, alphaElem, 1024, 256, 0, false, false);
- Allocation *cacheAlloc = new Allocation(mRSC, texType);
+ Allocation *cacheAlloc = new Allocation(mRSC, texType, RS_ALLOCATION_USAGE_SCRIPT | RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE);
mTextTexture.set(cacheAlloc);
mTextTexture->deferedUploadToTexture(mRSC, false, 0);
@@ -554,7 +555,7 @@ void FontState::initVertexArrayBuffers() {
uint32_t numIndicies = mMaxNumberOfQuads * 6;
Type *indexType = Type::getType(mRSC, indexElem, numIndicies, 0, 0, false, false);
- Allocation *indexAlloc = new Allocation(mRSC, indexType);
+ Allocation *indexAlloc = new Allocation(mRSC, indexType, RS_ALLOCATION_USAGE_SCRIPT | RS_ALLOCATION_USAGE_GRAPHICS_VERTEX);
uint16_t *indexPtr = (uint16_t*)indexAlloc->getPtr();
// Four verts, two triangles , six indices per quad
@@ -586,7 +587,7 @@ void FontState::initVertexArrayBuffers() {
mMaxNumberOfQuads * 4,
0, 0, false, false);
- Allocation *vertexAlloc = new Allocation(mRSC, vertexDataType);
+ Allocation *vertexAlloc = new Allocation(mRSC, vertexDataType, RS_ALLOCATION_USAGE_SCRIPT | RS_ALLOCATION_USAGE_GRAPHICS_VERTEX);
mTextMeshPtr = (float*)vertexAlloc->getPtr();
mVertexArray.set(vertexAlloc);