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

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, 3 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 11177)
+++ src/gpu/SkGpuDevice.cpp (working copy)
@@ -636,11 +636,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 &&
bsalomon 2013/09/17 14:43:49 Can the logic about using a path b/c of stroking b
yunchao 2013/09/22 08:36:37 GrContext::drawRect will not fallback to drawPath.
- 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;
@@ -678,7 +678,11 @@
if (!skPaint2GrPaintShader(this, paint, true, &grPaint)) {
return;
}
- fContext->drawRect(grPaint, rect, doStroke ? width : -1);
+ bool miterStroke = true;
+ if (paint.getStrokeJoin() != SkPaint::kMiter_Join) {
+ miterStroke = false;
+ }
+ fContext->drawRect(grPaint, rect, doStroke ? width : -1, NULL, miterStroke);
}
///////////////////////////////////////////////////////////////////////////////
« 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