Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3145)

Unified Diff: cc/trees/layer_tree_impl_unittest.cc

Issue 2254623002: [compositor-worker] Create property tree nodes for proxies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Attempt to appease MSVC. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/mutable_properties.h ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl_unittest.cc
diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc
index bb931cf9231094972ff7da1f61e330e91f16d15c..c7da8f24b43472b81198178a1dca9e0d1712b4ef 100644
--- a/cc/trees/layer_tree_impl_unittest.cc
+++ b/cc/trees/layer_tree_impl_unittest.cc
@@ -4,6 +4,8 @@
#include "cc/trees/layer_tree_impl.h"
+#include "base/macros.h"
+#include "cc/animation/mutable_properties.h"
#include "cc/layers/heads_up_display_layer_impl.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/geometry_test_utils.h"
@@ -2016,6 +2018,52 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) {
EXPECT_TRUE(output.start.visible());
}
+TEST_F(LayerTreeImplTest, NodesiesForProxies) {
+ LayerImpl* root = root_layer();
+ root->SetDrawsContent(true);
+ root->SetBounds(gfx::Size(100, 100));
+
+ uint32_t properties[] = {
+ MutableProperty::kOpacity, MutableProperty::kScrollLeft,
+ MutableProperty::kScrollTop, MutableProperty::kTransform,
+ };
+
+ for (size_t i = 0; i < arraysize(properties); ++i) {
+ int sub_layer_id = i + 2;
+ std::unique_ptr<LayerImpl> sub_layer =
+ LayerImpl::Create(host_impl().active_tree(), sub_layer_id);
+ sub_layer->SetBounds(gfx::Size(50, 50));
+ sub_layer->SetDrawsContent(true);
+ sub_layer->SetMutableProperties(properties[i]);
+ root->test_properties()->AddChild(std::move(sub_layer));
+ }
+
+ host_impl().active_tree()->BuildPropertyTreesForTesting();
+
+ for (size_t i = 0; i < arraysize(properties); ++i) {
+ LayerImpl* layer = host_impl().active_tree()->LayerById(i + 2);
+ switch (properties[i]) {
+ case MutableProperty::kOpacity:
+ DCHECK_EQ(root->transform_tree_index(), layer->transform_tree_index());
+ DCHECK_NE(root->effect_tree_index(), layer->effect_tree_index());
+ break;
+ case MutableProperty::kScrollLeft:
+ case MutableProperty::kScrollTop:
+ case MutableProperty::kTransform:
+ DCHECK_EQ(root->effect_tree_index(), layer->effect_tree_index());
+ DCHECK_NE(root->transform_tree_index(), layer->transform_tree_index());
+ for (size_t j = 0; j < arraysize(properties); ++j) {
+ if (j == i)
+ continue;
+ LayerImpl* other = host_impl().active_tree()->LayerById(j + 2);
+ DCHECK_NE(other->transform_tree_index(),
+ layer->transform_tree_index());
+ }
+ break;
+ }
+ }
+}
+
TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) {
LayerImpl* root = root_layer();
root->SetDrawsContent(true);
« no previous file with comments | « cc/animation/mutable_properties.h ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698