Chromium Code Reviews| Index: cc/surfaces/surface_aggregator.cc |
| diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc |
| index 05d1070a10305178aa58a100090efb99daa35b8d..9f23379f8b1a5e595025d5ec4e48a756022efa95 100644 |
| --- a/cc/surfaces/surface_aggregator.cc |
| +++ b/cc/surfaces/surface_aggregator.cc |
| @@ -225,7 +225,8 @@ void SurfaceAggregator::HandleSurfaceQuad( |
| RenderPassId remapped_pass_id = RemapPassId(source.id, surface_id); |
| copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, |
| - source.transform_to_root_target, |
| + source.transform_to_root_target, source.filters, |
| + source.background_filters, |
| source.has_transparent_background); |
| MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); |
| @@ -294,8 +295,8 @@ void SurfaceAggregator::HandleSurfaceQuad( |
| dest_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); |
| quad->SetNew(shared_quad_state, surface_quad->rect, |
| surface_quad->visible_rect, remapped_pass_id, 0, |
| - gfx::Vector2dF(), gfx::Size(), FilterOperations(), |
| - gfx::Vector2dF(), gfx::PointF(), FilterOperations()); |
| + gfx::Vector2dF(), gfx::Size(), gfx::Vector2dF(), |
| + gfx::PointF()); |
| } |
| referenced_surfaces_.erase(it); |
| @@ -492,7 +493,8 @@ void SurfaceAggregator::CopyPasses(const CompositorFrame& frame, |
| RemapPassId(source.id, surface->surface_id()); |
| copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, |
| - source.transform_to_root_target, |
| + source.transform_to_root_target, source.filters, |
| + source.background_filters, |
| source.has_transparent_background); |
| CopyQuadsToPass(source.quad_list, source.shared_quad_state_list, |
| @@ -593,6 +595,20 @@ gfx::Rect SurfaceAggregator::PrewalkTree(const SurfaceId& surface_id, |
| }; |
| std::vector<SurfaceInfo> child_surfaces; |
| + std::unordered_set<RenderPassId, RenderPassIdHash> pixel_moving_filter_passes; |
| + std::unordered_set<RenderPassId, RenderPassIdHash> |
| + pixel_moving_background_filter_passes; |
| + for (const auto& render_pass : frame.render_pass_list) { |
| + if (render_pass->filters.HasFilterThatMovesPixels()) { |
| + pixel_moving_filter_passes.insert( |
| + RemapPassId(render_pass->id, surface_id)); |
|
jbauman
2016/12/07 01:15:47
I don't think you need this - I think you can just
ajuma
2016/12/13 15:08:11
Done.
|
| + } |
| + if (render_pass->background_filters.HasFilterThatMovesPixels()) { |
| + pixel_moving_background_filter_passes.insert( |
| + RemapPassId(render_pass->id, surface_id)); |
| + } |
| + } |
| + |
| for (const auto& render_pass : base::Reversed(frame.render_pass_list)) { |
| RenderPassId remapped_pass_id = RemapPassId(render_pass->id, surface_id); |
| bool in_moved_pixel_pass = !!moved_pixel_passes_.count(remapped_pass_id); |
|
danakj
2016/12/01 01:50:46
This variable shadows the outer one with same name
ajuma
2016/12/13 15:08:11
Renamed the outer one to |in_moved_pixel_surface|.
|
| @@ -610,11 +626,13 @@ gfx::Rect SurfaceAggregator::PrewalkTree(const SurfaceId& surface_id, |
| const RenderPassDrawQuad* render_pass_quad = |
| RenderPassDrawQuad::MaterialCast(quad); |
| if (in_moved_pixel_pass || |
| - render_pass_quad->filters.HasFilterThatMovesPixels()) { |
| + pixel_moving_filter_passes.count( |
|
danakj
2016/12/01 01:50:46
I think this bit doesn't need to be in per-quad co
ajuma
2016/12/13 15:08:11
Done.
|
| + render_pass_quad->render_pass_id)) { |
| moved_pixel_passes_.insert( |
| RemapPassId(render_pass_quad->render_pass_id, surface_id)); |
| } |
| - if (render_pass_quad->background_filters.HasFilterThatMovesPixels()) { |
| + if (pixel_moving_background_filter_passes.count( |
| + render_pass_quad->render_pass_id)) { |
| in_moved_pixel_pass = true; |
| } |
| render_pass_dependencies_[remapped_pass_id].insert( |