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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 1013463003: Update from https://crrev.com/320931 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/display.h ('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 4f00ff34ba738a02154bb0c8b8f8d40a314daae2..21ec6dbdb3802051aabf82246c9f84aac0098f43 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -228,6 +228,8 @@ void SurfaceAggregator::HandleSurfaceQuad(
bool merge_pass = surface_quad->opacity() == 1.f && copy_requests.empty();
+ gfx::Rect surface_damage = DamageRectForSurface(
+ surface, *render_pass_list.back(), surface_quad->visible_rect);
const RenderPassList& referenced_passes = render_pass_list;
size_t passes_to_copy =
merge_pass ? referenced_passes.size() - 1 : referenced_passes.size();
@@ -240,9 +242,7 @@ void SurfaceAggregator::HandleSurfaceQuad(
RenderPassId remapped_pass_id = RemapPassId(source.id, surface_id);
- copy_pass->SetAll(remapped_pass_id,
- source.output_rect,
- source.damage_rect,
+ copy_pass->SetAll(remapped_pass_id, source.output_rect, gfx::Rect(),
source.transform_to_root_target,
source.has_transparent_background);
@@ -261,6 +261,9 @@ void SurfaceAggregator::HandleSurfaceQuad(
CopyQuadsToPass(source.quad_list, source.shared_quad_state_list,
gfx::Transform(), ClipData(), copy_pass.get(), surface_id);
+ if (j == referenced_passes.size() - 1)
+ surface_damage = gfx::UnionRects(surface_damage, copy_pass->damage_rect);
+
dest_pass_list_->push_back(copy_pass.Pass());
}
@@ -309,9 +312,7 @@ void SurfaceAggregator::HandleSurfaceQuad(
dest_pass->damage_rect =
gfx::UnionRects(dest_pass->damage_rect,
MathUtil::MapEnclosingClippedRect(
- surface_quad->quadTransform(),
- DamageRectForSurface(surface, last_pass,
- surface_quad->visible_rect)));
+ surface_quad->quadTransform(), surface_damage));
referenced_surfaces_.erase(it);
}
@@ -375,10 +376,20 @@ void SurfaceAggregator::CopyQuadsToPass(
RenderPassId remapped_pass_id =
RemapPassId(original_pass_id, surface_id);
- dest_pass->CopyFromAndAppendRenderPassDrawQuad(
- pass_quad,
- dest_pass->shared_quad_state_list.back(),
+ gfx::Rect pass_damage;
+ for (const auto* pass : *dest_pass_list_) {
+ if (pass->id == remapped_pass_id) {
+ pass_damage = pass->damage_rect;
+ break;
+ }
+ }
+
+ DrawQuad* rpdq = dest_pass->CopyFromAndAppendRenderPassDrawQuad(
+ pass_quad, dest_pass->shared_quad_state_list.back(),
remapped_pass_id);
+ dest_pass->damage_rect = gfx::UnionRects(
+ dest_pass->damage_rect, MathUtil::MapEnclosingClippedRect(
+ rpdq->quadTransform(), pass_damage));
} else {
dest_pass->CopyFromAndAppendDrawQuad(
quad, dest_pass->shared_quad_state_list.back());
@@ -411,8 +422,11 @@ void SurfaceAggregator::CopyPasses(const DelegatedFrameData* frame_data,
RenderPassId remapped_pass_id =
RemapPassId(source.id, surface->surface_id());
- copy_pass->SetAll(remapped_pass_id, source.output_rect,
- DamageRectForSurface(surface, source, source.output_rect),
+ gfx::Rect damage_rect =
+ (i < source_pass_list.size() - 1)
+ ? gfx::Rect()
+ : DamageRectForSurface(surface, source, source.output_rect);
+ copy_pass->SetAll(remapped_pass_id, source.output_rect, damage_rect,
source.transform_to_root_target,
source.has_transparent_background);
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698