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

Side by Side Diff: ui/gfx/paint_vector_icon.h

Issue 2784133002: Cros system menu - Use WiFi strike-through image for "No networks" row (Closed)
Patch Set: docs Created 3 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/status/network_menu.cc ('k') | ui/gfx/paint_vector_icon.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef UI_GFX_PAINT_VECTOR_ICON_H_ 5 #ifndef UI_GFX_PAINT_VECTOR_ICON_H_
6 #define UI_GFX_PAINT_VECTOR_ICON_H_ 6 #define UI_GFX_PAINT_VECTOR_ICON_H_
7 7
8 #include "third_party/skia/include/core/SkColor.h" 8 #include "third_party/skia/include/core/SkColor.h"
9 #include "ui/gfx/gfx_export.h" 9 #include "ui/gfx/gfx_export.h"
10 #include "ui/gfx/image/image_skia.h" 10 #include "ui/gfx/image/image_skia.h"
11 11
12 namespace gfx { 12 namespace gfx {
13 13
14 class Canvas; 14 class Canvas;
15 struct VectorIcon; 15 struct VectorIcon;
16 16
17 GFX_EXPORT extern const VectorIcon kNoneIcon; 17 GFX_EXPORT extern const VectorIcon kNoneIcon;
18 18
19 // Draws a vector icon identified by |id| onto |canvas| at (0, 0). |dip_size| 19 // Draws a vector icon identified by |id| onto |canvas| at (0, 0). |color| is
20 // is the length of a single edge of the square icon, in device independent 20 // used as the fill. The size will come from the .icon file (the 1x version, if
21 // pixels. |color| is used as the fill. 21 // multiple versions exist).
22 GFX_EXPORT void PaintVectorIcon(Canvas* canvas,
23 const VectorIcon& icon,
24 SkColor color);
25
26 // As above, with a specificed size. |dip_size| is the length of a single edge
27 // of the square icon, in device independent pixels.
22 GFX_EXPORT void PaintVectorIcon(Canvas* canvas, 28 GFX_EXPORT void PaintVectorIcon(Canvas* canvas,
23 const VectorIcon& icon, 29 const VectorIcon& icon,
24 int dip_size, 30 int dip_size,
25 SkColor color); 31 SkColor color);
26 32
27 // Creates an ImageSkia which will render the icon on demand. The size will come 33 // Creates an ImageSkia which will render the icon on demand. The size will come
28 // from the .icon file (the 1x version, if multiple versions exist). 34 // from the .icon file (the 1x version, if multiple versions exist).
29 GFX_EXPORT ImageSkia CreateVectorIcon(const VectorIcon& icon, SkColor color); 35 GFX_EXPORT ImageSkia CreateVectorIcon(const VectorIcon& icon, SkColor color);
30 36
31 // As above, but creates the image at the given size. 37 // As above, but creates the image at the given size.
(...skipping 10 matching lines...) Expand all
42 48
43 #if defined(GFX_VECTOR_ICONS_UNSAFE) || defined(GFX_IMPLEMENTATION) 49 #if defined(GFX_VECTOR_ICONS_UNSAFE) || defined(GFX_IMPLEMENTATION)
44 // Takes a string of the format expected of .icon files and renders onto 50 // Takes a string of the format expected of .icon files and renders onto
45 // a canvas. This should only be used as a debugging aid and should never be 51 // a canvas. This should only be used as a debugging aid and should never be
46 // used in production code. 52 // used in production code.
47 GFX_EXPORT ImageSkia CreateVectorIconFromSource(const std::string& source, 53 GFX_EXPORT ImageSkia CreateVectorIconFromSource(const std::string& source,
48 int dip_size, 54 int dip_size,
49 SkColor color); 55 SkColor color);
50 #endif 56 #endif
51 57
58 // Calculates the size that will be default for |icon|, in dip.
59 GFX_EXPORT int GetDefaultSizeOfVectorIcon(const gfx::VectorIcon& icon);
60
52 } // namespace gfx 61 } // namespace gfx
53 62
54 #endif // UI_GFX_PAINT_VECTOR_ICON_H_ 63 #endif // UI_GFX_PAINT_VECTOR_ICON_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/status/network_menu.cc ('k') | ui/gfx/paint_vector_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698