| Index: cc/trees/layer_tree_host_impl.cc
|
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
|
| index 3c4bb306dfb03f97d06cd67a23ad734995ede71f..96f4d292d9156df866680e5a0887ad9c08a85c40 100644
|
| --- a/cc/trees/layer_tree_host_impl.cc
|
| +++ b/cc/trees/layer_tree_host_impl.cc
|
| @@ -606,21 +606,42 @@ static void AppendQuadsForRenderSurfaceLayer(
|
| const RenderPass* contributing_render_pass,
|
| const OcclusionTracker<LayerImpl>& occlusion_tracker,
|
| AppendQuadsData* append_quads_data) {
|
| - bool is_replica = false;
|
| - layer->render_surface()->AppendQuads(target_render_pass,
|
| - occlusion_tracker,
|
| - append_quads_data,
|
| - is_replica,
|
| - contributing_render_pass->id);
|
| + RenderSurfaceImpl* surface = layer->render_surface();
|
| + const gfx::Transform& draw_transform = surface->draw_transform();
|
| + const Occlusion& occlusion =
|
| + occlusion_tracker.GetCurrentOcclusionForContributingSurface(
|
| + draw_transform);
|
| + SkColor debug_border_color = surface->GetDebugBorderColor();
|
| + float debug_border_width = surface->GetDebugBorderWidth();
|
| + LayerImpl* mask_layer = layer->mask_layer();
|
| +
|
| + surface->AppendQuads(target_render_pass, draw_transform, occlusion,
|
| + debug_border_color, debug_border_width, mask_layer,
|
| + append_quads_data, contributing_render_pass->id);
|
|
|
| // Add replica after the surface so that it appears below the surface.
|
| if (layer->has_replica()) {
|
| - is_replica = true;
|
| - layer->render_surface()->AppendQuads(target_render_pass,
|
| - occlusion_tracker,
|
| - append_quads_data,
|
| - is_replica,
|
| - contributing_render_pass->id);
|
| + const gfx::Transform& replica_draw_transform =
|
| + surface->replica_draw_transform();
|
| + const Occlusion& replica_occlusion =
|
| + occlusion_tracker.GetCurrentOcclusionForContributingSurface(
|
| + replica_draw_transform);
|
| + SkColor replica_debug_border_color = surface->GetReplicaDebugBorderColor();
|
| + float replica_debug_border_width = surface->GetReplicaDebugBorderWidth();
|
| + // TODO(danakj): By using the same RenderSurfaceImpl for both the
|
| + // content and its reflection, it's currently not possible to apply a
|
| + // separate mask to the reflection layer or correctly handle opacity in
|
| + // reflections (opacity must be applied after drawing both the layer and its
|
| + // reflection). The solution is to introduce yet another RenderSurfaceImpl
|
| + // to draw the layer and its reflection in. For now we only apply a separate
|
| + // reflection mask if the contents don't have a mask of their own.
|
| + LayerImpl* replica_mask_layer =
|
| + mask_layer ? mask_layer : layer->replica_layer()->mask_layer();
|
| +
|
| + surface->AppendQuads(target_render_pass, replica_draw_transform,
|
| + replica_occlusion, replica_debug_border_color,
|
| + replica_debug_border_width, replica_mask_layer,
|
| + append_quads_data, contributing_render_pass->id);
|
| }
|
| }
|
|
|
| @@ -742,15 +763,6 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
|
| occlusion_tracker.set_minimum_tracking_size(
|
| settings_.minimum_occlusion_tracking_size);
|
|
|
| - if (debug_state_.show_occluding_rects) {
|
| - occlusion_tracker.set_occluding_screen_space_rects_container(
|
| - &frame->occluding_screen_space_rects);
|
| - }
|
| - if (debug_state_.show_non_occluding_rects) {
|
| - occlusion_tracker.set_non_occluding_screen_space_rects_container(
|
| - &frame->non_occluding_screen_space_rects);
|
| - }
|
| -
|
| // Add quads to the Render passes in front-to-back order to allow for testing
|
| // occlusion and performing culling during the tree walk.
|
| typedef LayerIterator<LayerImpl> LayerIteratorType;
|
| @@ -1503,8 +1515,6 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
|
| active_tree_->root_layer(),
|
| active_tree_->hud_layer(),
|
| *frame->render_surface_layer_list,
|
| - frame->occluding_screen_space_rects,
|
| - frame->non_occluding_screen_space_rects,
|
| debug_state_);
|
| }
|
|
|
|
|