Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 23712005: Add bevel-stroke support in GrAARectRenderer (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/gpu/GrAARectRenderer.cpp ('K') | « src/gpu/GrContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
///////////////////////////////////////////////////////////////////////////////
« src/gpu/GrAARectRenderer.cpp ('K') | « src/gpu/GrContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698