Chromium Code Reviews| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 430 void DrawSolidFocusRect(RectF rect, SkColor color, int thickness); | 430 void DrawSolidFocusRect(RectF rect, SkColor color, int thickness); |
| 431 | 431 |
| 432 // Tiles the image in the specified region. | 432 // Tiles the image in the specified region. |
| 433 // Parameters are specified relative to current canvas scale not in pixels. | 433 // Parameters are specified relative to current canvas scale not in pixels. |
| 434 // Thus, |x| is 2 pixels if canvas scale = 2 & |x| = 1. | 434 // Thus, |x| is 2 pixels if canvas scale = 2 & |x| = 1. |
| 435 void TileImageInt(const ImageSkia& image, | 435 void TileImageInt(const ImageSkia& image, |
| 436 int x, | 436 int x, |
| 437 int y, | 437 int y, |
| 438 int w, | 438 int w, |
| 439 int h); | 439 int h); |
| 440 void TileImageInt(const ImageSkia& image, | 440 void TileImageInt(const ImageSkia& image, |
|
Qiang(Joe) Xu
2017/03/24 21:55:33
I still keep the no-flag version since there are s
Peter Kasting
2017/03/24 22:09:10
It looks like the three existing functions here ha
Qiang(Joe) Xu
2017/03/24 22:51:05
Done.
Qiang(Joe) Xu
2017/03/28 23:21:07
We shall not eliminate the last function because o
| |
| 441 int src_x, | 441 int src_x, |
| 442 int src_y, | 442 int src_y, |
| 443 int dest_x, | 443 int dest_x, |
| 444 int dest_y, | 444 int dest_y, |
| 445 int w, | 445 int w, |
| 446 int h); | 446 int h); |
| 447 void TileImageInt(const ImageSkia& image, | 447 void TileImageInt(const ImageSkia& image, |
| 448 int src_x, | 448 int src_x, |
| 449 int src_y, | 449 int src_y, |
| 450 int dest_x, | |
| 451 int dest_y, | |
| 452 int w, | |
| 453 int h, | |
| 454 cc::PaintFlags* flags); | |
| 455 void TileImageInt(const ImageSkia& image, | |
| 456 int src_x, | |
| 457 int src_y, | |
| 450 float tile_scale_x, | 458 float tile_scale_x, |
| 451 float tile_scale_y, | 459 float tile_scale_y, |
| 452 int dest_x, | 460 int dest_x, |
| 453 int dest_y, | 461 int dest_y, |
| 454 int w, | 462 int w, |
| 455 int h); | 463 int h, |
| 464 cc::PaintFlags* flags); | |
| 456 | 465 |
| 457 // Helper for TileImageInt(). Initializes |flags| for tiling |image| with the | 466 // Helper for TileImageInt(). Initializes |flags| for tiling |image| with the |
| 458 // given parameters. Returns false if the provided image does not have a | 467 // given parameters. Returns false if the provided image does not have a |
| 459 // representation for the current scale. | 468 // representation for the current scale. |
| 460 bool InitPaintFlagsForTiling(const ImageSkia& image, | 469 bool InitPaintFlagsForTiling(const ImageSkia& image, |
| 461 int src_x, | 470 int src_x, |
| 462 int src_y, | 471 int src_y, |
| 463 float tile_scale_x, | 472 float tile_scale_x, |
| 464 float tile_scale_y, | 473 float tile_scale_y, |
| 465 int dest_x, | 474 int dest_x, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 516 base::Optional<SkBitmap> bitmap_; | 525 base::Optional<SkBitmap> bitmap_; |
| 517 base::Optional<cc::SkiaPaintCanvas> owned_canvas_; | 526 base::Optional<cc::SkiaPaintCanvas> owned_canvas_; |
| 518 cc::PaintCanvas* canvas_; | 527 cc::PaintCanvas* canvas_; |
| 519 | 528 |
| 520 DISALLOW_COPY_AND_ASSIGN(Canvas); | 529 DISALLOW_COPY_AND_ASSIGN(Canvas); |
| 521 }; | 530 }; |
| 522 | 531 |
| 523 } // namespace gfx | 532 } // namespace gfx |
| 524 | 533 |
| 525 #endif // UI_GFX_CANVAS_H_ | 534 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |