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 25 matching lines...) Expand all Loading... |
36 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); | 36 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); |
37 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); | 37 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); |
38 host->SetRootLayer(layer); | 38 host->SetRootLayer(layer); |
39 layer->SetIsDrawable(true); | 39 layer->SetIsDrawable(true); |
40 layer->SavePaintProperties(); | 40 layer->SavePaintProperties(); |
41 | 41 |
42 OcclusionTracker<Layer> occlusion(gfx::Rect(0, 0, 1000, 1000)); | 42 OcclusionTracker<Layer> occlusion(gfx::Rect(0, 0, 1000, 1000)); |
43 scoped_ptr<ResourceUpdateQueue> queue(new ResourceUpdateQueue); | 43 scoped_ptr<ResourceUpdateQueue> queue(new ResourceUpdateQueue); |
44 layer->Update(queue.get(), &occlusion); | 44 layer->Update(queue.get(), &occlusion); |
45 | 45 |
| 46 EXPECT_EQ(0, host->source_frame_number()); |
| 47 host->CommitComplete(); |
| 48 EXPECT_EQ(1, host->source_frame_number()); |
| 49 |
46 layer->SetBounds(gfx::Size(0, 0)); | 50 layer->SetBounds(gfx::Size(0, 0)); |
47 layer->SavePaintProperties(); | 51 layer->SavePaintProperties(); |
48 // Intentionally skipping Update since it would normally be skipped on | 52 // Intentionally skipping Update since it would normally be skipped on |
49 // a layer with empty bounds. | 53 // a layer with empty bounds. |
50 | 54 |
51 FakeProxy proxy; | 55 FakeProxy proxy; |
52 { | 56 { |
53 DebugScopedSetImplThread impl_thread(&proxy); | 57 DebugScopedSetImplThread impl_thread(&proxy); |
54 | 58 |
55 TestSharedBitmapManager shared_bitmap_manager; | 59 TestSharedBitmapManager shared_bitmap_manager; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 99 |
96 // Tile-grid is set according to its setting. | 100 // Tile-grid is set according to its setting. |
97 SkTileGridFactory::TileGridInfo info = | 101 SkTileGridFactory::TileGridInfo info = |
98 layer->GetPicturePileForTesting()->GetTileGridInfoForTesting(); | 102 layer->GetPicturePileForTesting()->GetTileGridInfoForTesting(); |
99 EXPECT_EQ(info.fTileInterval.width(), 123 - 2 * info.fMargin.width()); | 103 EXPECT_EQ(info.fTileInterval.width(), 123 - 2 * info.fMargin.width()); |
100 EXPECT_EQ(info.fTileInterval.height(), 123 - 2 * info.fMargin.height()); | 104 EXPECT_EQ(info.fTileInterval.height(), 123 - 2 * info.fMargin.height()); |
101 } | 105 } |
102 | 106 |
103 } // namespace | 107 } // namespace |
104 } // namespace cc | 108 } // namespace cc |
OLD | NEW |