summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-09-04 16:56:16 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-04 16:56:16 -0700
commitd84aaa23a53b57834b0722ad36c460833dc4823c (patch)
tree8e49bb44218800edd1d7645828ba1cb4d60b83d6
parentc83f982804e39b957fbef5bc3ecab163e03b216e (diff)
parent8f5ad7657b6c7cdb8927d7da5140602b68b450ac (diff)
downloadframeworks_base-d84aaa23a53b57834b0722ad36c460833dc4823c.zip
frameworks_base-d84aaa23a53b57834b0722ad36c460833dc4823c.tar.gz
frameworks_base-d84aaa23a53b57834b0722ad36c460833dc4823c.tar.bz2
Merge "Fix line drawing path to use proportional distance from center" into jb-mr1-dev
-rw-r--r--libs/hwui/OpenGLRenderer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 2f43be8..7abcc63 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1933,7 +1933,7 @@ status_t OpenGLRenderer::drawLines(float* points, int count, SkPaint* paint) {
// This value is used in the fragment shader to determine how to fill fragments.
// We will need to calculate the actual width proportion on each segment for
// scaled non-hairlines, since the boundary proportion may differ per-axis when scaled.
- float boundaryWidthProportion = 1 / (2 * halfStrokeWidth);
+ float boundaryWidthProportion = .5 - 1 / (2 * halfStrokeWidth);
setupDrawAALine((void*) aaVertices, widthCoords, lengthCoords,
boundaryWidthProportion, widthSlot, lengthSlot);
}
@@ -1997,9 +1997,9 @@ status_t OpenGLRenderer::drawLines(float* points, int count, SkPaint* paint) {
abVector.x *= inverseScaleX;
abVector.y *= inverseScaleY;
float abLength = abVector.length();
- boundaryLengthProportion = abLength / (length + abLength);
+ boundaryLengthProportion = .5 - abLength / (length + abLength);
} else {
- boundaryLengthProportion = .5 / (length + 1);
+ boundaryLengthProportion = .5 - .5 / (length + 1);
}
abVector /= 2;