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 "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "cc/layers/content_layer_client.h" | 8 #include "cc/layers/content_layer_client.h" |
9 #include "cc/layers/picture_layer_impl.h" | 9 #include "cc/layers/picture_layer_impl.h" |
10 #include "cc/playback/display_item_list_settings.h" | 10 #include "cc/playback/display_item_list_settings.h" |
11 #include "cc/test/fake_display_list_recording_source.h" | 11 #include "cc/test/fake_display_list_recording_source.h" |
12 #include "cc/test/fake_layer_tree_host.h" | 12 #include "cc/test/fake_layer_tree_host.h" |
13 #include "cc/test/fake_picture_layer.h" | 13 #include "cc/test/fake_picture_layer.h" |
14 #include "cc/test/fake_picture_layer_impl.h" | 14 #include "cc/test/fake_picture_layer_impl.h" |
15 #include "cc/test/fake_proxy.h" | 15 #include "cc/test/fake_proxy.h" |
16 #include "cc/test/test_shared_bitmap_manager.h" | 16 #include "cc/test/test_shared_bitmap_manager.h" |
17 #include "cc/test/test_task_graph_runner.h" | 17 #include "cc/test/test_task_graph_runner.h" |
18 #include "cc/trees/single_thread_proxy.h" | 18 #include "cc/trees/single_thread_proxy.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 | 20 |
21 namespace cc { | 21 namespace cc { |
22 namespace { | 22 namespace { |
23 | 23 |
24 class MockContentLayerClient : public ContentLayerClient { | 24 class MockContentLayerClient : public ContentLayerClient { |
25 public: | 25 public: |
| 26 gfx::Rect PaintableRegion() override { return gfx::Rect(); } |
26 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( | 27 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( |
27 const gfx::Rect& clip, | 28 const gfx::Rect& clip, |
28 PaintingControlSetting picture_control) override { | 29 PaintingControlSetting picture_control) override { |
29 return DisplayItemList::Create(clip, DisplayItemListSettings()); | 30 return DisplayItemList::Create(clip, DisplayItemListSettings()); |
30 } | 31 } |
31 bool FillsBoundsCompletely() const override { return false; }; | 32 bool FillsBoundsCompletely() const override { return false; }; |
32 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } | 33 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } |
33 }; | 34 }; |
34 | 35 |
35 TEST(PictureLayerTest, NoTilesIfEmptyBounds) { | 36 TEST(PictureLayerTest, NoTilesIfEmptyBounds) { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // Do a main frame, record the picture layers. The frame number has changed | 166 // Do a main frame, record the picture layers. The frame number has changed |
166 // non-monotonically. | 167 // non-monotonically. |
167 layer->SetNeedsDisplay(); | 168 layer->SetNeedsDisplay(); |
168 host2->Composite(base::TimeTicks::Now()); | 169 host2->Composite(base::TimeTicks::Now()); |
169 EXPECT_EQ(3, layer->update_count()); | 170 EXPECT_EQ(3, layer->update_count()); |
170 EXPECT_EQ(1, host2->source_frame_number()); | 171 EXPECT_EQ(1, host2->source_frame_number()); |
171 } | 172 } |
172 | 173 |
173 } // namespace | 174 } // namespace |
174 } // namespace cc | 175 } // namespace cc |
OLD | NEW |