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

Unified Diff: skia/ext/analysis_canvas.cc

Issue 505263002: Update AnalysisCanvas drawRect early-exit logic to match SkCanvas.cpp again. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no, fmt for real Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/analysis_canvas.cc
diff --git a/skia/ext/analysis_canvas.cc b/skia/ext/analysis_canvas.cc
index 8be5f5b1f33d558c207f6ccf5ab77ea54d0cdb7f..5f9f48c0ca0bd835df98b1a32979b87373333f8d 100644
--- a/skia/ext/analysis_canvas.cc
+++ b/skia/ext/analysis_canvas.cc
@@ -110,8 +110,14 @@ void AnalysisCanvas::drawPoints(SkCanvas::PointMode mode,
}
void AnalysisCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
- // This recreates the early-exit logic in SkCanvas.cpp, which aborts early
- // if the paint will "draw nothing".
+ // This recreates the early-exit logic in SkCanvas.cpp.
+ SkRect scratch;
+ if (paint.canComputeFastBounds() &&
+ quickReject(paint.computeFastBounds(rect, &scratch))) {
+ return;
+ }
+
+ // An extra no-op check SkCanvas.cpp doesn't do.
if (paint.nothingToDraw())
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698