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

Unified Diff: third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp

Issue 2866733002: Remove owning_id from EffectNode and replace it by an opaque stable_id (Closed)
Patch Set: none Created 3 years, 7 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
Index: third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp b/third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp
index 7ff18f7a69b71c4420ca5fe40bff83294e3ec64a..eb9885feb7985b8696a3d52f47f0350e3695a91a 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp
@@ -4,12 +4,14 @@
#include "platform/graphics/CompositorMutableState.h"
+#include <memory>
#include "base/message_loop/message_loop.h"
#include "cc/test/fake_compositor_frame_sink.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_task_graph_runner.h"
+#include "cc/trees/effect_node.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "cc/trees/layer_tree_impl.h"
#include "platform/graphics/CompositorElementId.h"
@@ -17,7 +19,6 @@
#include "platform/graphics/CompositorMutableStateProvider.h"
#include "platform/graphics/CompositorMutation.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include <memory>
namespace blink {
@@ -83,6 +84,13 @@ TEST_F(CompositorMutableStateTest, NoMutableState) {
EXPECT_FALSE(state);
}
+float OpacityForLayer(LayerImpl* layer_impl) {
+ return layer_impl->layer_tree_impl()
+ ->property_trees()
+ ->effect_tree.Node(layer_impl->effect_tree_index())
+ ->opacity;
+}
+
TEST_F(CompositorMutableStateTest, MutableStateMutableProperties) {
// In this test, there is a layer with an element id and mutable properties.
// In this case, we should get a valid mutable state for this element id that
@@ -121,7 +129,7 @@ TEST_F(CompositorMutableStateTest, MutableStateMutableProperties) {
provider.GetMutableStateFor(primary_id));
EXPECT_TRUE(state.get());
- EXPECT_EQ(1.0, RootLayer()->Opacity());
+ EXPECT_EQ(1.0, OpacityForLayer(RootLayer()));
EXPECT_EQ(gfx::Transform().ToString(), RootLayer()->Transform().ToString());
EXPECT_EQ(0.0, layer->CurrentScrollOffset().x());
EXPECT_EQ(0.0, layer->CurrentScrollOffset().y());
@@ -132,7 +140,7 @@ TEST_F(CompositorMutableStateTest, MutableStateMutableProperties) {
state->SetScrollLeft(1.0);
state->SetScrollTop(1.0);
- EXPECT_EQ(0.5, RootLayer()->Opacity());
+ EXPECT_EQ(0.5, OpacityForLayer(RootLayer()));
EXPECT_EQ(zero.ToString(), RootLayer()->Transform().ToString());
EXPECT_EQ(1.0, layer->CurrentScrollOffset().x());
EXPECT_EQ(1.0, layer->CurrentScrollOffset().y());

Powered by Google App Engine
This is Rietveld 408576698