Split preserve3d into: "should-flatten" and "is-3d-sorted"
Preserve3d has implications for both sorting and flattening of
transforms. This is a bummer. Sometimes we want to allow a transform to
remain unflattened, but we don't want that to affect 3d sorting. With
this CL, we will have the ability to do that.
Note: this is essentially this cl
https://codereview.chromium.org/100393005/
..minus the generalizations to sorting that were being attempted in that
patch.
Note, this CL is gated on https://codereview.chromium.org/98373011/
[email protected]
BUG=338980
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=249974
Review URL: https://codereview.chromium.org/147833003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250474 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc
index 9c6fa45..59261f3 100644
--- a/cc/trees/occlusion_tracker_unittest.cc
+++ b/cc/trees/occlusion_tracker_unittest.cc
@@ -1962,7 +1962,10 @@
gfx::PointF(50.f, 50.f),
gfx::Size(100, 100),
true);
- parent->SetPreserves3d(true);
+ parent->SetShouldFlattenTransform(false);
+ parent->SetIs3dSorted(true);
+ child1->SetIs3dSorted(true);
+ child2->SetIs3dSorted(true);
this->CalcDrawEtc(parent);
@@ -2006,8 +2009,11 @@
gfx::PointF(100.f, 100.f),
gfx::Size(200, 200),
true);
- container->SetPreserves3d(true);
- layer->SetPreserves3d(true);
+ container->SetShouldFlattenTransform(false);
+ container->SetIs3dSorted(true);
+ layer->SetIs3dSorted(true);
+ layer->SetShouldFlattenTransform(false);
+
this->CalcDrawEtc(parent);
TestOcclusionTrackerWithClip<typename Types::LayerType,
@@ -2025,7 +2031,6 @@
// the occlusion tracker on the main thread. So this test should run on the impl
// thread.
IMPL_THREAD_TEST(OcclusionTrackerTestPerspectiveTransform);
-
template <class Types>
class OcclusionTrackerTestPerspectiveTransformBehindCamera
: public OcclusionTrackerTest<Types> {
@@ -2050,8 +2055,10 @@
parent, this->identity_matrix, gfx::PointF(), gfx::Size(500, 500));
typename Types::ContentLayerType* layer = this->CreateDrawingLayer(
container, transform, gfx::PointF(), gfx::Size(500, 500), true);
- container->SetPreserves3d(true);
- layer->SetPreserves3d(true);
+ container->SetShouldFlattenTransform(false);
+ container->SetIs3dSorted(true);
+ layer->SetShouldFlattenTransform(false);
+ layer->SetIs3dSorted(true);
this->CalcDrawEtc(parent);
TestOcclusionTrackerWithClip<typename Types::LayerType,
@@ -2092,8 +2099,10 @@
this->identity_matrix, gfx::PointF(), gfx::Size(100, 100));
typename Types::ContentLayerType* layer = this->CreateDrawingLayer(
parent, transform, gfx::PointF(), gfx::Size(100, 100), true);
- parent->SetPreserves3d(true);
- layer->SetPreserves3d(true);
+ parent->SetShouldFlattenTransform(false);
+ parent->SetIs3dSorted(true);
+ layer->SetShouldFlattenTransform(false);
+ layer->SetIs3dSorted(true);
this->CalcDrawEtc(parent);
TestOcclusionTrackerWithClip<typename Types::LayerType,
@@ -2132,8 +2141,10 @@
parent->SetMasksToBounds(true);
typename Types::ContentLayerType* layer = this->CreateDrawingLayer(
parent, transform, gfx::PointF(), gfx::Size(100, 100), true);
- parent->SetPreserves3d(true);
- layer->SetPreserves3d(true);
+ parent->SetShouldFlattenTransform(false);
+ parent->SetIs3dSorted(true);
+ layer->SetShouldFlattenTransform(false);
+ layer->SetIs3dSorted(true);
this->CalcDrawEtc(parent);
TestOcclusionTrackerWithClip<typename Types::LayerType,