Chromium Code Reviews| 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/ui_resource_layer.h" | 5 #include "cc/layers/ui_resource_layer.h" |
| 6 | 6 |
| 7 #include "cc/resources/prioritized_resource_manager.h" | 7 #include "cc/resources/prioritized_resource_manager.h" |
| 8 #include "cc/resources/resource_provider.h" | 8 #include "cc/resources/resource_provider.h" |
| 9 #include "cc/resources/resource_update_queue.h" | 9 #include "cc/resources/resource_update_queue.h" |
| 10 #include "cc/resources/scoped_ui_resource.h" | 10 #include "cc/resources/scoped_ui_resource.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 | 95 |
| 96 bool is_opaque = false; | 96 bool is_opaque = false; |
| 97 scoped_ptr<ScopedUIResource> resource = ScopedUIResource::Create( | 97 scoped_ptr<ScopedUIResource> resource = ScopedUIResource::Create( |
| 98 layer_tree_host_.get(), UIResourceBitmap(gfx::Size(10, 10), is_opaque)); | 98 layer_tree_host_.get(), UIResourceBitmap(gfx::Size(10, 10), is_opaque)); |
| 99 test_layer->SetUIResourceId(resource->id()); | 99 test_layer->SetUIResourceId(resource->id()); |
| 100 test_layer->Update(&queue, &occlusion_tracker); | 100 test_layer->Update(&queue, &occlusion_tracker); |
| 101 | 101 |
| 102 EXPECT_TRUE(test_layer->DrawsContent()); | 102 EXPECT_TRUE(test_layer->DrawsContent()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 TEST_F(UIResourceLayerTest, SetUIResourceIdOrdering) { | |
| 106 scoped_refptr<Layer> test_root = Layer::Create(); | |
| 107 layer_tree_host_->SetRootLayer(test_root); | |
| 108 | |
| 109 scoped_refptr<UIResourceLayer> test_layer = UIResourceLayer::Create(); | |
| 110 ASSERT_TRUE(test_layer.get()); | |
| 111 test_layer->SetIsDrawable(true); | |
| 112 test_layer->SetBounds(gfx::Size(100, 100)); | |
| 113 | |
| 114 bool is_opaque = false; | |
| 115 scoped_ptr<ScopedUIResource> resource = ScopedUIResource::Create( | |
| 116 layer_tree_host_.get(), UIResourceBitmap(gfx::Size(10, 10), is_opaque)); | |
| 117 test_layer->SetUIResourceId(resource->id()); | |
| 118 | |
| 119 EXPECT_TRUE(test_layer->DrawsContent()); | |
| 120 test_root->AddChild(test_layer); | |
| 121 EXPECT_FALSE(test_layer->DrawsContent()); | |
|
danakj
2014/08/14 22:00:14
Can you do this test with a test-only override of
| |
| 122 } | |
| 123 | |
| 105 } // namespace | 124 } // namespace |
| 106 } // namespace cc | 125 } // namespace cc |
| OLD | NEW |