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

Unified Diff: ui/gfx/canvas.cc

Issue 2770943004: cros: Fix browser header wrongly drawn frame image (Closed)
Patch Set: do not eliminate the last TileImageInt 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..67ea0fb0169c570b0963bee5ce185a195ba67bba 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -490,8 +490,9 @@ 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);
+ int h,
+ cc::PaintFlags* flags) {
+ TileImageInt(image, src_x, src_y, 1.0f, 1.0f, dest_x, dest_y, w, h, flags);
}
void Canvas::TileImageInt(const ImageSkia& image,
@@ -502,7 +503,8 @@ void Canvas::TileImageInt(const ImageSkia& image,
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 +512,13 @@ void Canvas::TileImageInt(const ImageSkia& image,
if (!IntersectsClipRect(dest_rect))
return;
- cc::PaintFlags flags;
+ cc::PaintFlags paint_flags;
+ if (!flags)
+ flags = &paint_flags;
+
if (InitPaintFlagsForTiling(image, src_x, src_y, tile_scale_x, tile_scale_y,
- dest_x, dest_y, &flags))
- canvas_->drawRect(dest_rect, flags);
+ dest_x, dest_y, flags))
+ canvas_->drawRect(dest_rect, *flags);
}
bool Canvas::InitPaintFlagsForTiling(const ImageSkia& image,
@@ -536,7 +541,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