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

Unified Diff: ui/gfx/canvas.cc

Issue 2770943004: cros: Fix browser header wrongly drawn frame image (Closed)
Patch Set: based on suggestions 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
« ui/gfx/canvas.h ('K') | « 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..d7f0ef8011ce67d7d5d370bce15114b4f0eee6f7 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -491,7 +491,19 @@ void Canvas::TileImageInt(const ImageSkia& image,
int dest_y,
int w,
int h) {
- TileImageInt(image, src_x, src_y, 1.0f, 1.0f, dest_x, dest_y, w, 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,
+ int src_x,
+ int src_y,
+ int dest_x,
+ int dest_y,
+ int w,
+ 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 +514,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 +523,10 @@ void Canvas::TileImageInt(const ImageSkia& image,
if (!IntersectsClipRect(dest_rect))
return;
- cc::PaintFlags flags;
+ DCHECK(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 +549,6 @@ bool Canvas::InitPaintFlagsForTiling(const ImageSkia& image,
flags->setShader(CreateImageRepShader(image_rep, SkShader::kRepeat_TileMode,
shader_scale));
- flags->setBlendMode(SkBlendMode::kSrcOver);
return true;
}
« ui/gfx/canvas.h ('K') | « ui/gfx/canvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698