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

Unified Diff: cc/resources/picture_pile_impl.cc

Issue 14322017: Revert "cc: Move canvas clear from picture to picture_pile_impl" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 7 years, 8 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
Index: cc/resources/picture_pile_impl.cc
diff --git a/cc/resources/picture_pile_impl.cc b/cc/resources/picture_pile_impl.cc
index 865e878ac75a1d1894775a3435937c69bd6164ff..6299e29988dda5597898050af5ddc9d44afa2ad2 100644
--- a/cc/resources/picture_pile_impl.cc
+++ b/cc/resources/picture_pile_impl.cc
@@ -96,25 +96,15 @@ void PicturePileImpl::Raster(
gfx::Rect content_rect = total_content_rect;
content_rect.Intersect(canvas_rect);
- // Clear one texel inside the right/bottom edge of the content rect,
- // as it may only be partially covered by the picture playback.
- // Also clear one texel outside the right/bottom edge of the content rect,
- // as it may get blended in by linear filtering when zoomed in.
- gfx::Rect deflated_content_rect = total_content_rect;
- deflated_content_rect.Inset(0, 0, 1, 1);
-
- gfx::Rect canvas_outside_content_rect = canvas_rect;
- canvas_outside_content_rect.Subtract(deflated_content_rect);
-
- if (!canvas_outside_content_rect.IsEmpty()) {
- gfx::Rect inflated_content_rect = total_content_rect;
- inflated_content_rect.Inset(0, 0, -1, -1);
- canvas->clipRect(gfx::RectToSkRect(inflated_content_rect),
- SkRegion::kReplace_Op);
- canvas->clipRect(gfx::RectToSkRect(deflated_content_rect),
- SkRegion::kDifference_Op);
- canvas->drawColor(background_color_, SkXfermode::kSrc_Mode);
- }
+ // Clear an inflated content rect, to ensure that we always sample
+ // a correct pixel.
+ gfx::Rect inflated_content_rect = total_content_rect;
+ inflated_content_rect.Inset(0, 0, -1, -1);
+
+ SkPaint background_paint;
+ background_paint.setColor(background_color_);
+ background_paint.setXfermodeMode(SkXfermode::kSrc_Mode);
+ canvas->drawRect(RectToSkRect(inflated_content_rect), background_paint);
Tom Hudson 2013/04/30 09:43:59 canvas->clear(background_color_) may be more effic
vmpstr 2013/04/30 17:06:23 Fixed.
enne (OOO) 2013/04/30 17:13:53 Sometimes we are only rastering a sub-rectangle of
// Rasterize the collection of relevant picture piles.
gfx::Rect layer_rect = gfx::ToEnclosingRect(

Powered by Google App Engine
This is Rietveld 408576698