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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 1945533002: Add way to mark other Surface a predecessor for a Surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/surfaces/surface.cc ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator.cc
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index 819ab63b0447b0c5f1d7fb58011479f970c53560..2beb8043e2b970c1eeb812622415e948c0732a97 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -153,14 +153,22 @@ gfx::Rect SurfaceAggregator::DamageRectForSurface(
const RenderPass& source,
const gfx::Rect& full_rect) const {
auto it = previous_contained_surfaces_.find(surface->surface_id());
- if (it == previous_contained_surfaces_.end())
- return full_rect;
+ if (it != previous_contained_surfaces_.end()) {
+ int previous_index = it->second;
+ if (previous_index == surface->frame_index())
+ return gfx::Rect();
+ }
+ SurfaceId previous_surface_id = surface->previous_frame_surface_id();
+
+ if (surface->surface_id() != previous_surface_id) {
+ it = previous_contained_surfaces_.find(previous_surface_id);
+ }
+ if (it != previous_contained_surfaces_.end()) {
+ int previous_index = it->second;
+ if (previous_index == surface->frame_index() - 1)
+ return source.damage_rect;
+ }
- int previous_index = it->second;
- if (previous_index == surface->frame_index())
- return gfx::Rect();
- if (previous_index == surface->frame_index() - 1)
- return source.damage_rect;
return full_rect;
}
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698