| Index: src/gpu/SkGpuDevice.cpp
|
| diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
|
| index 4041c411fc1391618b5238c3c85ddd83c13461c3..e656a7ec30aceca12395084ba46a3bb4b574cf2a 100644
|
| --- a/src/gpu/SkGpuDevice.cpp
|
| +++ b/src/gpu/SkGpuDevice.cpp
|
| @@ -613,11 +613,12 @@ void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect,
|
| SkScalar width = paint.getStrokeWidth();
|
|
|
| /*
|
| - We have special code for hairline strokes, miter-strokes, and fills.
|
| - Anything else we just call our path code.
|
| + We have special code for hairline strokes, miter-strokes, bevel-stroke
|
| + and fills. Anything else we just call our path code.
|
| */
|
| bool usePath = doStroke && width > 0 &&
|
| - paint.getStrokeJoin() != SkPaint::kMiter_Join;
|
| + (paint.getStrokeJoin() == SkPaint::kRound_Join ||
|
| + (paint.getStrokeJoin() == SkPaint::kBevel_Join && rect.isEmpty()));
|
| // another two reasons we might need to call drawPath...
|
| if (paint.getMaskFilter() || paint.getPathEffect()) {
|
| usePath = true;
|
| @@ -633,12 +634,6 @@ void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect,
|
| }
|
| #endif
|
| }
|
| - // small miter limit means right angles show bevel...
|
| - if (SkPaint::kMiter_Join == paint.getStrokeJoin() &&
|
| - paint.getStrokeMiter() < SK_ScalarSqrt2)
|
| - {
|
| - usePath = true;
|
| - }
|
| // until we can both stroke and fill rectangles
|
| if (paint.getStyle() == SkPaint::kStrokeAndFill_Style) {
|
| usePath = true;
|
| @@ -655,7 +650,13 @@ void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect,
|
| if (!skPaint2GrPaintShader(this, paint, true, &grPaint)) {
|
| return;
|
| }
|
| - fContext->drawRect(grPaint, rect, doStroke ? width : -1);
|
| +
|
| + if (!doStroke) {
|
| + fContext->drawRect(grPaint, rect);
|
| + } else {
|
| + SkStrokeRec stroke(paint);
|
| + fContext->drawRect(grPaint, rect, &stroke);
|
| + }
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|