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

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: rebase Created 4 years, 8 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
Index: ui/gfx/paint_vector_icon.cc
diff --git a/ui/gfx/paint_vector_icon.cc b/ui/gfx/paint_vector_icon.cc
index 087d0ee31fe093820c8f115d438fd825708316eb..3bac6acd472f9b92de642c30a94e11d44d6dc325 100644
--- a/ui/gfx/paint_vector_icon.cc
+++ b/ui/gfx/paint_vector_icon.cc
@@ -396,6 +396,13 @@ void PaintVectorIcon(Canvas* canvas,
PaintPath(canvas, path, dip_size, color);
}
+ImageSkia CreateVectorIcon(VectorIconId id, SkColor color) {
+ const PathElement* one_x_path = GetPathForVectorIconAt1xScale(id);
+ size_t size = one_x_path[0].type == CANVAS_DIMENSIONS ? one_x_path[1].arg
+ : kReferenceSizeDip;
+ return CreateVectorIcon(id, size, color);
+}
+
ImageSkia CreateVectorIcon(VectorIconId id, size_t dip_size, SkColor color) {
return CreateVectorIconWithBadge(id, dip_size, color,
VectorIconId::VECTOR_ICON_NONE);

Powered by Google App Engine
This is Rietveld 408576698