OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 const gfx::Rect& rect, | 115 const gfx::Rect& rect, |
116 SkXfermode::Mode mode) = 0; | 116 SkXfermode::Mode mode) = 0; |
117 | 117 |
118 // Fills the specified region with the specified brush. | 118 // Fills the specified region with the specified brush. |
119 virtual void FillRect(const gfx::Brush* brush, const gfx::Rect& rect) = 0; | 119 virtual void FillRect(const gfx::Brush* brush, const gfx::Rect& rect) = 0; |
120 | 120 |
121 // Draws a single pixel rect in the specified region with the specified | 121 // Draws a single pixel rect in the specified region with the specified |
122 // color, using a transfer mode of SkXfermode::kSrcOver_Mode. | 122 // color, using a transfer mode of SkXfermode::kSrcOver_Mode. |
123 // | 123 // |
124 // NOTE: if you need a single pixel line, use DrawLineInt. | 124 // NOTE: if you need a single pixel line, use DrawLineInt. |
125 virtual void DrawRect(const gfx::Rect& rect, const SkColor& color) = 0; | 125 virtual void DrawRectInt(const SkColor& color, |
| 126 int x, int y, int w, int h) = 0; |
126 | 127 |
127 // Draws a single pixel rect in the specified region with the specified | 128 // Draws a single pixel rect in the specified region with the specified |
128 // color and transfer mode. | 129 // color and transfer mode. |
129 // | 130 // |
130 // NOTE: if you need a single pixel line, use DrawLineInt. | 131 // NOTE: if you need a single pixel line, use DrawLineInt. |
131 virtual void DrawRect(const gfx::Rect& rect, | 132 virtual void DrawRectInt(const SkColor& color, |
132 const SkColor& color, | 133 int x, int y, int w, int h, |
133 SkXfermode::Mode mode) = 0; | 134 SkXfermode::Mode mode) = 0; |
134 | 135 |
135 // Draws the given rectangle with the given paint's parameters. | 136 // Draws the given rectangle with the given paint's parameters. |
136 virtual void DrawRect(const gfx::Rect& rect, const SkPaint& paint) = 0; | 137 virtual void DrawRectInt(int x, int y, int w, int h, |
| 138 const SkPaint& paint) = 0; |
137 | 139 |
138 // Draws a single pixel line with the specified color. | 140 // Draws a single pixel line with the specified color. |
139 virtual void DrawLineInt(const SkColor& color, | 141 virtual void DrawLineInt(const SkColor& color, |
140 int x1, int y1, | 142 int x1, int y1, |
141 int x2, int y2) = 0; | 143 int x2, int y2) = 0; |
142 | 144 |
143 // Draws a bitmap with the origin at the specified location. The upper left | 145 // Draws a bitmap with the origin at the specified location. The upper left |
144 // corner of the bitmap is rendered at the specified location. | 146 // corner of the bitmap is rendered at the specified location. |
145 virtual void DrawBitmapInt(const SkBitmap& bitmap, int x, int y) = 0; | 147 virtual void DrawBitmapInt(const SkBitmap& bitmap, int x, int y) = 0; |
146 | 148 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // Returns the rectangle that is invalid. | 245 // Returns the rectangle that is invalid. |
244 virtual gfx::Rect GetInvalidRect() const = 0; | 246 virtual gfx::Rect GetInvalidRect() const = 0; |
245 | 247 |
246 // Returns the underlying Canvas. | 248 // Returns the underlying Canvas. |
247 virtual Canvas* AsCanvas() = 0; | 249 virtual Canvas* AsCanvas() = 0; |
248 }; | 250 }; |
249 | 251 |
250 } // namespace gfx | 252 } // namespace gfx |
251 | 253 |
252 #endif // UI_GFX_CANVAS_H_ | 254 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |