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

Unified Diff: ui/gfx/paint_vector_icon.cc

Issue 2784133002: Cros system menu - Use WiFi strike-through image for "No networks" row (Closed)
Patch Set: docs Created 3 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
« no previous file with comments | « ui/gfx/paint_vector_icon.h ('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 9544615218999217506cbfa5f9ab534a1b0eedb9..514015abacfb9e474ef4b4e9c894cb926445709d 100644
--- a/ui/gfx/paint_vector_icon.cc
+++ b/ui/gfx/paint_vector_icon.cc
@@ -148,9 +148,9 @@ void PaintPath(Canvas* canvas,
case R_MOVE_TO: {
if (previous_command_type == CLOSE) {
- // This triggers injectMoveToIfNeeded() so that the next subpath will
- // start at the correct place. See
- // [ https://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand ].
+ // This triggers injectMoveToIfNeeded() so that the next subpath
+ // will start at the correct place. See [
+ // https://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand ].
path.rLineTo(0, 0);
}
@@ -179,8 +179,8 @@ void PaintPath(Canvas* canvas,
(path.*path_fn)(
rx, ry, angle,
large_arc_flag ? SkPath::kLarge_ArcSize : SkPath::kSmall_ArcSize,
- arc_sweep_flag ? SkPath::kCW_Direction : SkPath::kCCW_Direction,
- x, y);
+ arc_sweep_flag ? SkPath::kCW_Direction : SkPath::kCCW_Direction, x,
+ y);
break;
}
@@ -452,6 +452,10 @@ static base::LazyInstance<VectorIconCache>::DestructorAtExit g_icon_cache =
const VectorIcon kNoneIcon = {};
+void PaintVectorIcon(Canvas* canvas, const VectorIcon& icon, SkColor color) {
+ PaintVectorIcon(canvas, icon, GetDefaultSizeOfVectorIcon(icon), color);
+}
+
void PaintVectorIcon(Canvas* canvas,
const VectorIcon& icon,
int dip_size,
@@ -464,10 +468,7 @@ void PaintVectorIcon(Canvas* canvas,
}
ImageSkia CreateVectorIcon(const VectorIcon& icon, SkColor color) {
- const PathElement* one_x_path = icon.path_1x_ ? icon.path_1x_ : icon.path_;
- int size = one_x_path[0].type == CANVAS_DIMENSIONS ? one_x_path[1].arg
- : kReferenceSizeDip;
- return CreateVectorIcon(icon, size, color);
+ return CreateVectorIcon(icon, GetDefaultSizeOfVectorIcon(icon), color);
}
ImageSkia CreateVectorIcon(const VectorIcon& icon,
@@ -492,4 +493,10 @@ ImageSkia CreateVectorIconFromSource(const std::string& source,
color);
}
+int GetDefaultSizeOfVectorIcon(const gfx::VectorIcon& icon) {
+ const PathElement* one_x_path = icon.path_1x_ ? icon.path_1x_ : icon.path_;
+ return one_x_path[0].type == CANVAS_DIMENSIONS ? one_x_path[1].arg
+ : kReferenceSizeDip;
+}
+
} // namespace gfx
« no previous file with comments | « ui/gfx/paint_vector_icon.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698