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

Unified Diff: cc/trees/damage_tracker.cc

Issue 219963005: cc: Add support for partial swaps when using impl-side painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP - renaming + comments Created 6 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/trees/damage_tracker.cc
diff --git a/cc/trees/damage_tracker.cc b/cc/trees/damage_tracker.cc
index 40741461320fa0affe36e8f7d8628d61691b1271..2a0f551b2d5e700a5464d8f010758ed8fc37fd65 100644
--- a/cc/trees/damage_tracker.cc
+++ b/cc/trees/damage_tracker.cc
@@ -287,6 +287,10 @@ void DamageTracker::ExtendDamageForLayer(LayerImpl* layer,
layer->draw_transform(), gfx::Rect(layer->content_bounds()));
data.Update(rect_in_target_space, mailboxId_);
+ // Unify layer's update_rect and damage_rect.
danakj 2014/04/17 00:00:56 drop this comment, it just says exactly what the c
+ gfx::RectF damage_rect =
+ gfx::UnionRects(layer->update_rect(), layer->damage_rect());
+
if (layer_is_new || layer->LayerPropertyChanged()) {
// If a layer is new or has changed, then its entire layer rect affects the
// target surface.
@@ -295,11 +299,10 @@ void DamageTracker::ExtendDamageForLayer(LayerImpl* layer,
// The layer's old region is now exposed on the target surface, too.
// Note old_rect_in_target_space is already in target space.
target_damage_rect->Union(old_rect_in_target_space);
- } else if (!layer->update_rect().IsEmpty()) {
+ } else if (!damage_rect.IsEmpty()) {
// If the layer properties haven't changed, then the the target surface is
// only affected by the layer's update area, which could be empty.
- gfx::Rect update_content_rect =
- layer->LayerRectToContentRect(layer->update_rect());
+ gfx::Rect update_content_rect = layer->LayerRectToContentRect(damage_rect);
danakj 2014/04/17 00:00:56 rename this to |damage_content_rect| to match the
gfx::Rect update_rect_in_target_space = MathUtil::MapEnclosingClippedRect(
reveman 2014/04/17 05:18:34 and |damage_rect_in_target_space| here
layer->draw_transform(), update_content_rect);
target_damage_rect->Union(update_rect_in_target_space);

Powered by Google App Engine
This is Rietveld 408576698