| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/graphics/CompositorMutableState.h" | 5 #include "platform/graphics/CompositorMutableState.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "cc/test/fake_compositor_frame_sink.h" | 8 #include "cc/test/fake_compositor_frame_sink.h" |
| 9 #include "cc/test/fake_impl_task_runner_provider.h" | 9 #include "cc/test/fake_impl_task_runner_provider.h" |
| 10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 m_hostImpl.reset(new FakeLayerTreeHostImpl(settings, &m_taskRunnerProvider, | 38 m_hostImpl.reset(new FakeLayerTreeHostImpl(settings, &m_taskRunnerProvider, |
| 39 &m_taskGraphRunner)); | 39 &m_taskGraphRunner)); |
| 40 m_hostImpl->SetVisible(true); | 40 m_hostImpl->SetVisible(true); |
| 41 EXPECT_TRUE(m_hostImpl->InitializeRenderer(m_compositorFrameSink.get())); | 41 EXPECT_TRUE(m_hostImpl->InitializeRenderer(m_compositorFrameSink.get())); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void SetLayerPropertiesForTesting(LayerImpl* layer) { | 44 void SetLayerPropertiesForTesting(LayerImpl* layer) { |
| 45 layer->test_properties()->transform = gfx::Transform(); | 45 layer->test_properties()->transform = gfx::Transform(); |
| 46 layer->SetPosition(gfx::PointF()); | 46 layer->SetPosition(gfx::PointF()); |
| 47 layer->SetBounds(gfx::Size(100, 100)); | 47 layer->SetBounds(gfx::Size(100, 100)); |
| 48 layer->Set3dSortingContextId(0); | |
| 49 layer->SetDrawsContent(true); | 48 layer->SetDrawsContent(true); |
| 50 } | 49 } |
| 51 | 50 |
| 52 FakeLayerTreeHostImpl& hostImpl() { return *m_hostImpl; } | 51 FakeLayerTreeHostImpl& hostImpl() { return *m_hostImpl; } |
| 53 | 52 |
| 54 LayerImpl* rootLayer() { | 53 LayerImpl* rootLayer() { |
| 55 return m_hostImpl->active_tree()->root_layer_for_testing(); | 54 return m_hostImpl->active_tree()->root_layer_for_testing(); |
| 56 } | 55 } |
| 57 | 56 |
| 58 private: | 57 private: |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 EXPECT_TRUE(mutation.isScrollLeftMutated()); | 146 EXPECT_TRUE(mutation.isScrollLeftMutated()); |
| 148 EXPECT_TRUE(mutation.isScrollTopMutated()); | 147 EXPECT_TRUE(mutation.isScrollTopMutated()); |
| 149 | 148 |
| 150 EXPECT_EQ(0.5, mutation.opacity()); | 149 EXPECT_EQ(0.5, mutation.opacity()); |
| 151 EXPECT_EQ(zero.ToString(), gfx::Transform(mutation.transform()).ToString()); | 150 EXPECT_EQ(zero.ToString(), gfx::Transform(mutation.transform()).ToString()); |
| 152 EXPECT_EQ(1.0, mutation.scrollLeft()); | 151 EXPECT_EQ(1.0, mutation.scrollLeft()); |
| 153 EXPECT_EQ(1.0, mutation.scrollTop()); | 152 EXPECT_EQ(1.0, mutation.scrollTop()); |
| 154 } | 153 } |
| 155 | 154 |
| 156 } // namespace blink | 155 } // namespace blink |
| OLD | NEW |