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

Unified Diff: cc/layers/layer.cc

Issue 5831706594508800: cc: Cleanup Layer::SetNeedsDisplayInRect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix image layers Created 7 years, 5 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/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 5e7bd77ecc9ee5fa31359d0d78e6980f529f7fc3..fc9f2daba445f1b78b01dc5a3c2624a620663b95 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -663,13 +663,13 @@ void Layer::SetHideLayerAndSubtree(bool hide) {
}
void Layer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
+ if (dirty_rect.IsEmpty())
+ return;
+
update_rect_.Union(dirty_rect);
needs_display_ = true;
- // Simply mark the contents as dirty. For non-root layers, the call to
- // SetNeedsCommit will schedule a fresh compositing pass.
- // For the root layer, SetNeedsCommit has no effect.
- if (DrawsContent() && !update_rect_.IsEmpty())
+ if (DrawsContent())
SetNeedsCommit();
}

Powered by Google App Engine
This is Rietveld 408576698