| 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_);
|
|
|