summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-01-23 13:32:12 -0800
committerRomain Guy <romainguy@google.com>2011-01-23 13:32:12 -0800
commitf6834478b379856d3e5de92ddce7de0e6ba9fa4a (patch)
treeac7fb70de40ec8487112fd1bcfc3684d980ba718 /libs/hwui
parentb149f5c8d29cda2f2e46559a68467be89714f737 (diff)
downloadframeworks_base-f6834478b379856d3e5de92ddce7de0e6ba9fa4a.zip
frameworks_base-f6834478b379856d3e5de92ddce7de0e6ba9fa4a.tar.gz
frameworks_base-f6834478b379856d3e5de92ddce7de0e6ba9fa4a.tar.bz2
Always render text underline extra.
Bug #3381287 Change-Id: Ibfbc9c51c8dccef216daccc37d835e5dbf143a6a
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp9
-rw-r--r--libs/hwui/TextureCache.cpp2
2 files changed, 8 insertions, 3 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 92aa4bd..9aa3e7c 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1706,12 +1706,17 @@ void OpenGLRenderer::drawTextDecorations(const char* text, int bytesCount, float
if (underlineWidth > 0.0f) {
const float textSize = paint->getTextSize();
- const float strokeWidth = textSize * kStdUnderline_Thickness;
+ // TODO: Support stroke width < 1.0f when we have AA lines
+ const float strokeWidth = fmax(textSize * kStdUnderline_Thickness, 1.0f);
const float left = x - offsetX;
float top = 0.0f;
- const int pointsCount = 4 * (flags & SkPaint::kStrikeThruText_Flag ? 2 : 1);
+ int linesCount = 0;
+ if (flags & SkPaint::kUnderlineText_Flag) linesCount++;
+ if (flags & SkPaint::kStrikeThruText_Flag) linesCount++;
+
+ const int pointsCount = 4 * linesCount;
float points[pointsCount];
int currentPoint = 0;
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index 6fc2ddb..e560b8f 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -60,7 +60,7 @@ void TextureCache::init() {
mCache.setOnEntryRemovedListener(this);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
- LOGD(" Maximum texture dimension is %d pixels", mMaxTextureSize);
+ INIT_LOGD(" Maximum texture dimension is %d pixels", mMaxTextureSize);
mDebugEnabled = readDebugLevel() & kDebugCaches;
}