diff options
author | Chris Craik <ccraik@google.com> | 2012-09-07 15:27:05 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-07 15:27:05 -0700 |
commit | dc531fa7d4ec545ace1b3daae0849d3101102e49 (patch) | |
tree | 4023b7ace3d64ac779e138d2ea5fce4480ebbaca /libs | |
parent | 330a5bf82e60fca9591f14a4db5ee98066c610d1 (diff) | |
parent | 75040f8a7727f18bb33da23696a32a0760926ff2 (diff) | |
download | frameworks_base-dc531fa7d4ec545ace1b3daae0849d3101102e49.zip frameworks_base-dc531fa7d4ec545ace1b3daae0849d3101102e49.tar.gz frameworks_base-dc531fa7d4ec545ace1b3daae0849d3101102e49.tar.bz2 |
Merge "Handle different x, y scales in drawLines AA path" into jb-mr1-dev
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 05c7809..9f8b87c 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1978,6 +1978,10 @@ status_t OpenGLRenderer::drawLines(float* points, int count, SkPaint* paint) { // Find the normal to the line vec2 n = (b - a).copyNormalized() * halfStrokeWidth; + float x = n.x; + n.x = -n.y; + n.y = x; + if (isHairLine) { if (isAA) { float wideningFactor; @@ -2002,14 +2006,10 @@ status_t OpenGLRenderer::drawLines(float* points, int count, SkPaint* paint) { float extendedNLength = extendedN.length(); // We need to set this value on the shader prior to drawing - boundaryWidthProportion = extendedNLength / (halfStrokeWidth + extendedNLength); + boundaryWidthProportion = .5 - extendedNLength / (halfStrokeWidth + extendedNLength); n += extendedN; } - float x = n.x; - n.x = -n.y; - n.y = x; - // aa lines expand the endpoint vertices to encompass the AA boundary if (isAA) { vec2 abVector = (b - a); |