Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: ui/gfx/canvas.cc

Issue 2770943004: cros: Fix browser header wrongly drawn frame image (Closed)
Patch Set: feedback Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/canvas.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index b2d90aec4189b22975350b0e57b77b7da60858c9..4d52fa31cb8659fd56d26cc49f56d85497418eca 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,13 @@ 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);
+ cc::PaintFlags paint_flags;
+ if (!flags)
+ flags = &paint_flags;
+
+ if (InitPaintFlagsForTiling(image, src_x, src_y, 1.0f, 1.0f, dest_x, dest_y,
+ flags))
+ canvas_->drawRect(dest_rect, *flags);
}
bool Canvas::InitPaintFlagsForTiling(const ImageSkia& image,
@@ -536,7 +528,6 @@ bool Canvas::InitPaintFlagsForTiling(const ImageSkia& image,
flags->setShader(CreateImageRepShader(image_rep, SkShader::kRepeat_TileMode,
shader_scale));
- flags->setBlendMode(SkBlendMode::kSrcOver);
return true;
}
« no previous file with comments | « ui/gfx/canvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698