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

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: resolve cc_unittests build error 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
« no previous file with comments | « cc/test/fake_tile_manager_client.h ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/damage_tracker.cc
diff --git a/cc/trees/damage_tracker.cc b/cc/trees/damage_tracker.cc
index 40741461320fa0affe36e8f7d8628d61691b1271..866f09d65692388c8e508d3456ed35054dd49d1b 100644
--- a/cc/trees/damage_tracker.cc
+++ b/cc/trees/damage_tracker.cc
@@ -287,6 +287,9 @@ void DamageTracker::ExtendDamageForLayer(LayerImpl* layer,
layer->draw_transform(), gfx::Rect(layer->content_bounds()));
data.Update(rect_in_target_space, mailboxId_);
+ 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,14 +298,13 @@ 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_rect_in_target_space = MathUtil::MapEnclosingClippedRect(
- layer->draw_transform(), update_content_rect);
- target_damage_rect->Union(update_rect_in_target_space);
+ // only affected by the layer's damaged area, which could be empty.
+ gfx::Rect damage_content_rect = layer->LayerRectToContentRect(damage_rect);
+ gfx::Rect damage_rect_in_target_space = MathUtil::MapEnclosingClippedRect(
+ layer->draw_transform(), damage_content_rect);
+ target_damage_rect->Union(damage_rect_in_target_space);
}
}
« no previous file with comments | « cc/test/fake_tile_manager_client.h ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698