Chromium Code Reviews| Index: ui/gfx/canvas.cc |
| diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc |
| index b2d90aec4189b22975350b0e57b77b7da60858c9..16f87d73e5ccf32dfd06f8b129d71a91503f91f9 100644 |
| --- a/ui/gfx/canvas.cc |
| +++ b/ui/gfx/canvas.cc |
| @@ -490,19 +490,8 @@ void Canvas::TileImageInt(const ImageSkia& image, |
| int dest_x, |
| int dest_y, |
| int w, |
| - int h) { |
| - TileImageInt(image, src_x, src_y, 1.0f, 1.0f, dest_x, dest_y, w, h); |
| -} |
| - |
| -void Canvas::TileImageInt(const ImageSkia& image, |
| - int src_x, |
| - int src_y, |
| - float tile_scale_x, |
| - float tile_scale_y, |
| - int dest_x, |
| - int dest_y, |
| - int w, |
| - int h) { |
| + int h, |
| + cc::PaintFlags* flags) { |
| SkRect dest_rect = { SkIntToScalar(dest_x), |
| SkIntToScalar(dest_y), |
| SkIntToScalar(dest_x + w), |
| @@ -510,10 +499,14 @@ void Canvas::TileImageInt(const ImageSkia& image, |
| if (!IntersectsClipRect(dest_rect)) |
| return; |
| - cc::PaintFlags flags; |
| - if (InitPaintFlagsForTiling(image, src_x, src_y, tile_scale_x, tile_scale_y, |
| - dest_x, dest_y, &flags)) |
| - canvas_->drawRect(dest_rect, flags); |
| + if (!flags) { |
| + cc::PaintFlags paint_flags; |
| + flags = &paint_flags; |
|
Peter Kasting
2017/03/24 22:52:35
This doesn't work -- you've declared your temp ins
Qiang(Joe) Xu
2017/03/24 22:57:00
oh, right! sorry for the iterations...
|
| + } |
| + if (InitPaintFlagsForTiling(image, src_x, src_y, 1.0f, 1.0f, dest_x, dest_y, |
| + flags)) { |
|
Peter Kasting
2017/03/24 22:52:35
Nit: Don't add {}
Qiang(Joe) Xu
2017/03/24 22:57:00
Done.
|
| + canvas_->drawRect(dest_rect, *flags); |
| + } |
| } |
| bool Canvas::InitPaintFlagsForTiling(const ImageSkia& image, |
| @@ -536,7 +529,6 @@ bool Canvas::InitPaintFlagsForTiling(const ImageSkia& image, |
| flags->setShader(CreateImageRepShader(image_rep, SkShader::kRepeat_TileMode, |
| shader_scale)); |
| - flags->setBlendMode(SkBlendMode::kSrcOver); |
| return true; |
| } |