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

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

Issue 742663002: add roundOut that returns its result (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « src/core/SkScalerContext.cpp ('k') | src/core/SkScan_Hairline.cpp » ('j') | 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 /* 2 /*
3 * Copyright 2011 The Android Open Source Project 3 * Copyright 2011 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkScan.h" 10 #include "SkScan.h"
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 */ 847 */
848 void SkScan::AntiFillRect(const SkRect& origR, const SkRegion* clip, 848 void SkScan::AntiFillRect(const SkRect& origR, const SkRegion* clip,
849 SkBlitter* blitter) { 849 SkBlitter* blitter) {
850 if (clip) { 850 if (clip) {
851 SkRect newR; 851 SkRect newR;
852 newR.set(clip->getBounds()); 852 newR.set(clip->getBounds());
853 if (!newR.intersect(origR)) { 853 if (!newR.intersect(origR)) {
854 return; 854 return;
855 } 855 }
856 856
857 SkIRect outerBounds; 857 const SkIRect outerBounds = newR.roundOut();
858 newR.roundOut(&outerBounds);
859 858
860 if (clip->isRect()) { 859 if (clip->isRect()) {
861 antifillrect(newR, blitter); 860 antifillrect(newR, blitter);
862 } else { 861 } else {
863 SkRegion::Cliperator clipper(*clip, outerBounds); 862 SkRegion::Cliperator clipper(*clip, outerBounds);
864 while (!clipper.done()) { 863 while (!clipper.done()) {
865 newR.set(clipper.rect()); 864 newR.set(clipper.rect());
866 if (newR.intersect(origR)) { 865 if (newR.intersect(origR)) {
867 antifillrect(newR, blitter); 866 antifillrect(newR, blitter);
868 } 867 }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 1044
1046 void SkScan::AntiFrameRect(const SkRect& r, const SkPoint& strokeSize, 1045 void SkScan::AntiFrameRect(const SkRect& r, const SkPoint& strokeSize,
1047 const SkRasterClip& clip, SkBlitter* blitter) { 1046 const SkRasterClip& clip, SkBlitter* blitter) {
1048 if (clip.isBW()) { 1047 if (clip.isBW()) {
1049 AntiFrameRect(r, strokeSize, &clip.bwRgn(), blitter); 1048 AntiFrameRect(r, strokeSize, &clip.bwRgn(), blitter);
1050 } else { 1049 } else {
1051 SkAAClipBlitterWrapper wrap(clip, blitter); 1050 SkAAClipBlitterWrapper wrap(clip, blitter);
1052 AntiFrameRect(r, strokeSize, &wrap.getRgn(), wrap.getBlitter()); 1051 AntiFrameRect(r, strokeSize, &wrap.getRgn(), wrap.getBlitter());
1053 } 1052 }
1054 } 1053 }
OLDNEW
« no previous file with comments | « src/core/SkScalerContext.cpp ('k') | src/core/SkScan_Hairline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698