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 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
253 | 253 |
254 // Draws a circle with the given |paint| parameters. | 254 // Draws a circle with the given |paint| parameters. |
255 void DrawCircle(const Point& center_point, | 255 void DrawCircle(const Point& center_point, |
256 int radius, | 256 int radius, |
257 const SkPaint& paint); | 257 const SkPaint& paint); |
258 | 258 |
259 // Draws the given rectangle with rounded corners of |radius| using the | 259 // Draws the given rectangle with rounded corners of |radius| using the |
260 // given |paint| parameters. | 260 // given |paint| parameters. |
261 void DrawRoundRect(const Rect& rect, int radius, const SkPaint& paint); | 261 void DrawRoundRect(const Rect& rect, int radius, const SkPaint& paint); |
262 | 262 |
263 // Draws the given rectangle with rounded corners, where each radius can be | |
264 // set separately, given |paint| parameters. | |
265 void DrawRoundRect(const Rect& rect, | |
266 int radTL, | |
danakj
2014/09/15 17:49:52
style: rad_top_left
| |
267 int radTR, | |
268 int radBL, | |
269 int radBR, | |
270 const SkPaint& paint); | |
271 | |
263 // Draws the given path using the given |paint| parameters. | 272 // Draws the given path using the given |paint| parameters. |
264 void DrawPath(const SkPath& path, const SkPaint& paint); | 273 void DrawPath(const SkPath& path, const SkPaint& paint); |
265 | 274 |
266 // Draws an image with the origin at the specified location. The upper left | 275 // Draws an image with the origin at the specified location. The upper left |
267 // corner of the bitmap is rendered at the specified location. | 276 // corner of the bitmap is rendered at the specified location. |
268 // Parameters are specified relative to current canvas scale not in pixels. | 277 // Parameters are specified relative to current canvas scale not in pixels. |
269 // Thus, x is 2 pixels if canvas scale = 2 & |x| = 1. | 278 // Thus, x is 2 pixels if canvas scale = 2 & |x| = 1. |
270 void DrawImageInt(const ImageSkia&, int x, int y); | 279 void DrawImageInt(const ImageSkia&, int x, int y); |
271 | 280 |
272 // Helper for DrawImageInt(..., paint) that constructs a temporary paint and | 281 // Helper for DrawImageInt(..., paint) that constructs a temporary paint and |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
456 | 465 |
457 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; | 466 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; |
458 SkCanvas* canvas_; | 467 SkCanvas* canvas_; |
459 | 468 |
460 DISALLOW_COPY_AND_ASSIGN(Canvas); | 469 DISALLOW_COPY_AND_ASSIGN(Canvas); |
461 }; | 470 }; |
462 | 471 |
463 } // namespace gfx | 472 } // namespace gfx |
464 | 473 |
465 #endif // UI_GFX_CANVAS_H_ | 474 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |