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

Side by Side Diff: ash/resources/vector_icons/vector_icons.cc.template

Issue 2620653004: Optimize GetPathForVectorIcon*, save ~290 KB on disk (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/vector_icon_types.h » ('j') | ui/gfx/vector_icon_types.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // vector_icons.cc.template is used to generate vector_icons.cc. Edit the former 5 // vector_icons.cc.template is used to generate vector_icons.cc. Edit the former
6 // rather than the latter. 6 // rather than the latter.
7 7
8 #include "ash/resources/vector_icons/vector_icons.h" 8 #include "ash/resources/vector_icons/vector_icons.h"
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "ui/gfx/vector_icon_types.h" 11 #include "ui/gfx/vector_icon_types.h"
12 12
13 #define PATH_ELEMENT_TEMPLATE(path_name, ...) \ 13 #define PATH_ELEMENT_TEMPLATE(path_name, ...) \
14 static gfx::PathElement path_name[] = {__VA_ARGS__}; 14 static constexpr gfx::PathElement path_name[] = {__VA_ARGS__};
Evan Stade 2017/01/10 17:30:26 is this part actually necessary? I ask because I d
brucedawson 2017/01/10 18:31:54 I meant to ask about that because changes to this
Evan Stade 2017/01/11 00:26:22 the file is used, but I suspect you're not buildin
brucedawson 2017/01/11 01:05:55 Ah. Got it. For VC++ putting constexpr on the arr
15 15
16 #define VECTOR_ICON_TEMPLATE(icon_name, path_name, path_name_1x) \ 16 #define VECTOR_ICON_TEMPLATE(icon_name, path_name, path_name_1x) \
17 const gfx::VectorIcon icon_name = { path_name , path_name_1x }; 17 const gfx::VectorIcon icon_name = { path_name , path_name_1x };
18 18
19 namespace ash { 19 namespace ash {
20 20
21 using namespace gfx; 21 using namespace gfx;
22 22
23 TEMPLATE_PLACEHOLDER 23 TEMPLATE_PLACEHOLDER
24 24
25 } // namespace ash 25 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/vector_icon_types.h » ('j') | ui/gfx/vector_icon_types.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698