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

Side by Side Diff: ui/views/painter.h

Issue 10823229: (Views only) Add a gradient background to the tabstrip of the view tabbed pane implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 years, 4 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 | Annotate | Revision Log
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_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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698