diff options
Diffstat (limited to 'libs/hwui/FontRenderer.cpp')
| -rw-r--r-- | libs/hwui/FontRenderer.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp index 0be17ff..b52003c 100644 --- a/libs/hwui/FontRenderer.cpp +++ b/libs/hwui/FontRenderer.cpp @@ -72,18 +72,19 @@ status_t TextSetupFunctor::operator ()(int what, void* data) { break; } } - renderer->setupDrawColorFilter(); + renderer->setupDrawColorFilter(paint->getColorFilter()); renderer->setupDrawShader(); - renderer->setupDrawBlending(true, mode); + renderer->setupDrawBlending(paint); renderer->setupDrawProgram(); - renderer->setupDrawModelView(x, y, x, y, pureTranslate, true); + renderer->setupDrawModelView(kModelViewMode_Translate, false, + 0.0f, 0.0f, 0.0f, 0.0f, pureTranslate); // Calling setupDrawTexture with the name 0 will enable the // uv attributes and increase the texture unit count // texture binding will be performed by the font renderer as // needed renderer->setupDrawTexture(0); renderer->setupDrawPureColorUniforms(); - renderer->setupDrawColorFilterUniforms(); + renderer->setupDrawColorFilterUniforms(paint->getColorFilter()); renderer->setupDrawShaderUniforms(pureTranslate); renderer->setupDrawTextGammaUniforms(); @@ -497,7 +498,7 @@ void FontRenderer::issueDrawCommand(Vector<CacheTexture*>& cacheTextures) { } checkTextureUpdate(); - caches.bindIndicesBuffer(); + caches.bindQuadIndicesBuffer(); if (!mDrawn) { // If returns true, a VBO was bound and we must @@ -514,8 +515,8 @@ void FontRenderer::issueDrawCommand(Vector<CacheTexture*>& cacheTextures) { texture->setLinearFiltering(mLinearFiltering, false); TextureVertex* mesh = texture->mesh(); - caches.bindPositionVertexPointer(force, &mesh[0].position[0]); - caches.bindTexCoordsVertexPointer(force, &mesh[0].texture[0]); + caches.bindPositionVertexPointer(force, &mesh[0].x); + caches.bindTexCoordsVertexPointer(force, &mesh[0].u); force = false; glDrawElements(GL_TRIANGLES, texture->meshElementCount(), @@ -586,11 +587,11 @@ void FontRenderer::appendRotatedMeshQuad(float x1, float y1, float u1, float v1, } } -void FontRenderer::setFont(SkPaint* paint, const mat4& matrix) { +void FontRenderer::setFont(const SkPaint* paint, const mat4& matrix) { mCurrentFont = Font::create(this, paint, matrix); } -FontRenderer::DropShadow FontRenderer::renderDropShadow(SkPaint* paint, const char *text, +FontRenderer::DropShadow FontRenderer::renderDropShadow(const SkPaint* paint, const char *text, uint32_t startIndex, uint32_t len, int numGlyphs, uint32_t radius, const float* positions) { checkInit(); @@ -675,7 +676,8 @@ void FontRenderer::finishRender() { issueDrawCommand(); } -void FontRenderer::precache(SkPaint* paint, const char* text, int numGlyphs, const mat4& matrix) { +void FontRenderer::precache(const SkPaint* paint, const char* text, int numGlyphs, + const mat4& matrix) { Font* font = Font::create(this, paint, matrix); font->precache(paint, text, numGlyphs); } @@ -684,7 +686,7 @@ void FontRenderer::endPrecaching() { checkTextureUpdate(); } -bool FontRenderer::renderPosText(SkPaint* paint, const Rect* clip, const char *text, +bool FontRenderer::renderPosText(const 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, bool forceFinish) { if (!mCurrentFont) { @@ -702,8 +704,8 @@ bool FontRenderer::renderPosText(SkPaint* paint, const Rect* clip, const char *t return mDrawn; } -bool FontRenderer::renderTextOnPath(SkPaint* paint, const Rect* clip, const char *text, - uint32_t startIndex, uint32_t len, int numGlyphs, SkPath* path, +bool FontRenderer::renderTextOnPath(const SkPaint* paint, const Rect* clip, const char *text, + uint32_t startIndex, uint32_t len, int numGlyphs, const SkPath* path, float hOffset, float vOffset, Rect* bounds, Functor* functor) { if (!mCurrentFont) { ALOGE("No font set"); |
