| 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 17 matching lines...) Expand all Loading... |
| 28 TEST(PictureLayerTest, NoTilesIfEmptyBounds) { | 28 TEST(PictureLayerTest, NoTilesIfEmptyBounds) { |
| 29 MockContentLayerClient client; | 29 MockContentLayerClient client; |
| 30 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); | 30 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); |
| 31 layer->SetBounds(gfx::Size(10, 10)); | 31 layer->SetBounds(gfx::Size(10, 10)); |
| 32 | 32 |
| 33 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 33 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); |
| 34 host->SetRootLayer(layer); | 34 host->SetRootLayer(layer); |
| 35 layer->SetIsDrawable(true); | 35 layer->SetIsDrawable(true); |
| 36 layer->SavePaintProperties(); | 36 layer->SavePaintProperties(); |
| 37 | 37 |
| 38 OcclusionTracker occlusion(gfx::Rect(0, 0, 1000, 1000), false); | 38 OcclusionTracker<Layer> occlusion(gfx::Rect(0, 0, 1000, 1000), false); |
| 39 scoped_ptr<ResourceUpdateQueue> queue(new ResourceUpdateQueue); | 39 scoped_ptr<ResourceUpdateQueue> queue(new ResourceUpdateQueue); |
| 40 layer->Update(queue.get(), &occlusion); | 40 layer->Update(queue.get(), &occlusion); |
| 41 | 41 |
| 42 layer->SetBounds(gfx::Size(0, 0)); | 42 layer->SetBounds(gfx::Size(0, 0)); |
| 43 layer->SavePaintProperties(); | 43 layer->SavePaintProperties(); |
| 44 // Intentionally skipping Update since it would normally be skipped on | 44 // Intentionally skipping Update since it would normally be skipped on |
| 45 // a layer with empty bounds. | 45 // a layer with empty bounds. |
| 46 | 46 |
| 47 FakeProxy proxy; | 47 FakeProxy proxy; |
| 48 #ifndef NDEBUG | 48 #ifndef NDEBUG |
| (...skipping 11 matching lines...) Expand all Loading... |
| 60 EXPECT_TRUE(layer_impl->pile()->size() == gfx::Size(0, 0)); | 60 EXPECT_TRUE(layer_impl->pile()->size() == gfx::Size(0, 0)); |
| 61 EXPECT_TRUE(layer_impl->pile()->recorded_region().IsEmpty()); | 61 EXPECT_TRUE(layer_impl->pile()->recorded_region().IsEmpty()); |
| 62 } | 62 } |
| 63 #ifndef NDEBUG | 63 #ifndef NDEBUG |
| 64 proxy.SetCurrentThreadIsImplThread(false); | 64 proxy.SetCurrentThreadIsImplThread(false); |
| 65 #endif | 65 #endif |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace | 68 } // namespace |
| 69 } // namespace cc | 69 } // namespace cc |
| OLD | NEW |