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

Side by Side Diff: src/core/SkScan_Hairline.cpp

Issue 1527083002: add caps for hairline moveTo / close (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: check if readpixels fails Created 5 years 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 unified diff | Download patch
« no previous file with comments | « gm/path_stroke_with_zero_length.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkScan.h" 8 #include "SkScan.h"
9 #include "SkBlitter.h" 9 #include "SkBlitter.h"
10 #include "SkRasterClip.h" 10 #include "SkRasterClip.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 case SkPath::kCubic_Verb: { 464 case SkPath::kCubic_Verb: {
465 if (SkPaint::kButt_Cap != capStyle) { 465 if (SkPaint::kButt_Cap != capStyle) {
466 extend_pts<capStyle>(prevVerb, iter.peek(), pts, 4); 466 extend_pts<capStyle>(prevVerb, iter.peek(), pts, 4);
467 } 467 }
468 haircubic(pts, clip, blitter, kMaxCubicSubdivideLevel, lineproc) ; 468 haircubic(pts, clip, blitter, kMaxCubicSubdivideLevel, lineproc) ;
469 lastPt = pts[3]; 469 lastPt = pts[3];
470 } break; 470 } break;
471 case SkPath::kClose_Verb: 471 case SkPath::kClose_Verb:
472 pts[0] = lastPt; 472 pts[0] = lastPt;
473 pts[1] = firstPt; 473 pts[1] = firstPt;
474 if (SkPaint::kButt_Cap != capStyle && prevVerb == SkPath::kMove_ Verb) {
475 // cap moveTo/close to match svg expectations for degenerate segments
476 extend_pts<capStyle>(prevVerb, iter.peek(), pts, 2);
477 }
474 lineproc(pts, 2, clip, blitter); 478 lineproc(pts, 2, clip, blitter);
475 break; 479 break;
476 case SkPath::kDone_Verb: 480 case SkPath::kDone_Verb:
477 break; 481 break;
478 } 482 }
479 if (SkPaint::kButt_Cap != capStyle) { 483 if (SkPaint::kButt_Cap != capStyle) {
480 prevVerb = verb; 484 prevVerb = verb;
481 } 485 }
482 } 486 }
483 } 487 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 580
577 SkAAClipBlitterWrapper wrap; 581 SkAAClipBlitterWrapper wrap;
578 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) { 582 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) {
579 wrap.init(clip, blitter); 583 wrap.init(clip, blitter);
580 blitter = wrap.getBlitter(); 584 blitter = wrap.getBlitter();
581 clipRgn = &wrap.getRgn(); 585 clipRgn = &wrap.getRgn();
582 } 586 }
583 AntiHairLineRgn(pts, count, clipRgn, blitter); 587 AntiHairLineRgn(pts, count, clipRgn, blitter);
584 } 588 }
585 } 589 }
OLDNEW
« no previous file with comments | « gm/path_stroke_with_zero_length.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698