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

Unified Diff: ui/gfx/canvas.cc

Issue 392703002: ui/gfx: remove redundant 32x32 DashedRect drawing if a dest rect is empty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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: ui/gfx/canvas.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index db8b28fc0a95d78aac894b8956ebc60651f68e69..e8d6a9166fb1136c5d94fca30912b80f137a01be 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -131,6 +131,8 @@ ImageSkiaRep Canvas::ExtractImageRep() const {
}
void Canvas::DrawDashedRect(const Rect& rect, SkColor color) {
+ if (rect.IsEmpty())
+ return;
// Create a 2D bitmap containing alternating on/off pixels - we do this
// so that you never get two pixels of the same color around the edges
// of the focus rect (this may mean that opposing edges of the rect may
« 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