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

Unified Diff: src/core/SkScan_Hairline.cpp

Issue 1893433002: In SkDraw::drawRect, use SkPath for huge rects. Base URL: https://skia.googlesource.com/skia@fixed-assert
Patch Set: Created 4 years, 8 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
« no previous file with comments | « src/core/SkScan_AntiPath.cpp ('k') | src/core/SkScan_Path.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScan_Hairline.cpp
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp
index 9b21c421edf6c8d8dc57f3df7afa63c953085c69..76cd0328f393c7c6d39d419af782e1adbf0aa484 100644
--- a/src/core/SkScan_Hairline.cpp
+++ b/src/core/SkScan_Hairline.cpp
@@ -147,12 +147,11 @@ void SkScan::HairRect(const SkRect& rect, const SkRasterClip& clip,
SkBlitter* blitter) {
SkAAClipBlitterWrapper wrapper;
SkBlitterClipper clipper;
- SkIRect r;
- r.set(SkScalarToFixed(rect.fLeft) >> 16,
- SkScalarToFixed(rect.fTop) >> 16,
- (SkScalarToFixed(rect.fRight) >> 16) + 1,
- (SkScalarToFixed(rect.fBottom) >> 16) + 1);
+ const SkIRect r = SkIRect::MakeLTRB(SkScalarTruncToInt(rect.fLeft),
+ SkScalarTruncToInt(rect.fTop),
+ SkScalarTruncToInt(rect.fRight) + 1,
+ SkScalarTruncToInt(rect.fBottom) + 1);
if (clip.quickReject(r)) {
return;
@@ -473,11 +472,11 @@ void hair_path(const SkPath& path, const SkRasterClip& rclip, SkBlitter* blitter
{
const int capOut = SkPaint::kButt_Cap == capStyle ? 1 : 2;
- const SkIRect ibounds = path.getBounds().roundOut().makeOutset(capOut, capOut);
- if (rclip.quickReject(ibounds)) {
+ const SkRect bounds = path.getBounds().makeOutset(capOut, capOut);
+ if (rclip.quickReject(bounds)) {
return;
}
- if (!rclip.quickContains(ibounds)) {
+ if (!rclip.quickContains(bounds)) {
if (rclip.isBW()) {
clip = &rclip.bwRgn();
} else {
« no previous file with comments | « src/core/SkScan_AntiPath.cpp ('k') | src/core/SkScan_Path.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698