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_GFX_CANVAS_H_ | 5 #ifndef UI_GFX_CANVAS_H_ |
6 #define UI_GFX_CANVAS_H_ | 6 #define UI_GFX_CANVAS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // call Restore() more times than Save*(). | 98 // call Restore() more times than Save*(). |
99 virtual void Restore() = 0; | 99 virtual void Restore() = 0; |
100 | 100 |
101 // Returns true if the clip is non-empty. | 101 // Returns true if the clip is non-empty. |
102 virtual bool ClipRect(const gfx::Rect& rect) = 0; | 102 virtual bool ClipRect(const gfx::Rect& rect) = 0; |
103 | 103 |
104 virtual void Translate(const gfx::Point& point) = 0; | 104 virtual void Translate(const gfx::Point& point) = 0; |
105 | 105 |
106 virtual void Scale(int x_scale, int y_scale) = 0; | 106 virtual void Scale(int x_scale, int y_scale) = 0; |
107 | 107 |
108 // Fills the specified region with the specified color using a transfer | 108 // Fills |rect| with |color| using a transfer mode of |
109 // mode of SkXfermode::kSrcOver_Mode. | 109 // SkXfermode::kSrcOver_Mode. |
110 virtual void FillRect(const SkColor& color, const gfx::Rect& rect) = 0; | 110 virtual void FillRect(const gfx::Rect& rect, const SkColor& color) = 0; |
111 | 111 |
112 // Fills the specified region with the specified color and mode. | 112 // Fills |rect| with the specified |color| and |mode|. |
113 virtual void FillRect(const SkColor& color, | 113 virtual void FillRect(const gfx::Rect& rect, |
114 const gfx::Rect& rect, | 114 const SkColor& color, |
115 SkXfermode::Mode mode) = 0; | 115 SkXfermode::Mode mode) = 0; |
116 | 116 |
117 // Fills the specified region with the specified brush. | 117 // Fills |rect| with the specified |brush|. |
118 virtual void FillRect(const gfx::Brush* brush, const gfx::Rect& rect) = 0; | 118 virtual void FillRect(const gfx::Rect& rect, const gfx::Brush* brush) = 0; |
119 | 119 |
120 // Draws a single pixel rect in the specified region with the specified | 120 // Draws a single pixel rect in the specified region with the specified |
121 // color, using a transfer mode of SkXfermode::kSrcOver_Mode. | 121 // color, using a transfer mode of SkXfermode::kSrcOver_Mode. |
122 // | 122 // |
123 // NOTE: if you need a single pixel line, use DrawLineInt. | 123 // NOTE: if you need a single pixel line, use DrawLineInt. |
124 virtual void DrawRect(const gfx::Rect& rect, const SkColor& color) = 0; | 124 virtual void DrawRect(const gfx::Rect& rect, const SkColor& color) = 0; |
125 | 125 |
126 // Draws a single pixel rect in the specified region with the specified | 126 // Draws a single pixel rect in the specified region with the specified |
127 // color and transfer mode. | 127 // color and transfer mode. |
128 // | 128 // |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // Returns the rectangle that is invalid. | 237 // Returns the rectangle that is invalid. |
238 virtual gfx::Rect GetInvalidRect() const = 0; | 238 virtual gfx::Rect GetInvalidRect() const = 0; |
239 | 239 |
240 // Returns the underlying Canvas. | 240 // Returns the underlying Canvas. |
241 virtual Canvas* AsCanvas() = 0; | 241 virtual Canvas* AsCanvas() = 0; |
242 }; | 242 }; |
243 | 243 |
244 } // namespace gfx | 244 } // namespace gfx |
245 | 245 |
246 #endif // UI_GFX_CANVAS_H_ | 246 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |