| 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 int flags); | 417 int flags); |
| 418 | 418 |
| 419 // Draws a dotted gray rectangle used for focus purposes. | 419 // Draws a dotted gray rectangle used for focus purposes. |
| 420 // DEPRECATED in favor of the RectF version below. | 420 // DEPRECATED in favor of the RectF version below. |
| 421 // TODO(funkysidd): Remove this (http://crbug.com/553726) | 421 // TODO(funkysidd): Remove this (http://crbug.com/553726) |
| 422 void DrawFocusRect(const Rect& rect); | 422 void DrawFocusRect(const Rect& rect); |
| 423 | 423 |
| 424 // Draws a dotted gray rectangle used for focus purposes. | 424 // Draws a dotted gray rectangle used for focus purposes. |
| 425 void DrawFocusRect(const RectF& rect); | 425 void DrawFocusRect(const RectF& rect); |
| 426 | 426 |
| 427 // 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|. The |
| 428 // with of one logical pixel which might be more device pixels. | 428 // width of the stroke is |thickness| dip, but the actual pixel width will be |
| 429 void DrawSolidFocusRect(RectF rect, SkColor color, float thickness); | 429 // floored to ensure an integral value. |
| 430 void DrawSolidFocusRect(RectF rect, SkColor color, int thickness); |
| 430 | 431 |
| 431 // Tiles the image in the specified region. | 432 // Tiles the image in the specified region. |
| 432 // Parameters are specified relative to current canvas scale not in pixels. | 433 // Parameters are specified relative to current canvas scale not in pixels. |
| 433 // Thus, |x| is 2 pixels if canvas scale = 2 & |x| = 1. | 434 // Thus, |x| is 2 pixels if canvas scale = 2 & |x| = 1. |
| 434 void TileImageInt(const ImageSkia& image, | 435 void TileImageInt(const ImageSkia& image, |
| 435 int x, | 436 int x, |
| 436 int y, | 437 int y, |
| 437 int w, | 438 int w, |
| 438 int h); | 439 int h); |
| 439 void TileImageInt(const ImageSkia& image, | 440 void TileImageInt(const ImageSkia& image, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 // but surface_ will be null. | 513 // but surface_ will be null. |
| 513 sk_sp<cc::PaintSurface> surface_; | 514 sk_sp<cc::PaintSurface> surface_; |
| 514 cc::PaintCanvas* canvas_; | 515 cc::PaintCanvas* canvas_; |
| 515 | 516 |
| 516 DISALLOW_COPY_AND_ASSIGN(Canvas); | 517 DISALLOW_COPY_AND_ASSIGN(Canvas); |
| 517 }; | 518 }; |
| 518 | 519 |
| 519 } // namespace gfx | 520 } // namespace gfx |
| 520 | 521 |
| 521 #endif // UI_GFX_CANVAS_H_ | 522 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |