Chromium Code Reviews| Index: src/gpu/SkGpuDevice.cpp | 
| =================================================================== | 
| --- src/gpu/SkGpuDevice.cpp (revision 11903) | 
| +++ src/gpu/SkGpuDevice.cpp (working copy) | 
| @@ -620,11 +620,11 @@ | 
| 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; | 
| // another two reasons we might need to call drawPath... | 
| if (paint.getMaskFilter() || paint.getPathEffect()) { | 
| usePath = true; | 
| @@ -640,12 +640,6 @@ | 
| } | 
| #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; | 
| @@ -662,7 +656,9 @@ | 
| if (!skPaint2GrPaintShader(this, paint, true, &grPaint)) { | 
| return; | 
| } | 
| - fContext->drawRect(grPaint, rect, doStroke ? width : -1); | 
| + | 
| 
 
robertphillips
2013/10/30 14:36:08
How expensive is it to create the SkStrokeRect all
 
yunchao
2013/10/31 07:47:23
Agree. create the SkStrokeRec when it is needed to
 
 | 
| + SkStrokeRec stroke(paint); | 
| + fContext->drawRect(grPaint, rect, doStroke ? &stroke : NULL, NULL); | 
| } | 
| /////////////////////////////////////////////////////////////////////////////// |