summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/trees/layer_tree_host_impl.cc')
-rw-r--r--cc/trees/layer_tree_host_impl.cc45
1 files changed, 33 insertions, 12 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 86401a7..e3ca2ab 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);
}
}