OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_VIEWS_PAINTER_H__ | 5 #ifndef CHROME_VIEWS_PAINTER_H__ |
6 #define CHROME_VIEWS_PAINTER_H__ | 6 #define CHROME_VIEWS_PAINTER_H__ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 private: | 74 private: |
75 bool tile_; | 75 bool tile_; |
76 bool draw_center_; | 76 bool draw_center_; |
77 bool tile_center_; | 77 bool tile_center_; |
78 // NOTE: the images are owned by ResourceBundle. Don't free them. | 78 // NOTE: the images are owned by ResourceBundle. Don't free them. |
79 std::vector<SkBitmap*> images_; | 79 std::vector<SkBitmap*> images_; |
80 | 80 |
81 DISALLOW_EVIL_CONSTRUCTORS(ImagePainter); | 81 DISALLOW_EVIL_CONSTRUCTORS(ImagePainter); |
82 }; | 82 }; |
83 | 83 |
84 // HorizontalPainter paints 3 images into a box: left, center and right. The lef
t | 84 // HorizontalPainter paints 3 images into a box: left, center and right. The |
85 // and right images are drawn to size at the left/right edges of the region. | 85 // left and right images are drawn to size at the left/right edges of the |
86 // The center is tiled in the remaining space. All images must have the same | 86 // region. The center is tiled in the remaining space. All images must have the |
87 // height. | 87 // same height. |
88 class HorizontalPainter : public Painter { | 88 class HorizontalPainter : public Painter { |
89 public: | 89 public: |
90 // Constructs a new HorizontalPainter loading the specified image names. | 90 // Constructs a new HorizontalPainter loading the specified image names. |
91 // The images must be in the order left, right and center. | 91 // The images must be in the order left, right and center. |
92 explicit HorizontalPainter(const int image_resource_names[]); | 92 explicit HorizontalPainter(const int image_resource_names[]); |
93 | 93 |
94 virtual ~HorizontalPainter() {} | 94 virtual ~HorizontalPainter() {} |
95 | 95 |
96 // Paints the images. | 96 // Paints the images. |
97 virtual void Paint(int w, int h, ChromeCanvas* canvas); | 97 virtual void Paint(int w, int h, ChromeCanvas* canvas); |
(...skipping 14 matching lines...) Expand all Loading... |
112 // NOTE: the images are owned by ResourceBundle. Don't free them. | 112 // NOTE: the images are owned by ResourceBundle. Don't free them. |
113 SkBitmap* images_[3]; | 113 SkBitmap* images_[3]; |
114 | 114 |
115 DISALLOW_EVIL_CONSTRUCTORS(HorizontalPainter); | 115 DISALLOW_EVIL_CONSTRUCTORS(HorizontalPainter); |
116 }; | 116 }; |
117 | 117 |
118 } // namespace views | 118 } // namespace views |
119 | 119 |
120 #endif // CHROME_VIEWS_PAINTER_H__ | 120 #endif // CHROME_VIEWS_PAINTER_H__ |
121 | 121 |
OLD | NEW |