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

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

Issue 2951583002: Update voice interaction icon shadow (Closed)
Patch Set: fix const Created 3 years, 6 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 | « ui/gfx/shadow_util.cc ('k') | ui/gfx/shadow_value.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_SHADOW_VALUE_H_ 5 #ifndef UI_GFX_SHADOW_VALUE_H_
6 #define UI_GFX_SHADOW_VALUE_H_ 6 #define UI_GFX_SHADOW_VALUE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 30 matching lines...) Expand all
41 // are negative because shadow margins are outside a boundary. 41 // are negative because shadow margins are outside a boundary.
42 static Insets GetMargin(const ShadowValues& shadows); 42 static Insets GetMargin(const ShadowValues& shadows);
43 43
44 // Gets the area inside a rectangle that would be affected by shadow blur. 44 // Gets the area inside a rectangle that would be affected by shadow blur.
45 // This is similar to the margin except it's positive (the blur region is 45 // This is similar to the margin except it's positive (the blur region is
46 // inside a hypothetical rectangle) and it accounts for the blur both inside 46 // inside a hypothetical rectangle) and it accounts for the blur both inside
47 // and outside the bounding box. The region inside the "blur region" would be 47 // and outside the bounding box. The region inside the "blur region" would be
48 // a uniform color. 48 // a uniform color.
49 static Insets GetBlurRegion(const ShadowValues& shadows); 49 static Insets GetBlurRegion(const ShadowValues& shadows);
50 50
51 // Makes ShadowValues that should match MD style shadows for the given
52 // elevation.
53 static ShadowValues MakeMdShadowValues(int elevation);
54
51 private: 55 private:
52 gfx::Vector2d offset_; 56 gfx::Vector2d offset_;
53 57
54 // Blur amount of the shadow in pixels. If underlying implementation supports 58 // Blur amount of the shadow in pixels. If underlying implementation supports
55 // (e.g. Skia), it can have fraction part such as 0.5 pixel. The value 59 // (e.g. Skia), it can have fraction part such as 0.5 pixel. The value
56 // defines a range from full shadow color at the start point inside the 60 // defines a range from full shadow color at the start point inside the
57 // shadow to fully transparent at the end point outside it. The range is 61 // shadow to fully transparent at the end point outside it. The range is
58 // perpendicular to and centered on the shadow edge. For example, a blur 62 // perpendicular to and centered on the shadow edge. For example, a blur
59 // amount of 4.0 means to have a blurry shadow edge of 4 pixels that 63 // amount of 4.0 means to have a blurry shadow edge of 4 pixels that
60 // transitions from full shadow color to fully transparent and with 2 pixels 64 // transitions from full shadow color to fully transparent and with 2 pixels
61 // inside the shadow and 2 pixels goes beyond the edge. 65 // inside the shadow and 2 pixels goes beyond the edge.
62 double blur_; 66 double blur_;
63 67
64 SkColor color_; 68 SkColor color_;
65 }; 69 };
66 70
67 inline bool operator==(const ShadowValue& lhs, const ShadowValue& rhs) { 71 inline bool operator==(const ShadowValue& lhs, const ShadowValue& rhs) {
68 return lhs.offset() == rhs.offset() && lhs.blur() == rhs.blur() && 72 return lhs.offset() == rhs.offset() && lhs.blur() == rhs.blur() &&
69 lhs.color() == rhs.color(); 73 lhs.color() == rhs.color();
70 } 74 }
71 75
72 } // namespace gfx 76 } // namespace gfx
73 77
74 #endif // UI_GFX_SHADOW_VALUE_H_ 78 #endif // UI_GFX_SHADOW_VALUE_H_
OLDNEW
« no previous file with comments | « ui/gfx/shadow_util.cc ('k') | ui/gfx/shadow_value.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698