| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/solid_color_layer_impl.h" | 5 #include "cc/layers/solid_color_layer_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
| 10 #include "cc/layers/solid_color_layer.h" | 10 #include "cc/layers/solid_color_layer.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 layer->SetForceRenderSurface(true); | 113 layer->SetForceRenderSurface(true); |
| 114 | 114 |
| 115 scoped_refptr<Layer> root = Layer::Create(); | 115 scoped_refptr<Layer> root = Layer::Create(); |
| 116 root->AddChild(layer); | 116 root->AddChild(layer); |
| 117 | 117 |
| 118 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 118 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); |
| 119 host->SetRootLayer(root); | 119 host->SetRootLayer(root); |
| 120 | 120 |
| 121 RenderSurfaceLayerList render_surface_layer_list; | 121 RenderSurfaceLayerList render_surface_layer_list; |
| 122 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 122 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 123 root, gfx::Size(500, 500), &render_surface_layer_list); | 123 root.get(), gfx::Size(500, 500), &render_surface_layer_list); |
| 124 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 124 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| 125 | 125 |
| 126 EXPECT_FALSE(layer->contents_opaque()); | 126 EXPECT_FALSE(layer->contents_opaque()); |
| 127 layer->SetBackgroundColor(SkColorSetARGBInline(255, 10, 20, 30)); | 127 layer->SetBackgroundColor(SkColorSetARGBInline(255, 10, 20, 30)); |
| 128 EXPECT_TRUE(layer->contents_opaque()); | 128 EXPECT_TRUE(layer->contents_opaque()); |
| 129 { | 129 { |
| 130 scoped_ptr<SolidColorLayerImpl> layer_impl = | 130 scoped_ptr<SolidColorLayerImpl> layer_impl = |
| 131 SolidColorLayerImpl::Create(host->host_impl()->active_tree(), | 131 SolidColorLayerImpl::Create(host->host_impl()->active_tree(), |
| 132 layer->id()); | 132 layer->id()); |
| 133 layer->PushPropertiesTo(layer_impl.get()); | 133 layer->PushPropertiesTo(layer_impl.get()); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 occluded, | 224 occluded, |
| 225 &partially_occluded_count); | 225 &partially_occluded_count); |
| 226 // 4 quads are completely occluded, 8 are partially occluded. | 226 // 4 quads are completely occluded, 8 are partially occluded. |
| 227 EXPECT_EQ(16u - 4u, impl.quad_list().size()); | 227 EXPECT_EQ(16u - 4u, impl.quad_list().size()); |
| 228 EXPECT_EQ(8u, partially_occluded_count); | 228 EXPECT_EQ(8u, partially_occluded_count); |
| 229 } | 229 } |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace | 232 } // namespace |
| 233 } // namespace cc | 233 } // namespace cc |
| OLD | NEW |