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

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

Issue 2060543002: fix non-square stroke rects (non-aa) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « gm/strokerect.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 "SkMathPriv.h" 10 #include "SkMathPriv.h"
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 634
635 const SkScalar dx = strokeSize.fX; 635 const SkScalar dx = strokeSize.fX;
636 const SkScalar dy = strokeSize.fY; 636 const SkScalar dy = strokeSize.fY;
637 SkScalar rx = SkScalarHalf(dx); 637 SkScalar rx = SkScalarHalf(dx);
638 SkScalar ry = SkScalarHalf(dy); 638 SkScalar ry = SkScalarHalf(dy);
639 SkRect outer, tmp; 639 SkRect outer, tmp;
640 640
641 outer.set(r.fLeft - rx, r.fTop - ry, 641 outer.set(r.fLeft - rx, r.fTop - ry,
642 r.fRight + rx, r.fBottom + ry); 642 r.fRight + rx, r.fBottom + ry);
643 643
644 if (r.width() <= dx || r.height() <= dx) { 644 if (r.width() <= dx || r.height() <= dy) {
645 SkScan::FillRect(outer, clip, blitter); 645 SkScan::FillRect(outer, clip, blitter);
646 return; 646 return;
647 } 647 }
648 648
649 tmp.set(outer.fLeft, outer.fTop, outer.fRight, outer.fTop + dy); 649 tmp.set(outer.fLeft, outer.fTop, outer.fRight, outer.fTop + dy);
650 SkScan::FillRect(tmp, clip, blitter); 650 SkScan::FillRect(tmp, clip, blitter);
651 tmp.fTop = outer.fBottom - dy; 651 tmp.fTop = outer.fBottom - dy;
652 tmp.fBottom = outer.fBottom; 652 tmp.fBottom = outer.fBottom;
653 SkScan::FillRect(tmp, clip, blitter); 653 SkScan::FillRect(tmp, clip, blitter);
654 654
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 692
693 SkAAClipBlitterWrapper wrap; 693 SkAAClipBlitterWrapper wrap;
694 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) { 694 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) {
695 wrap.init(clip, blitter); 695 wrap.init(clip, blitter);
696 blitter = wrap.getBlitter(); 696 blitter = wrap.getBlitter();
697 clipRgn = &wrap.getRgn(); 697 clipRgn = &wrap.getRgn();
698 } 698 }
699 AntiHairLineRgn(pts, count, clipRgn, blitter); 699 AntiHairLineRgn(pts, count, clipRgn, blitter);
700 } 700 }
701 } 701 }
OLDNEW
« no previous file with comments | « gm/strokerect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698