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

Unified Diff: ui/gfx/vector_icons/vector_icons.cc.template

Issue 2620653004: Optimize GetPathForVectorIcon*, save ~290 KB on disk (Closed)
Patch Set: Add constexpr to another PathElement array definition Created 3 years, 11 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/vector_icons/vector_icons.cc.template
diff --git a/ui/gfx/vector_icons/vector_icons.cc.template b/ui/gfx/vector_icons/vector_icons.cc.template
index 6d1d2a83ee7c8c3957b61b9437aa28fe716ca706..e935923303cf30aa55b701a814a7ae9feb3eb35f 100644
--- a/ui/gfx/vector_icons/vector_icons.cc.template
+++ b/ui/gfx/vector_icons/vector_icons.cc.template
@@ -12,19 +12,12 @@
#define ICON_TEMPLATE(icon_name, ...) \
case VectorIconId::icon_name: {\
- static PathElement path[] = {__VA_ARGS__};\
+ static constexpr PathElement path[] = {__VA_ARGS__};\
return path;\
}
namespace gfx {
-#if defined(OS_WIN)
-#pragma warning(push)
-
-// Disable "function size suppresses optimizations" warning.
-#pragma warning(disable: 4883)
-#endif // defined(OS_WIN)
-
const PathElement* GetPathForVectorIcon(VectorIconId id) {
switch (id) {
TEMPLATE_PLACEHOLDER
@@ -47,8 +40,4 @@ TEMPLATE_PLACEHOLDER_1X
}
}
-#if defined(OS_WIN)
-#pragma warning(pop)
-#endif // defined(OS_WIN)
-
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698