| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 static std::unique_ptr<Painter> CreateImageGridPainter(const int image_ids[]); | 80 static std::unique_ptr<Painter> CreateImageGridPainter(const int image_ids[]); |
| 81 | 81 |
| 82 // Factory methods for creating painters intended for rendering focus. | 82 // Factory methods for creating painters intended for rendering focus. |
| 83 static std::unique_ptr<Painter> CreateDashedFocusPainter(); | 83 static std::unique_ptr<Painter> CreateDashedFocusPainter(); |
| 84 static std::unique_ptr<Painter> CreateDashedFocusPainterWithInsets( | 84 static std::unique_ptr<Painter> CreateDashedFocusPainterWithInsets( |
| 85 const gfx::Insets& insets); | 85 const gfx::Insets& insets); |
| 86 // Deprecated: used the InsetsF version below. | 86 // Deprecated: used the InsetsF version below. |
| 87 static std::unique_ptr<Painter> CreateSolidFocusPainter( | 87 static std::unique_ptr<Painter> CreateSolidFocusPainter( |
| 88 SkColor color, | 88 SkColor color, |
| 89 const gfx::Insets& insets); | 89 const gfx::Insets& insets); |
| 90 // |thickness| is in dip. |
| 90 static std::unique_ptr<Painter> CreateSolidFocusPainter( | 91 static std::unique_ptr<Painter> CreateSolidFocusPainter( |
| 91 SkColor color, | 92 SkColor color, |
| 92 SkScalar thickness, | 93 int thickness, |
| 93 const gfx::InsetsF& insets); | 94 const gfx::InsetsF& insets); |
| 94 | 95 |
| 95 // Returns the minimum size this painter can paint without obvious graphical | 96 // Returns the minimum size this painter can paint without obvious graphical |
| 96 // problems (e.g. overlapping images). | 97 // problems (e.g. overlapping images). |
| 97 virtual gfx::Size GetMinimumSize() const = 0; | 98 virtual gfx::Size GetMinimumSize() const = 0; |
| 98 | 99 |
| 99 // Paints the painter in the specified region. | 100 // Paints the painter in the specified region. |
| 100 virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) = 0; | 101 virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) = 0; |
| 101 | 102 |
| 102 private: | 103 private: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 128 | 129 |
| 129 // NOTE: the images are owned by ResourceBundle. Don't free them. | 130 // NOTE: the images are owned by ResourceBundle. Don't free them. |
| 130 const gfx::ImageSkia* images_[3]; | 131 const gfx::ImageSkia* images_[3]; |
| 131 | 132 |
| 132 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); | 133 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); |
| 133 }; | 134 }; |
| 134 | 135 |
| 135 } // namespace views | 136 } // namespace views |
| 136 | 137 |
| 137 #endif // UI_VIEWS_PAINTER_H_ | 138 #endif // UI_VIEWS_PAINTER_H_ |
| OLD | NEW |