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

Unified Diff: cc/resources/content_layer_updater.cc

Issue 61403003: Limit pixels that get cleared to repaint area. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify the code by always clearing with drawColor Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/content_layer_updater.cc
diff --git a/cc/resources/content_layer_updater.cc b/cc/resources/content_layer_updater.cc
index 92cabf2c66da9175da7cde477688eb4e353224e1..e3f87a4c272a08aca0278226cd83c74294c52c5c 100644
--- a/cc/resources/content_layer_updater.cc
+++ b/cc/resources/content_layer_updater.cc
@@ -62,12 +62,14 @@ void ContentLayerUpdater::PaintContents(SkCanvas* canvas,
SkRect layer_sk_rect = SkRect::MakeXYWH(
layer_rect.x(), layer_rect.y(), layer_rect.width(), layer_rect.height());
+ canvas->clipRect(layer_sk_rect);
+
// If the layer has opaque contents then there is no need to
// clear the canvas before painting.
- if (!layer_is_opaque_)
- canvas->clear(SK_ColorTRANSPARENT);
-
- canvas->clipRect(layer_sk_rect);
+ if (!layer_is_opaque_) {
+ TRACE_EVENT0("cc", "Clear");
+ canvas->drawColor(SK_ColorTRANSPARENT, SkXfermode::kSrc_Mode);
+ }
gfx::RectF opaque_layer_rect;
painter_->Paint(canvas, layer_rect, &opaque_layer_rect);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698