summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host_common.cc
diff options
context:
space:
mode:
authorjaydasika <jaydasika@chromium.org>2015-11-09 17:48:03 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-10 01:50:02 +0000
commit5aa88b8d81780575ce87eebe36ec3c11e103505c (patch)
tree6059a67208dc1d41f587ffbe99848df7ea37ab83 /cc/trees/layer_tree_host_common.cc
parent2a3f374c912c0ea77d488821d7b67b50a1fe84a7 (diff)
downloadchromium_src-5aa88b8d81780575ce87eebe36ec3c11e103505c.zip
chromium_src-5aa88b8d81780575ce87eebe36ec3c11e103505c.tar.gz
chromium_src-5aa88b8d81780575ce87eebe36ec3c11e103505c.tar.bz2
cc::Fix computation of surface backfacing-ness when using property trees
Property trees currently use the owning layer's draw transform to compute the render surface's backfacing-ness. This computation is flawed as the owning layer's draw transform computed using property trees has only the sublayer scale and not the transform to target. So, we should use the surface's draw transform instead. This change also fixes the unit test, LayerTreeHostCommonTest.DoNotIncludeBackfaceInvisibleSurfaces when we enable impl-thread property trees. BUG=551629 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1430353002 Cr-Commit-Position: refs/heads/master@{#358736}
Diffstat (limited to 'cc/trees/layer_tree_host_common.cc')
-rw-r--r--cc/trees/layer_tree_host_common.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 345182c..832f864 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -1776,13 +1776,16 @@ static void CalculateDrawPropertiesInternal(
DCHECK(layer->render_surface());
// Check back-face visibility before continuing with this surface and its
// subtree
+ RenderSurfaceImpl* render_surface = layer->render_surface();
if (!layer->double_sided() &&
IsSurfaceBackFaceVisible(layer, combined_transform)) {
+ gfx::Transform draw_transform = combined_transform;
+ draw_transform.Scale(1.0 / combined_transform_scales.x(),
+ 1.0 / combined_transform_scales.y());
+ render_surface->SetDrawTransform(draw_transform);
return;
}
- RenderSurfaceImpl* render_surface = layer->render_surface();
-
if (IsRootLayer(layer)) {
// The root layer's render surface size is predetermined and so the root
// layer can't directly support non-identity transforms. It should just
@@ -2494,12 +2497,6 @@ void CalculateRenderSurfaceLayerListInternal(
if (render_to_separate_surface) {
DCHECK(layer->render_surface());
- if (!layer->double_sided() &&
- IsSurfaceBackFaceVisible(layer, layer->draw_transform())) {
- layer->ClearRenderSurfaceLayerList();
- layer->draw_properties().render_target = nullptr;
- return;
- }
if (use_property_trees) {
RenderSurfaceDrawProperties draw_properties;
@@ -2520,6 +2517,14 @@ void CalculateRenderSurfaceLayerListInternal(
layer->render_surface()->SetClipRect(draw_properties.clip_rect);
}
+ if (!layer->double_sided() &&
+ IsSurfaceBackFaceVisible(layer,
+ layer->render_surface()->draw_transform())) {
+ layer->ClearRenderSurfaceLayerList();
+ layer->draw_properties().render_target = nullptr;
+ return;
+ }
+
if (IsRootLayer(layer)) {
// The root surface does not contribute to any other surface, it has no
// target.