OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/picture_layer.h" | 5 #include "cc/layers/picture_layer.h" |
6 | 6 |
7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
8 #include "cc/layers/picture_layer_impl.h" | 8 #include "cc/layers/picture_layer_impl.h" |
9 #include "cc/resources/resource_update_queue.h" | 9 #include "cc/resources/resource_update_queue.h" |
10 #include "cc/test/fake_layer_tree_host.h" | 10 #include "cc/test/fake_layer_tree_host.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 TestSharedBitmapManager shared_bitmap_manager; | 57 TestSharedBitmapManager shared_bitmap_manager; |
58 FakeLayerTreeHostImpl host_impl( | 58 FakeLayerTreeHostImpl host_impl( |
59 ImplSidePaintingSettings(), &proxy, &shared_bitmap_manager); | 59 ImplSidePaintingSettings(), &proxy, &shared_bitmap_manager); |
60 host_impl.CreatePendingTree(); | 60 host_impl.CreatePendingTree(); |
61 scoped_ptr<FakePictureLayerImpl> layer_impl = | 61 scoped_ptr<FakePictureLayerImpl> layer_impl = |
62 FakePictureLayerImpl::Create(host_impl.pending_tree(), 1); | 62 FakePictureLayerImpl::Create(host_impl.pending_tree(), 1); |
63 | 63 |
64 layer->PushPropertiesTo(layer_impl.get()); | 64 layer->PushPropertiesTo(layer_impl.get()); |
65 EXPECT_FALSE(layer_impl->CanHaveTilings()); | 65 EXPECT_FALSE(layer_impl->CanHaveTilings()); |
66 EXPECT_TRUE(layer_impl->bounds() == gfx::Size(0, 0)); | 66 EXPECT_TRUE(layer_impl->bounds() == gfx::Size(0, 0)); |
67 EXPECT_TRUE(layer_impl->pile()->size() == gfx::Size(0, 0)); | 67 EXPECT_TRUE(layer_impl->pile()->tiling_rect() == gfx::Rect()); |
68 EXPECT_FALSE(layer_impl->pile()->HasRecordings()); | 68 EXPECT_FALSE(layer_impl->pile()->HasRecordings()); |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 TEST(PictureLayerTest, ForcedCpuRaster) { | 72 TEST(PictureLayerTest, ForcedCpuRaster) { |
73 MockContentLayerClient client; | 73 MockContentLayerClient client; |
74 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); | 74 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); |
75 | 75 |
76 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 76 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); |
77 host->SetRootLayer(layer); | 77 host->SetRootLayer(layer); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 // Veto gpu rasterization. | 146 // Veto gpu rasterization. |
147 PicturePile* pile = layer->GetPicturePileForTesting(); | 147 PicturePile* pile = layer->GetPicturePileForTesting(); |
148 EXPECT_TRUE(pile->is_suitable_for_gpu_rasterization()); | 148 EXPECT_TRUE(pile->is_suitable_for_gpu_rasterization()); |
149 pile->SetUnsuitableForGpuRasterizationForTesting(); | 149 pile->SetUnsuitableForGpuRasterizationForTesting(); |
150 EXPECT_FALSE(layer->ShouldUseGpuRasterization()); | 150 EXPECT_FALSE(layer->ShouldUseGpuRasterization()); |
151 } | 151 } |
152 | 152 |
153 } // namespace | 153 } // namespace |
154 } // namespace cc | 154 } // namespace cc |
OLD | NEW |