| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // Draws a line with the given |flags| parameters. | 285 // Draws a line with the given |flags| parameters. |
| 286 // DEPRECATED in favor of the RectF version below. | 286 // DEPRECATED in favor of the RectF version below. |
| 287 // TODO(funkysidd): Remove this (http://crbug.com/553726) | 287 // TODO(funkysidd): Remove this (http://crbug.com/553726) |
| 288 void DrawLine(const Point& p1, const Point& p2, const cc::PaintFlags& flags); | 288 void DrawLine(const Point& p1, const Point& p2, const cc::PaintFlags& flags); |
| 289 | 289 |
| 290 // Draws a line with the given |flags| parameters. | 290 // Draws a line with the given |flags| parameters. |
| 291 void DrawLine(const PointF& p1, | 291 void DrawLine(const PointF& p1, |
| 292 const PointF& p2, | 292 const PointF& p2, |
| 293 const cc::PaintFlags& flags); | 293 const cc::PaintFlags& flags); |
| 294 | 294 |
| 295 // Draws a line that's a single DIP. At fractional scale factors, this is |
| 296 // floored to the nearest integral number of pixels. |
| 297 void DrawSharpLine(PointF p1, PointF p2, SkColor color); |
| 298 |
| 295 // Draws a circle with the given |flags| parameters. | 299 // Draws a circle with the given |flags| parameters. |
| 296 // DEPRECATED in favor of the RectF version below. | 300 // DEPRECATED in favor of the RectF version below. |
| 297 // TODO(funkysidd): Remove this (http://crbug.com/553726) | 301 // TODO(funkysidd): Remove this (http://crbug.com/553726) |
| 298 void DrawCircle(const Point& center_point, | 302 void DrawCircle(const Point& center_point, |
| 299 int radius, | 303 int radius, |
| 300 const cc::PaintFlags& flags); | 304 const cc::PaintFlags& flags); |
| 301 | 305 |
| 302 // Draws a circle with the given |flags| parameters. | 306 // Draws a circle with the given |flags| parameters. |
| 303 void DrawCircle(const PointF& center_point, | 307 void DrawCircle(const PointF& center_point, |
| 304 float radius, | 308 float radius, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 // Draws a dotted gray rectangle used for focus purposes. | 419 // Draws a dotted gray rectangle used for focus purposes. |
| 416 // DEPRECATED in favor of the RectF version below. | 420 // DEPRECATED in favor of the RectF version below. |
| 417 // TODO(funkysidd): Remove this (http://crbug.com/553726) | 421 // TODO(funkysidd): Remove this (http://crbug.com/553726) |
| 418 void DrawFocusRect(const Rect& rect); | 422 void DrawFocusRect(const Rect& rect); |
| 419 | 423 |
| 420 // Draws a dotted gray rectangle used for focus purposes. | 424 // Draws a dotted gray rectangle used for focus purposes. |
| 421 void DrawFocusRect(const RectF& rect); | 425 void DrawFocusRect(const RectF& rect); |
| 422 | 426 |
| 423 // Draws a |rect| in the specified region with the specified |color| with a | 427 // Draws a |rect| in the specified region with the specified |color| with a |
| 424 // with of one logical pixel which might be more device pixels. | 428 // with of one logical pixel which might be more device pixels. |
| 425 void DrawSolidFocusRect(const RectF& rect, SkColor color, float thickness); | 429 void DrawSolidFocusRect(RectF rect, SkColor color, float thickness); |
| 426 | 430 |
| 427 // Tiles the image in the specified region. | 431 // Tiles the image in the specified region. |
| 428 // Parameters are specified relative to current canvas scale not in pixels. | 432 // Parameters are specified relative to current canvas scale not in pixels. |
| 429 // Thus, |x| is 2 pixels if canvas scale = 2 & |x| = 1. | 433 // Thus, |x| is 2 pixels if canvas scale = 2 & |x| = 1. |
| 430 void TileImageInt(const ImageSkia& image, | 434 void TileImageInt(const ImageSkia& image, |
| 431 int x, | 435 int x, |
| 432 int y, | 436 int y, |
| 433 int w, | 437 int w, |
| 434 int h); | 438 int h); |
| 435 void TileImageInt(const ImageSkia& image, | 439 void TileImageInt(const ImageSkia& image, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 // but surface_ will be null. | 512 // but surface_ will be null. |
| 509 sk_sp<cc::PaintSurface> surface_; | 513 sk_sp<cc::PaintSurface> surface_; |
| 510 cc::PaintCanvas* canvas_; | 514 cc::PaintCanvas* canvas_; |
| 511 | 515 |
| 512 DISALLOW_COPY_AND_ASSIGN(Canvas); | 516 DISALLOW_COPY_AND_ASSIGN(Canvas); |
| 513 }; | 517 }; |
| 514 | 518 |
| 515 } // namespace gfx | 519 } // namespace gfx |
| 516 | 520 |
| 517 #endif // UI_GFX_CANVAS_H_ | 521 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |