Chromium Code Reviews| 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 DrawRectInt(const SkColor& color, | 125 virtual void DrawRect(const SkColor& color, const gfx::Rect& rect) = 0; |
|
Peter Kasting
2011/11/05 01:10:10
Nit: Kinda drives me crazy that some of these func
tfarina
2011/11/05 02:23:24
Me too. Addressed for DrawRect. Can I fix the othe
Peter Kasting
2011/11/21 19:26:03
Sure.
| |
| 126 int x, int y, int w, int h) = 0; | |
| 127 | 126 |
| 128 // Draws a single pixel rect in the specified region with the specified | 127 // Draws a single pixel rect in the specified region with the specified |
| 129 // color and transfer mode. | 128 // color and transfer mode. |
| 130 // | 129 // |
| 131 // NOTE: if you need a single pixel line, use DrawLineInt. | 130 // NOTE: if you need a single pixel line, use DrawLineInt. |
| 132 virtual void DrawRectInt(const SkColor& color, | 131 virtual void DrawRect(const SkColor& color, |
| 133 int x, int y, int w, int h, | 132 const gfx::Rect& rect, |
| 134 SkXfermode::Mode mode) = 0; | 133 SkXfermode::Mode mode) = 0; |
| 135 | 134 |
| 136 // Draws the given rectangle with the given paint's parameters. | 135 // Draws the given rectangle with the given paint's parameters. |
| 137 virtual void DrawRectInt(int x, int y, int w, int h, | 136 virtual void DrawRect(const gfx::Rect& rect, const SkPaint& paint) = 0; |
| 138 const SkPaint& paint) = 0; | |
| 139 | 137 |
| 140 // Draws a single pixel line with the specified color. | 138 // Draws a single pixel line with the specified color. |
| 141 virtual void DrawLineInt(const SkColor& color, | 139 virtual void DrawLineInt(const SkColor& color, |
| 142 int x1, int y1, | 140 int x1, int y1, |
| 143 int x2, int y2) = 0; | 141 int x2, int y2) = 0; |
| 144 | 142 |
| 145 // Draws a bitmap with the origin at the specified location. The upper left | 143 // Draws a bitmap with the origin at the specified location. The upper left |
| 146 // corner of the bitmap is rendered at the specified location. | 144 // corner of the bitmap is rendered at the specified location. |
| 147 virtual void DrawBitmapInt(const SkBitmap& bitmap, int x, int y) = 0; | 145 virtual void DrawBitmapInt(const SkBitmap& bitmap, int x, int y) = 0; |
| 148 | 146 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 // Returns the rectangle that is invalid. | 243 // Returns the rectangle that is invalid. |
| 246 virtual gfx::Rect GetInvalidRect() const = 0; | 244 virtual gfx::Rect GetInvalidRect() const = 0; |
| 247 | 245 |
| 248 // Returns the underlying Canvas. | 246 // Returns the underlying Canvas. |
| 249 virtual Canvas* AsCanvas() = 0; | 247 virtual Canvas* AsCanvas() = 0; |
| 250 }; | 248 }; |
| 251 | 249 |
| 252 } // namespace gfx | 250 } // namespace gfx |
| 253 | 251 |
| 254 #endif // UI_GFX_CANVAS_H_ | 252 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |