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

Unified Diff: ui/gfx/paint_vector_icon.cc

Issue 1836483002: Fix up and rename VisibleMargins() in preparation for making use of it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« ui/gfx/image/image_util_unittest.cc ('K') | « ui/gfx/image/image_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/paint_vector_icon.cc
diff --git a/ui/gfx/paint_vector_icon.cc b/ui/gfx/paint_vector_icon.cc
index 7121fde314d5a6933fd93de8c7773f26c82ceac3..438e46e76f5fe01b44ba206701d207234f1dccfd 100644
--- a/ui/gfx/paint_vector_icon.cc
+++ b/ui/gfx/paint_vector_icon.cc
@@ -311,7 +311,8 @@ class VectorIconSource : public CanvasImageSource {
// CanvasImageSource:
void Draw(gfx::Canvas* canvas) override {
if (path_.empty()) {
- PaintVectorIcon(canvas, id_, size_.width(), color_);
+ if (id_ != VectorIconId::VECTOR_ICON_NONE)
+ PaintVectorIcon(canvas, id_, size_.width(), color_);
if (badge_id_ != VectorIconId::VECTOR_ICON_NONE)
PaintVectorIcon(canvas, badge_id_, size_.width(), color_);
} else {
@@ -385,7 +386,7 @@ void PaintVectorIcon(Canvas* canvas,
VectorIconId id,
size_t dip_size,
SkColor color) {
- DCHECK(VectorIconId::VECTOR_ICON_NONE != id);
+ DCHECK(id != VectorIconId::VECTOR_ICON_NONE);
danakj 2016/03/25 23:35:28 DCHECK_NE if you can
Peter Kasting 2016/03/26 01:01:57 Can't (I tried that first); no operator<< for this
const PathElement* path = canvas->image_scale() == 1.f
? GetPathForVectorIconAt1xScale(id)
: GetPathForVectorIcon(id);
« ui/gfx/image/image_util_unittest.cc ('K') | « ui/gfx/image/image_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698