OLD | NEW |
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_VIEWS_BACKGROUND_H_ | 5 #ifndef UI_VIEWS_BACKGROUND_H_ |
6 #define UI_VIEWS_BACKGROUND_H_ | 6 #define UI_VIEWS_BACKGROUND_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Creates a background that fills the canvas in the specified color. | 52 // Creates a background that fills the canvas in the specified color. |
53 static Background* CreateSolidBackground(int r, int g, int b, int a) { | 53 static Background* CreateSolidBackground(int r, int g, int b, int a) { |
54 return CreateSolidBackground(SkColorSetARGB(a, r, g, b)); | 54 return CreateSolidBackground(SkColorSetARGB(a, r, g, b)); |
55 } | 55 } |
56 | 56 |
57 // Creates a background that contains a vertical gradient that varies | 57 // Creates a background that contains a vertical gradient that varies |
58 // from |color1| to |color2| | 58 // from |color1| to |color2| |
59 static Background* CreateVerticalGradientBackground(SkColor color1, | 59 static Background* CreateVerticalGradientBackground(SkColor color1, |
60 SkColor color2); | 60 SkColor color2); |
61 | 61 |
| 62 // Creates a background that contains a vertical gradient. The gradient can |
| 63 // have multiple |colors|. The |pos| array contains the relative positions of |
| 64 // each corresponding color. |colors| and |pos| must be the same size. The |
| 65 // first element in |pos| must be 0.0 and the last element must be 1.0. |
| 66 // |count| contains the number of elements in |colors| and |pos|. |
| 67 static Background* CreateVerticalMultiColorGradientBackground(SkColor* colors, |
| 68 SkScalar* pos, |
| 69 size_t count); |
| 70 |
62 // Creates Chrome's standard panel background | 71 // Creates Chrome's standard panel background |
63 static Background* CreateStandardPanelBackground(); | 72 static Background* CreateStandardPanelBackground(); |
64 | 73 |
65 // Creates a Background from the specified Painter. If owns_painter is | 74 // Creates a Background from the specified Painter. If owns_painter is |
66 // true, the Painter is deleted when the Border is deleted. | 75 // true, the Painter is deleted when the Border is deleted. |
67 static Background* CreateBackgroundPainter(bool owns_painter, | 76 static Background* CreateBackgroundPainter(bool owns_painter, |
68 Painter* painter); | 77 Painter* painter); |
69 | 78 |
70 // Render the background for the provided view | 79 // Render the background for the provided view |
71 virtual void Paint(gfx::Canvas* canvas, View* view) const = 0; | 80 virtual void Paint(gfx::Canvas* canvas, View* view) const = 0; |
(...skipping 21 matching lines...) Expand all Loading... |
93 // TODO(port): Create portable replacement for HBRUSH. | 102 // TODO(port): Create portable replacement for HBRUSH. |
94 mutable HBRUSH native_control_brush_; | 103 mutable HBRUSH native_control_brush_; |
95 #endif // defined(OS_WIN) | 104 #endif // defined(OS_WIN) |
96 | 105 |
97 DISALLOW_COPY_AND_ASSIGN(Background); | 106 DISALLOW_COPY_AND_ASSIGN(Background); |
98 }; | 107 }; |
99 | 108 |
100 } // namespace views | 109 } // namespace views |
101 | 110 |
102 #endif // UI_VIEWS_BACKGROUND_H_ | 111 #endif // UI_VIEWS_BACKGROUND_H_ |
OLD | NEW |