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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Layer is suitable for gpu rasterization by default. | 77 // Layer is suitable for gpu rasterization by default. |
78 EXPECT_TRUE(pile->is_suitable_for_gpu_rasterization()); | 78 EXPECT_TRUE(pile->is_suitable_for_gpu_rasterization()); |
79 EXPECT_TRUE(layer->IsSuitableForGpuRasterization()); | 79 EXPECT_TRUE(layer->IsSuitableForGpuRasterization()); |
80 | 80 |
81 // Veto gpu rasterization. | 81 // Veto gpu rasterization. |
82 pile->SetUnsuitableForGpuRasterizationForTesting(); | 82 pile->SetUnsuitableForGpuRasterizationForTesting(); |
83 EXPECT_FALSE(pile->is_suitable_for_gpu_rasterization()); | 83 EXPECT_FALSE(pile->is_suitable_for_gpu_rasterization()); |
84 EXPECT_FALSE(layer->IsSuitableForGpuRasterization()); | 84 EXPECT_FALSE(layer->IsSuitableForGpuRasterization()); |
85 } | 85 } |
86 | 86 |
87 TEST(PictureLayerTest, RecordingModes) { | |
88 MockContentLayerClient client; | |
89 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); | |
90 | |
91 LayerTreeSettings settings; | |
92 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); | |
93 scoped_ptr<FakeLayerTreeHost> host = | |
94 FakeLayerTreeHost::Create(&host_client, settings); | |
95 host->SetRootLayer(layer); | |
96 EXPECT_EQ(Picture::RECORD_NORMALLY, layer->RecordingMode()); | |
97 | |
98 settings.recording_mode = LayerTreeSettings::RecordWithSkRecord; | |
99 host = FakeLayerTreeHost::Create(&host_client, settings); | |
100 host->SetRootLayer(layer); | |
101 EXPECT_EQ(Picture::RECORD_WITH_SKRECORD, layer->RecordingMode()); | |
102 } | |
103 | |
104 } // namespace | 87 } // namespace |
105 } // namespace cc | 88 } // namespace cc |
OLD | NEW |