| 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_impl_task_runner_provider.h" | 8 #include "cc/test/fake_impl_task_runner_provider.h" |
| 9 #include "cc/test/fake_layer_tree_host_impl.h" | 9 #include "cc/test/fake_layer_tree_host_impl.h" |
| 10 #include "cc/test/fake_output_surface.h" | 10 #include "cc/test/fake_output_surface.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 using cc::FakeOutputSurface; | 26 using cc::FakeOutputSurface; |
| 27 using cc::LayerImpl; | 27 using cc::LayerImpl; |
| 28 using cc::LayerTreeSettings; | 28 using cc::LayerTreeSettings; |
| 29 using cc::OutputSurface; | 29 using cc::OutputSurface; |
| 30 using cc::TestTaskGraphRunner; | 30 using cc::TestTaskGraphRunner; |
| 31 using cc::TestSharedBitmapManager; | 31 using cc::TestSharedBitmapManager; |
| 32 | 32 |
| 33 class CompositorMutableStateTest : public testing::Test { | 33 class CompositorMutableStateTest : public testing::Test { |
| 34 public: | 34 public: |
| 35 CompositorMutableStateTest() | 35 CompositorMutableStateTest() |
| 36 : m_outputSurface(FakeOutputSurface::Create3d()) | 36 : m_outputSurface(FakeOutputSurface::CreateDelegating3d()) |
| 37 { | 37 { |
| 38 LayerTreeSettings settings; | 38 LayerTreeSettings settings; |
| 39 settings.layer_transforms_should_scale_layer_contents = true; | 39 settings.layer_transforms_should_scale_layer_contents = true; |
| 40 m_hostImpl.reset(new FakeLayerTreeHostImpl(settings, &m_taskRunnerProvid
er, &m_sharedBitmapManager, &m_taskGraphRunner)); | 40 m_hostImpl.reset(new FakeLayerTreeHostImpl(settings, &m_taskRunnerProvid
er, &m_sharedBitmapManager, &m_taskGraphRunner)); |
| 41 m_hostImpl->SetVisible(true); | 41 m_hostImpl->SetVisible(true); |
| 42 EXPECT_TRUE(m_hostImpl->InitializeRenderer(m_outputSurface.get())); | 42 EXPECT_TRUE(m_hostImpl->InitializeRenderer(m_outputSurface.get())); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void SetLayerPropertiesForTesting(LayerImpl* layer) | 45 void SetLayerPropertiesForTesting(LayerImpl* layer) |
| 46 { | 46 { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 EXPECT_TRUE(mutation.isScrollLeftMutated()); | 142 EXPECT_TRUE(mutation.isScrollLeftMutated()); |
| 143 EXPECT_TRUE(mutation.isScrollTopMutated()); | 143 EXPECT_TRUE(mutation.isScrollTopMutated()); |
| 144 | 144 |
| 145 EXPECT_EQ(0.5, mutation.opacity()); | 145 EXPECT_EQ(0.5, mutation.opacity()); |
| 146 EXPECT_EQ(zero.ToString(), gfx::Transform(mutation.transform()).ToString()); | 146 EXPECT_EQ(zero.ToString(), gfx::Transform(mutation.transform()).ToString()); |
| 147 EXPECT_EQ(1.0, mutation.scrollLeft()); | 147 EXPECT_EQ(1.0, mutation.scrollLeft()); |
| 148 EXPECT_EQ(1.0, mutation.scrollTop()); | 148 EXPECT_EQ(1.0, mutation.scrollTop()); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace blink | 151 } // namespace blink |
| OLD | NEW |