Chromium Code Reviews| 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 30 matching lines...) Expand all Loading... | |
| 41 EXPECT_TRUE(m_hostImpl->InitializeRenderer(m_outputSurface.get())); | 41 EXPECT_TRUE(m_hostImpl->InitializeRenderer(m_outputSurface.get())); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void SetLayerPropertiesForTesting(LayerImpl* layer) | 44 void SetLayerPropertiesForTesting(LayerImpl* layer) |
| 45 { | 45 { |
| 46 layer->SetTransform(gfx::Transform()); | 46 layer->SetTransform(gfx::Transform()); |
| 47 layer->SetPosition(gfx::PointF()); | 47 layer->SetPosition(gfx::PointF()); |
| 48 layer->SetBounds(gfx::Size(100, 100)); | 48 layer->SetBounds(gfx::Size(100, 100)); |
| 49 layer->SetShouldFlattenTransform(true); | 49 layer->SetShouldFlattenTransform(true); |
| 50 layer->Set3dSortingContextId(0); | 50 layer->Set3dSortingContextId(0); |
| 51 layer->SetForceRenderSurface(true); | 51 layer->test_properties()->force_render_surface = true; |
|
ajuma
2016/04/21 23:59:14
I think this line can be deleted altogether.
jaydasika
2016/04/22 17:00:39
Done.
| |
| 52 layer->SetDrawsContent(true); | 52 layer->SetDrawsContent(true); |
| 53 } | 53 } |
| 54 | 54 |
| 55 FakeLayerTreeHostImpl& hostImpl() { return *m_hostImpl; } | 55 FakeLayerTreeHostImpl& hostImpl() { return *m_hostImpl; } |
| 56 | 56 |
| 57 LayerImpl* rootLayer() { return m_hostImpl->active_tree()->root_layer(); } | 57 LayerImpl* rootLayer() { return m_hostImpl->active_tree()->root_layer(); } |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // The cc testing machinery has fairly deep dependency on having a main | 60 // The cc testing machinery has fairly deep dependency on having a main |
| 61 // message loop (one example is the task runner provider). We construct one | 61 // message loop (one example is the task runner provider). We construct one |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 EXPECT_TRUE(mutation.isScrollLeftMutated()); | 159 EXPECT_TRUE(mutation.isScrollLeftMutated()); |
| 160 EXPECT_TRUE(mutation.isScrollTopMutated()); | 160 EXPECT_TRUE(mutation.isScrollTopMutated()); |
| 161 | 161 |
| 162 EXPECT_EQ(0.5, mutation.opacity()); | 162 EXPECT_EQ(0.5, mutation.opacity()); |
| 163 EXPECT_EQ(zero.ToString(), gfx::Transform(mutation.transform()).ToString()); | 163 EXPECT_EQ(zero.ToString(), gfx::Transform(mutation.transform()).ToString()); |
| 164 EXPECT_EQ(1.0, mutation.scrollLeft()); | 164 EXPECT_EQ(1.0, mutation.scrollLeft()); |
| 165 EXPECT_EQ(1.0, mutation.scrollTop()); | 165 EXPECT_EQ(1.0, mutation.scrollTop()); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace blink | 168 } // namespace blink |
| OLD | NEW |