summaryrefslogtreecommitdiff
path: root/chromium/components/vector_icons
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-11-20 10:33:36 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-11-22 11:45:12 +0000
commitbe59a35641616a4cf23c4a13fa0632624b021c1b (patch)
tree9da183258bdf9cc413f7562079d25ace6955467f /chromium/components/vector_icons
parentd702e4b6a64574e97fc7df8fe3238cde70242080 (diff)
downloadqtwebengine-chromium-be59a35641616a4cf23c4a13fa0632624b021c1b.tar.gz
BASELINE: Update Chromium to 62.0.3202.101
Change-Id: I2d5eca8117600df6d331f6166ab24d943d9814ac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/components/vector_icons')
-rw-r--r--chromium/components/vector_icons/BUILD.gn5
-rw-r--r--chromium/components/vector_icons/README.md48
-rw-r--r--chromium/components/vector_icons/accessibility.icon25
-rw-r--r--chromium/components/vector_icons/help_outline.icon34
-rw-r--r--chromium/components/vector_icons/reload.1x.icon23
-rw-r--r--chromium/components/vector_icons/reload.icon27
-rw-r--r--chromium/components/vector_icons/usb.icon38
7 files changed, 200 insertions, 0 deletions
diff --git a/chromium/components/vector_icons/BUILD.gn b/chromium/components/vector_icons/BUILD.gn
index 24c915b5f8f..b03c1898576 100644
--- a/chromium/components/vector_icons/BUILD.gn
+++ b/chromium/components/vector_icons/BUILD.gn
@@ -8,6 +8,7 @@ aggregate_vector_icons("components_vector_icons") {
icon_directory = "."
icons = [
+ "accessibility.icon",
"back_arrow.1x.icon",
"back_arrow.icon",
"bluetooth_connected.icon",
@@ -19,6 +20,7 @@ aggregate_vector_icons("components_vector_icons") {
"error_circle.icon",
"forward_arrow.1x.icon",
"forward_arrow.icon",
+ "help_outline.icon",
"info_outline.icon",
"location_on.icon",
"lock.icon",
@@ -31,8 +33,11 @@ aggregate_vector_icons("components_vector_icons") {
"notifications.icon",
"notifications_off.icon",
"protocol_handler.icon",
+ "reload.1x.icon",
+ "reload.icon",
"screen_share.icon",
"search.icon",
+ "usb.icon",
"videocam.icon",
"warning.icon",
]
diff --git a/chromium/components/vector_icons/README.md b/chromium/components/vector_icons/README.md
new file mode 100644
index 00000000000..e8922c4161a
--- /dev/null
+++ b/chromium/components/vector_icons/README.md
@@ -0,0 +1,48 @@
+# Vectorized icons in native Chrome UI
+
+## Background
+
+Chrome can draw vectorized images using Skia. Vector images have the advantages of looking better at different scale factors or sizes, can be easily colorized at runtime, and reduce the chrome binary size.
+
+Chrome uses .icon files to describe vector icons. This is a bespoke file format which is actually a C++ array definition. At build time, the .icon files are composed into a .cc file which is compiled into the binary.
+
+Vector icons can be found in various vector_icons subdirectories throughout the code base. Use `components/vector_icons/` for generic icons shared among many directories and components, or more specific directories such as `ui/views/vector_icons` or `ash/resources/vector_icons` for less widely used icons.
+
+Some of the icons have **.1x.icon** variants which are used when the device scale factor is 100%. For any other scale factor, the **.icon** variant will be used. The 1x variants are generally only necessary for very small icons which may look fuzzy if shrunk from a larger icon.
+
+## Converting an SVG to .icon format
+
+[This tool](http://evanstade.github.io/skiafy/) generates .icon file output from SVGs. (If you want to contribute improvements, [here's the project](https://github.com/evanstade/skiafy).)
+
+It handles only a small subset of SVG (paths, circles, etc.) and it's finicky about what it expects as the format, but with a minor amount of manual intervention beforehand, it mostly spits out usable .icon output. It will often work better if you run the SVG through SVGO first, which is a separate project (an SVG minifier). [Jake Archibald's SVGOMG](https://jakearchibald.github.io/svgomg/) is a web interface to SVGO. If any manual adjustments need to be made to the output, the [SVG Path spec](https://www.w3.org/TR/SVG/paths.html) is a helpful reference.
+
+Some SVGs are already pretty minimal, like the ones at [the Material Design Icon repository](https://material.io/icons/) so they don't require much if any adjustment, but some SVG editing tools like Sketch leave a lot of random cruft so SVGOMG helps a lot. Take the output and insert into a .icon file.
+
+## Using .icon files
+
+Once you have created an .icon file, place it in an appropriate vector_icon subdirectory and add the filename to the corresponding BUILD.gn. A constant is automatically generated so that the icon can be referenced at runtime. The icon file foo_bar.icon is mapped to the constant name of kFooBarIcon ('k' + camel-cased filename + 'Icon') and a sample call site to create this icon looks something like:
+
+ gfx::CreateVectorIcon(kFooBarIcon, 32, color_utils::DeriveDefaultIconColor(text_color));
+
+If the size argument is unspecified, the size will be taken from the .icon file (or the .1x.icon if more than one exists). The icon's name should match its identifier on [the MD icons site](https://material.io/icons/) if that's where it came from. For example, `ic_accessibility` would become `accessibility.icon`.
+
+## FAQ
+
+### Where can I use vector icons?
+
+Chrome's native UI on desktop platforms. Currently the vector icons are in extensive use on Views platforms, where Skia is the normal drawing tool. Mac uses them sometimes, but optimizing performance is still a [TODO](http://crbug.com/595035) so many places stick with raster assets. The files in `chrome/app/theme/default_*_percent/legacy` are ones that have been switched to vector icons for Views but not yet for OS X. If you need to add raster assets (PNG) for mobile or OS X, please make sure to limit their inclusion to those platforms.
+
+### How can I preview vector icons?
+
+Use [this extension](https://github.com/sadrulhc/vector-icons) to preview icons in [codesearch](http://cs.chromium.org/).
+
+You can also build and run the `views_examples_exe` (or `views_examples_with_content_exe`) target and select "Vector Icons" from the dropdown menu. This loads a simple interface which allows you view a provided vector icon file at a specified size and color. Contributions to improve this interface are welcome ([bug](https://bugs.chromium.org/p/chromium/issues/detail?id=630295)).
+
+### Can my vector icon have more than one color?
+
+Yes. You can hard-code colors for specific path elements by adding a `PATH_COLOR_ARGB` command to the appropriate place within the .icon file. Any path elements which are not given a hard-coded color in this manner will use the color provided to `CreateVectorIcon()` at runtime.
+
+
+### When introducing a new icon, should I use a PNG or a vector icon?
+
+Use a vector icon, unless the icon is extremely complex (e.g., a product logo). Also see above, "Where can I use vector icons?"
diff --git a/chromium/components/vector_icons/accessibility.icon b/chromium/components/vector_icons/accessibility.icon
new file mode 100644
index 00000000000..62b8b71ccf2
--- /dev/null
+++ b/chromium/components/vector_icons/accessibility.icon
@@ -0,0 +1,25 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+CANVAS_DIMENSIONS, 32,
+MOVE_TO, 16, 11.44f,
+R_CUBIC_TO, -3.5f, 0, -7.2f, -0.62f, -10.27f, -1.44f,
+LINE_TO, 5, 12.16f,
+R_CUBIC_TO, 2.27f, 0.77f, 5.56f, 1.05f, 8, 1.34f,
+V_LINE_TO, 28,
+R_H_LINE_TO, 2,
+R_V_LINE_TO, -7,
+R_H_LINE_TO, 2,
+R_V_LINE_TO, 7,
+R_H_LINE_TO, 2,
+V_LINE_TO, 13.5f,
+R_CUBIC_TO, 2.44f, -0.29f, 5.73f, -0.57f, 8, -1.34f,
+LINE_TO, 26.27f, 10,
+R_CUBIC_TO, -3.07f, 0.82f, -6.77f, 1.44f, -10.27f, 1.44f,
+CLOSE,
+R_MOVE_TO, 0, -1.94f,
+R_ARC_TO, 2.5f, 2.5f, 0, 1, 0, 0, -5,
+R_ARC_TO, 2.5f, 2.5f, 0, 0, 0, 0, 5,
+CLOSE,
+END
diff --git a/chromium/components/vector_icons/help_outline.icon b/chromium/components/vector_icons/help_outline.icon
new file mode 100644
index 00000000000..9f07e956717
--- /dev/null
+++ b/chromium/components/vector_icons/help_outline.icon
@@ -0,0 +1,34 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+CANVAS_DIMENSIONS, 24,
+MOVE_TO, 11, 18,
+R_H_LINE_TO, 2,
+R_V_LINE_TO, -2,
+R_H_LINE_TO, -2,
+R_V_LINE_TO, 2,
+CLOSE,
+R_MOVE_TO, 1, -16,
+CUBIC_TO, 6.48f, 2, 2, 6.48f, 2, 12,
+R_CUBIC_TO, 0, 5.52f, 4.48f, 10, 10, 10,
+R_CUBIC_TO, 5.52f, 0, 10, -4.48f, 10, -10,
+CUBIC_TO_SHORTHAND, 17.52f, 2, 12, 2,
+CLOSE,
+R_MOVE_TO, 0, 18,
+R_CUBIC_TO, -4.41f, 0, -8, -3.59f, -8, -8,
+R_CUBIC_TO, 0, -4.41f, 3.59f, -8, 8, -8,
+R_CUBIC_TO, 4.41f, 0, 8, 3.59f, 8, 8,
+R_CUBIC_TO, 0, 4.41f, -3.59f, 8, -8, 8,
+CLOSE,
+R_MOVE_TO, 0, -14,
+R_CUBIC_TO, -2.21f, 0, -4, 1.79f, -4, 4,
+R_H_LINE_TO, 2,
+R_CUBIC_TO, 0, -1.1f, 0.9f, -2, 2, -2,
+R_CUBIC_TO, 1.1f, 0, 2, 0.9f, 2, 2,
+R_CUBIC_TO, 0, 2, -3, 1.75f, -3, 5,
+R_H_LINE_TO, 2,
+R_CUBIC_TO, 0, -2.25f, 3, -2.5f, 3, -5,
+R_CUBIC_TO, 0, -2.21f, -1.79f, -4, -4, -4,
+CLOSE,
+END
diff --git a/chromium/components/vector_icons/reload.1x.icon b/chromium/components/vector_icons/reload.1x.icon
new file mode 100644
index 00000000000..77d5c53f83b
--- /dev/null
+++ b/chromium/components/vector_icons/reload.1x.icon
@@ -0,0 +1,23 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+CANVAS_DIMENSIONS, 16,
+MOVE_TO, 15, 1,
+LINE_TO, 15, 7,
+LINE_TO, 9, 7,
+LINE_TO, 11.62f, 4.37f,
+CUBIC_TO, 10.67f, 3.43f, 9.44f, 3, 8, 3,
+CUBIC_TO, 5.09f, 3, 3, 5.1f, 3, 8,
+CUBIC_TO, 3, 10.9f, 5.09f, 13, 8, 13,
+CUBIC_TO, 10.3f, 13, 12.08f, 11.81f, 12.75f, 9.83f,
+LINE_TO, 12.77f, 9.79f,
+CUBIC_TO, 12.93f, 9.44f, 13.47f, 9.18f, 13.76f, 9.18f,
+CUBIC_TO, 14.15f, 9.18f, 14.79f, 9.41f, 14.79f, 10.01f,
+CUBIC_TO, 14.79f, 10.14f, 14.71f, 10.46f, 14.66f, 10.57f,
+CUBIC_TO, 13.66f, 13.13f, 10.98f, 15, 8.03f, 15,
+CUBIC_TO, 4.15f, 15, 1, 11.87f, 1, 8,
+CUBIC_TO, 1, 4.13f, 4.15f, 1, 8.03f, 1,
+CUBIC_TO, 9.96f, 1, 11.7f, 1.77f, 12.97f, 3.03f,
+CLOSE,
+END
diff --git a/chromium/components/vector_icons/reload.icon b/chromium/components/vector_icons/reload.icon
new file mode 100644
index 00000000000..3d7275846da
--- /dev/null
+++ b/chromium/components/vector_icons/reload.icon
@@ -0,0 +1,27 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+CANVAS_DIMENSIONS, 32,
+MOVE_TO, 25.1f, 20.15f,
+LINE_TO, 25.08f, 20.14f,
+CUBIC_TO, 23.51f, 23.59f, 20.04f, 26, 16, 26,
+CUBIC_TO, 10.48f, 26, 6, 21.52f, 6, 16,
+CUBIC_TO, 6, 10.48f, 10.48f, 6, 16, 6,
+CUBIC_TO, 19.02f, 6, 21.72f, 7.34f, 23.55f, 9.45f,
+LINE_TO, 23.55f, 9.45f,
+LINE_TO, 19, 14,
+LINE_TO, 25.8f, 14,
+LINE_TO, 28.83f, 14,
+LINE_TO, 30, 14,
+LINE_TO, 30, 3,
+LINE_TO, 25.67f, 7.33f,
+CUBIC_TO, 23.3f, 4.67f, 19.85f, 3, 16, 3,
+CUBIC_TO, 8.82f, 3, 3, 8.82f, 3, 16,
+CUBIC_TO, 3, 23.18f, 8.82f, 29, 16, 29,
+CUBIC_TO, 21.27f, 29, 25.8f, 25.86f, 27.84f, 21.34f,
+CUBIC_TO, 27.96f, 21.13f, 28.03f, 20.88f, 28.03f, 20.61f,
+CUBIC_TO, 28.03f, 19.78f, 27.36f, 19.11f, 26.53f, 19.11f,
+CUBIC_TO, 25.87f, 19.11f, 25.3f, 19.55f, 25.1f, 20.15f,
+CLOSE,
+END
diff --git a/chromium/components/vector_icons/usb.icon b/chromium/components/vector_icons/usb.icon
new file mode 100644
index 00000000000..61d9679015e
--- /dev/null
+++ b/chromium/components/vector_icons/usb.icon
@@ -0,0 +1,38 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+MOVE_TO, 30, 14,
+R_V_LINE_TO, 8,
+R_H_LINE_TO, 2,
+R_V_LINE_TO, 4,
+R_H_LINE_TO, -6,
+V_LINE_TO, 10,
+R_H_LINE_TO, 4,
+R_LINE_TO, -6, -8,
+R_LINE_TO, -6, 8,
+R_H_LINE_TO, 4,
+R_V_LINE_TO, 16,
+R_H_LINE_TO, -6,
+R_V_LINE_TO, -4.14f,
+R_CUBIC_TO, 1.41f, -0.73f, 2.4f, -2.16f, 2.4f, -3.86f,
+R_CUBIC_TO, 0, -2.43f, -1.97f, -4.4f, -4.4f, -4.4f,
+R_CUBIC_TO, -2.43f, 0, -4.4f, 1.97f, -4.4f, 4.4f,
+R_CUBIC_TO, 0, 1.7f, 0.99f, 3.13f, 2.4f, 3.86f,
+V_LINE_TO, 26,
+R_CUBIC_TO, 0, 2.21f, 1.79f, 4, 4, 4,
+R_H_LINE_TO, 6,
+R_V_LINE_TO, 6.1f,
+R_CUBIC_TO, -1.42f, 0.73f, -2.4f, 2.19f, -2.4f, 3.9f,
+R_CUBIC_TO, 0, 2.43f, 1.97f, 4.4f, 4.4f, 4.4f,
+R_CUBIC_TO, 2.43f, 0, 4.4f, -1.97f, 4.4f, -4.4f,
+R_CUBIC_TO, 0, -1.71f, -0.98f, -3.17f, -2.4f, -3.9f,
+V_LINE_TO, 30,
+R_H_LINE_TO, 6,
+R_CUBIC_TO, 2.21f, 0, 4, -1.79f, 4, -4,
+R_V_LINE_TO, -4,
+R_H_LINE_TO, 2,
+R_V_LINE_TO, -8,
+R_H_LINE_TO, -8,
+CLOSE,
+END