OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/layer.h" | 5 #include "cc/layer.h" |
6 | 6 |
7 #include "cc/keyframed_animation_curve.h" | 7 #include "cc/keyframed_animation_curve.h" |
8 #include "cc/layer_impl.h" | 8 #include "cc/layer_impl.h" |
9 #include "cc/layer_painter.h" | 9 #include "cc/layer_painter.h" |
10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 public: | 611 public: |
612 static scoped_ptr<FakeLayerImplTreeHost> create() | 612 static scoped_ptr<FakeLayerImplTreeHost> create() |
613 { | 613 { |
614 scoped_ptr<FakeLayerImplTreeHost> host(new FakeLayerImplTreeHost(LayerTr
eeSettings())); | 614 scoped_ptr<FakeLayerImplTreeHost> host(new FakeLayerImplTreeHost(LayerTr
eeSettings())); |
615 // The initialize call will fail, since our client doesn't provide a val
id GraphicsContext3D, but it doesn't matter in the tests that use this fake so i
gnore the return value. | 615 // The initialize call will fail, since our client doesn't provide a val
id GraphicsContext3D, but it doesn't matter in the tests that use this fake so i
gnore the return value. |
616 host->initialize(scoped_ptr<Thread>(NULL)); | 616 host->initialize(scoped_ptr<Thread>(NULL)); |
617 return host.Pass(); | 617 return host.Pass(); |
618 } | 618 } |
619 | 619 |
620 private: | 620 private: |
621 FakeLayerImplTreeHost(const LayerTreeSettings& settings) | 621 explicit FakeLayerImplTreeHost(const LayerTreeSettings& settings) |
622 : LayerTreeHost(&m_client, settings) | 622 : LayerTreeHost(&m_client, settings) |
623 { | 623 { |
624 } | 624 } |
625 | 625 |
626 FakeLayerImplTreeHostClient m_client; | 626 FakeLayerImplTreeHostClient m_client; |
627 }; | 627 }; |
628 | 628 |
629 void assertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) | 629 void assertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) |
630 { | 630 { |
631 EXPECT_EQ(host, layer->layerTreeHost()); | 631 EXPECT_EQ(host, layer->layerTreeHost()); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 scoped_refptr<MockLayer> layer(new MockLayer); | 854 scoped_refptr<MockLayer> layer(new MockLayer); |
855 EXPECT_FALSE(layer->needsDisplay()); | 855 EXPECT_FALSE(layer->needsDisplay()); |
856 layer->setBounds(gfx::Size(0, 10)); | 856 layer->setBounds(gfx::Size(0, 10)); |
857 EXPECT_FALSE(layer->needsDisplay()); | 857 EXPECT_FALSE(layer->needsDisplay()); |
858 layer->setBounds(gfx::Size(10, 10)); | 858 layer->setBounds(gfx::Size(10, 10)); |
859 EXPECT_TRUE(layer->needsDisplay()); | 859 EXPECT_TRUE(layer->needsDisplay()); |
860 } | 860 } |
861 | 861 |
862 } // namespace | 862 } // namespace |
863 } // namespace cc | 863 } // namespace cc |
OLD | NEW |