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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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_aggregator.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 f5689c5b4cb4ace1f4afb2bb4d85f4d91e3e6f10..2334d141e28557be84fb1e9199016ad4788b6652 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -153,13 +153,14 @@ bool SurfaceAggregator::TakeResources(Surface* surface,
}
gfx::Rect SurfaceAggregator::DamageRectForSurface(const Surface* surface,
- const RenderPass& source) {
+ const RenderPass& source,
+ const gfx::Rect& full_rect) {
int previous_index = previous_contained_surfaces_[surface->surface_id()];
if (previous_index == surface->frame_index())
return gfx::Rect();
else if (previous_index == surface->frame_index() - 1)
return source.damage_rect;
- return gfx::Rect(surface->size());
+ return full_rect;
}
void SurfaceAggregator::HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad,
@@ -267,7 +268,8 @@ void SurfaceAggregator::HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad,
gfx::UnionRects(dest_pass->damage_rect,
MathUtil::MapEnclosingClippedRect(
surface_quad->quadTransform(),
- DamageRectForSurface(surface, last_pass)));
+ DamageRectForSurface(surface, last_pass,
+ surface_quad->visible_rect)));
referenced_surfaces_.erase(it);
}
@@ -364,9 +366,8 @@ 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),
+ copy_pass->SetAll(remapped_pass_id, source.output_rect,
+ DamageRectForSurface(surface, source, source.output_rect),
source.transform_to_root_target,
source.has_transparent_background);
@@ -415,6 +416,9 @@ scoped_ptr<CompositorFrame> SurfaceAggregator::Aggregate(SurfaceId surface_id) {
referenced_surfaces_.erase(it);
DCHECK(referenced_surfaces_.empty());
+ if (dest_pass_list_->empty())
+ return nullptr;
+
dest_pass_list_ = NULL;
RemoveUnreferencedChildren();
contained_surfaces_.swap(previous_contained_surfaces_);
« no previous file with comments | « cc/surfaces/surface_aggregator.h ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698