Loading libs/hwui/OpenGLRenderer.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading tests/HwAccelerationTest/src/com/android/test/hwui/LinesActivity.java +8 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,14 @@ public class LinesActivity extends Activity { canvas.drawLine(10.0f, 45.0f, 20.0f, 55.0f, mSmallPaint); canvas.drawLine(10.0f, 60.0f, 50.0f, 60.0f, mHairLinePaint); canvas.restore(); canvas.save(); canvas.scale(10.0f, 50.0f); mSmallPaint.setStrokeWidth(0.0f); canvas.drawLine(20.0f, 9.0f, 30.0f, 11.0f, mSmallPaint); mSmallPaint.setStrokeWidth(1.0f); canvas.drawLine(30.0f, 9.0f, 40.0f, 11.0f, mSmallPaint); canvas.restore(); } } } Loading
libs/hwui/OpenGLRenderer.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading
tests/HwAccelerationTest/src/com/android/test/hwui/LinesActivity.java +8 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,14 @@ public class LinesActivity extends Activity { canvas.drawLine(10.0f, 45.0f, 20.0f, 55.0f, mSmallPaint); canvas.drawLine(10.0f, 60.0f, 50.0f, 60.0f, mHairLinePaint); canvas.restore(); canvas.save(); canvas.scale(10.0f, 50.0f); mSmallPaint.setStrokeWidth(0.0f); canvas.drawLine(20.0f, 9.0f, 30.0f, 11.0f, mSmallPaint); mSmallPaint.setStrokeWidth(1.0f); canvas.drawLine(30.0f, 9.0f, 40.0f, 11.0f, mSmallPaint); canvas.restore(); } } }