diff options
| author | 2014-01-02 17:13:34 -0800 | |
|---|---|---|
| committer | 2014-01-03 13:55:08 -0800 | |
| commit | d218a92c0afb8c0d98135b20b52ac87236e1c935 (patch) | |
| tree | 3eef804e9948ca463e720ac636db46b2637fdabb /libs/hwui/FontRenderer.cpp | |
| parent | 8523706236b0b2536ed4359d92ec6ccdca060d78 (diff) | |
Use const where possible for drawing parameters
They should never be modified by a Renderer, only read and copied.
Change-Id: I9d8d55dca19115ee9dfeb2bb3f092ba2fb327cd4
Diffstat (limited to 'libs/hwui/FontRenderer.cpp')
| -rw-r--r-- | libs/hwui/FontRenderer.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp index f7493a3a7a84..f907d64e9aa3 100644 --- a/libs/hwui/FontRenderer.cpp +++ b/libs/hwui/FontRenderer.cpp @@ -587,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(); @@ -676,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); } @@ -685,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) { @@ -703,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"); |