Chromium Code Reviews| 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_PAINTER_H_ | 5 #ifndef UI_VIEWS_PAINTER_H_ |
| 6 #define UI_VIEWS_PAINTER_H_ | 6 #define UI_VIEWS_PAINTER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 public: | 27 public: |
| 28 // A convenience method for painting a Painter in a particular region. | 28 // A convenience method for painting a Painter in a particular region. |
| 29 // This translates the canvas to x/y and paints the painter. | 29 // This translates the canvas to x/y and paints the painter. |
| 30 static void PaintPainterAt(gfx::Canvas* canvas, | 30 static void PaintPainterAt(gfx::Canvas* canvas, |
| 31 Painter* painter, | 31 Painter* painter, |
| 32 const gfx::Rect& rect); | 32 const gfx::Rect& rect); |
| 33 | 33 |
| 34 // Creates a painter that draws a gradient between the two colors. | 34 // Creates a painter that draws a gradient between the two colors. |
| 35 static Painter* CreateHorizontalGradient(SkColor c1, SkColor c2); | 35 static Painter* CreateHorizontalGradient(SkColor c1, SkColor c2); |
| 36 static Painter* CreateVerticalGradient(SkColor c1, SkColor c2); | 36 static Painter* CreateVerticalGradient(SkColor c1, SkColor c2); |
| 37 static Painter* CreateVerticalGradientRange(SkColor c1, SkColor c2, | |
|
msw
2012/08/08 17:12:20
nit: one param per line
markusheintz_
2012/08/08 21:53:55
Done.
| |
| 38 float start, float end); | |
| 37 | 39 |
| 38 // Creates a painter that divides |image| into nine regions. The four corners | 40 // Creates a painter that divides |image| into nine regions. The four corners |
| 39 // are rendered at the size specified in insets (for example, the upper | 41 // are rendered at the size specified in insets (for example, the upper |
| 40 // left corners is rendered at 0x0 with a size of | 42 // left corners is rendered at 0x0 with a size of |
| 41 // insets.left()xinsets.right()). The four edges are stretched to fill the | 43 // insets.left()xinsets.right()). The four edges are stretched to fill the |
| 42 // destination size. | 44 // destination size. |
| 43 // Ownership is passed to the caller. | 45 // Ownership is passed to the caller. |
| 44 static Painter* CreateImagePainter(const gfx::ImageSkia& image, | 46 static Painter* CreateImagePainter(const gfx::ImageSkia& image, |
| 45 const gfx::Insets& insets, | 47 const gfx::Insets& insets, |
| 46 bool paint_center); | 48 bool paint_center); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 int height_; | 83 int height_; |
| 82 // NOTE: the images are owned by ResourceBundle. Don't free them. | 84 // NOTE: the images are owned by ResourceBundle. Don't free them. |
| 83 const gfx::ImageSkia* images_[3]; | 85 const gfx::ImageSkia* images_[3]; |
| 84 | 86 |
| 85 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); | 87 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); |
| 86 }; | 88 }; |
| 87 | 89 |
| 88 } // namespace views | 90 } // namespace views |
| 89 | 91 |
| 90 #endif // UI_VIEWS_PAINTER_H_ | 92 #endif // UI_VIEWS_PAINTER_H_ |
| OLD | NEW |