diff options
author | 2009-07-10 17:02:17 +0000 | |
---|---|---|
committer | 2009-07-10 17:02:17 +0000 | |
commit | b4f404ac4195e5b1f49e49c591bd69f98b246f9b (patch) | |
tree | 21ae98851110559a7d3ef7a9bc626676ed3ff3e8 /src/core/SkDraw.cpp | |
parent | b602b8e5334edc0bfcdf086c2ea58e2b5d5f1f3b (diff) |
handle cap==round for drawPoints
git-svn-id: http://skia.googlecode.com/svn/trunk@266 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkDraw.cpp')
-rw-r--r-- | src/core/SkDraw.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index 352e4ed42f..2b7c55f425 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -443,6 +443,7 @@ static void aa_square_proc(const PtProcRec& rec, const SkPoint devPts[], } } +// If this guy returns true, then chooseProc() must return a valid proc bool PtProcRec::init(SkCanvas::PointMode mode, const SkPaint& paint, const SkMatrix* matrix, const SkRegion* clip) { if (paint.getPathEffect()) { @@ -456,7 +457,8 @@ bool PtProcRec::init(SkCanvas::PointMode mode, const SkPaint& paint, fRadius = SK_Fixed1 >> 1; return true; } - if (matrix->rectStaysRect() && SkCanvas::kPoints_PointMode == mode) { + if (paint.getStrokeCap() != SkPaint::kRound_Cap && + matrix->rectStaysRect() && SkCanvas::kPoints_PointMode == mode) { SkScalar sx = matrix->get(SkMatrix::kMScaleX); SkScalar sy = matrix->get(SkMatrix::kMScaleY); if (SkScalarNearlyZero(sx - sy)) { @@ -475,7 +477,7 @@ bool PtProcRec::init(SkCanvas::PointMode mode, const SkPaint& paint, } PtProcRec::Proc PtProcRec::chooseProc(SkBlitter* blitter) { - Proc proc; + Proc proc = NULL; // for our arrays SkASSERT(0 == SkCanvas::kPoints_PointMode); @@ -506,7 +508,7 @@ PtProcRec::Proc PtProcRec::chooseProc(SkBlitter* blitter) { proc = gBWProcs[fMode]; } } - } else { + } else if (fPaint->getStrokeCap() != SkPaint::kRound_Cap) { SkASSERT(SkCanvas::kPoints_PointMode == fMode); if (fPaint->isAntiAlias()) { proc = aa_square_proc; |