aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar yunchao.he <yunchao.he@intel.com>2014-07-28 19:18:49 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-28 19:18:49 -0700
commit2bff230d835fbc84f0ce8b2e7a399fe8416ec7c8 (patch)
tree6a096046193a0c0696340581026f50f649702fb2
parent15ab26d94242a790230aee6f2c4889bca910c8f7 (diff)
round and bevel hairline rects show the same as miter hairline rects
So round and bevel hairline rects can generate the vertices and indices the same as miter rects do. The original code behaves the same as bevel rects for round and bevel hairline rects. This small CL can save (vertices and indices) buffer memory as well as improve performance (draw less triangles). gm cases show no difference after this CL is applied. BUG=skia: R=robertphillips@google.com Author: yunchao.he@intel.com Review URL: https://codereview.chromium.org/417113002
-rw-r--r--src/gpu/GrAARectRenderer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp
index 59e9b6f810..0cea0ddd88 100644
--- a/src/gpu/GrAARectRenderer.cpp
+++ b/src/gpu/GrAARectRenderer.cpp
@@ -759,8 +759,10 @@ void GrAARectRenderer::strokeAARect(GrGpu* gpu,
devOutside.outset(rx, ry);
bool miterStroke = true;
+ // For hairlines, make bevel and round joins appear the same as mitered ones.
// small miter limit means right angles show bevel...
- if (stroke.getJoin() != SkPaint::kMiter_Join || stroke.getMiter() < SK_ScalarSqrt2) {
+ if ((width > 0) && (stroke.getJoin() != SkPaint::kMiter_Join ||
+ stroke.getMiter() < SK_ScalarSqrt2)) {
miterStroke = false;
}