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

Unified Diff: ui/gfx/paint_vector_icon.cc

Issue 1406613002: For some vector icons, get the size from the vector definition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 91b00c9c507f95aefe283fa507a9d7707e29be13..afd30e34469ca546df766438bdbb642d7fd2c89a 100644
--- a/ui/gfx/paint_vector_icon.cc
+++ b/ui/gfx/paint_vector_icon.cc
@@ -394,6 +394,18 @@ ImageSkia CreateVectorIconWithBadge(VectorIconId id,
return g_icon_cache.Get().GetOrCreateIcon(id, dip_size, color, badge_id);
}
+ImageSkia CreatePrimaryVectorIcon(VectorIconId id, SkColor color) {
+ const PathElement* one_x_path = GetPathForVectorIconAt1xScale(id);
+#ifndef NDEBUG
sky 2015/10/13 20:15:06 nit: if !defined(NDEBUG)
+ const PathElement* general_path = GetPathForVectorIcon(id);
+ DCHECK_NE(one_x_path, general_path);
+#endif
+ DCHECK_EQ(one_x_path[0].type, CANVAS_DIMENSIONS);
+
+ const size_t size = one_x_path[1].arg;
+ return CreateVectorIcon(id, size, color);
+}
+
ImageSkia CreateVectorIconFromSource(const std::string& source,
size_t dip_size,
SkColor color) {
« 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