| Index: cc/trees/occlusion_tracker.cc
|
| diff --git a/cc/trees/occlusion_tracker.cc b/cc/trees/occlusion_tracker.cc
|
| index 2cc2b168a05d11aadf6b2e3ecc74be9d2c770c97..fe5b0a355e7d0e6ebb0e7535d4a4450b7b9a6ea7 100644
|
| --- a/cc/trees/occlusion_tracker.cc
|
| +++ b/cc/trees/occlusion_tracker.cc
|
| @@ -191,25 +191,23 @@ void OcclusionTracker::FinishedRenderTarget(const LayerImpl* finished_target) {
|
| }
|
|
|
| static void ReduceOcclusionBelowSurface(
|
| - const LayerImpl* contributing_layer,
|
| + const RenderSurfaceImpl* contributing_surface,
|
| const gfx::Rect& surface_rect,
|
| const gfx::Transform& surface_transform,
|
| - const LayerImpl* render_target,
|
| SimpleEnclosedRegion* occlusion_from_inside_target) {
|
| if (surface_rect.IsEmpty())
|
| return;
|
|
|
| gfx::Rect affected_area_in_target =
|
| MathUtil::MapEnclosingClippedRect(surface_transform, surface_rect);
|
| - if (contributing_layer->render_surface()->is_clipped()) {
|
| - affected_area_in_target.Intersect(
|
| - contributing_layer->render_surface()->clip_rect());
|
| + if (contributing_surface->is_clipped()) {
|
| + affected_area_in_target.Intersect(contributing_surface->clip_rect());
|
| }
|
| if (affected_area_in_target.IsEmpty())
|
| return;
|
|
|
| int outset_top, outset_right, outset_bottom, outset_left;
|
| - contributing_layer->background_filters().GetOutsets(
|
| + contributing_surface->BackgroundFilters().GetOutsets(
|
| &outset_top, &outset_right, &outset_bottom, &outset_left);
|
|
|
| // The filter can move pixels from outside of the clip, so allow affected_area
|
| @@ -257,8 +255,6 @@ void OcclusionTracker::LeaveToRenderTarget(const LayerImpl* new_target) {
|
| // merged out as well but needs to be transformed to the new target.
|
|
|
| const RenderSurfaceImpl* old_surface = stack_[last_index].target;
|
| - const LayerImpl* old_target =
|
| - new_target->layer_tree_impl()->LayerById(old_surface->OwningLayerId());
|
|
|
| SimpleEnclosedRegion old_occlusion_from_inside_target_in_new_target =
|
| TransformSurfaceOpaqueRegion(
|
| @@ -280,7 +276,7 @@ void OcclusionTracker::LeaveToRenderTarget(const LayerImpl* new_target) {
|
|
|
| gfx::Rect unoccluded_surface_rect;
|
| gfx::Rect unoccluded_replica_rect;
|
| - if (old_target->background_filters().HasFilterThatMovesPixels()) {
|
| + if (old_surface->BackgroundFilters().HasFilterThatMovesPixels()) {
|
| Occlusion surface_occlusion = GetCurrentOcclusionForContributingSurface(
|
| old_surface->draw_transform());
|
| unoccluded_surface_rect =
|
| @@ -317,31 +313,23 @@ void OcclusionTracker::LeaveToRenderTarget(const LayerImpl* new_target) {
|
| }
|
| }
|
|
|
| - if (!old_target->background_filters().HasFilterThatMovesPixels())
|
| + if (!old_surface->BackgroundFilters().HasFilterThatMovesPixels())
|
| return;
|
|
|
| - ReduceOcclusionBelowSurface(old_target,
|
| - unoccluded_surface_rect,
|
| + ReduceOcclusionBelowSurface(old_surface, unoccluded_surface_rect,
|
| old_surface->draw_transform(),
|
| - new_target,
|
| &stack_.back().occlusion_from_inside_target);
|
| - ReduceOcclusionBelowSurface(old_target,
|
| - unoccluded_surface_rect,
|
| + ReduceOcclusionBelowSurface(old_surface, unoccluded_surface_rect,
|
| old_surface->draw_transform(),
|
| - new_target,
|
| &stack_.back().occlusion_from_outside_target);
|
|
|
| if (!old_surface->HasReplica())
|
| return;
|
| - ReduceOcclusionBelowSurface(old_target,
|
| - unoccluded_replica_rect,
|
| + ReduceOcclusionBelowSurface(old_surface, unoccluded_replica_rect,
|
| old_surface->replica_draw_transform(),
|
| - new_target,
|
| &stack_.back().occlusion_from_inside_target);
|
| - ReduceOcclusionBelowSurface(old_target,
|
| - unoccluded_replica_rect,
|
| + ReduceOcclusionBelowSurface(old_surface, unoccluded_replica_rect,
|
| old_surface->replica_draw_transform(),
|
| - new_target,
|
| &stack_.back().occlusion_from_outside_target);
|
| }
|
|
|
|
|