| 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/layer.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "cc/debug/lap_timer.h" | 8 #include "cc/debug/lap_timer.h" |
| 9 #include "cc/layers/layer_settings.h" | 9 #include "cc/layers/layer_settings.h" |
| 10 #include "cc/test/fake_impl_task_runner_provider.h" | 10 #include "cc/test/fake_impl_task_runner_provider.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 scoped_refptr<Layer> test_layer = Layer::Create(LayerSettings()); | 60 scoped_refptr<Layer> test_layer = Layer::Create(LayerSettings()); |
| 61 scoped_ptr<LayerImpl> impl_layer = | 61 scoped_ptr<LayerImpl> impl_layer = |
| 62 LayerImpl::Create(host_impl_.active_tree(), 1); | 62 LayerImpl::Create(host_impl_.active_tree(), 1); |
| 63 | 63 |
| 64 layer_tree_host_->SetRootLayer(test_layer); | 64 layer_tree_host_->SetRootLayer(test_layer); |
| 65 | 65 |
| 66 float transform_origin_z = 0; | 66 float transform_origin_z = 0; |
| 67 bool scrollable = true; | 67 bool scrollable = true; |
| 68 bool contents_opaque = true; | 68 bool contents_opaque = true; |
| 69 bool double_sided = true; | 69 bool double_sided = true; |
| 70 bool hide_layer_and_subtree = true; | |
| 71 bool masks_to_bounds = true; | 70 bool masks_to_bounds = true; |
| 72 | 71 |
| 73 // Properties changed. | 72 // Properties changed. |
| 74 timer_.Reset(); | 73 timer_.Reset(); |
| 75 do { | 74 do { |
| 76 test_layer->SetNeedsDisplayRect(gfx::Rect(5, 5)); | 75 test_layer->SetNeedsDisplayRect(gfx::Rect(5, 5)); |
| 77 test_layer->SetTransformOrigin(gfx::Point3F(0.f, 0.f, transform_origin_z)); | 76 test_layer->SetTransformOrigin(gfx::Point3F(0.f, 0.f, transform_origin_z)); |
| 78 test_layer->SetContentsOpaque(contents_opaque); | 77 test_layer->SetContentsOpaque(contents_opaque); |
| 79 test_layer->SetDoubleSided(double_sided); | 78 test_layer->SetDoubleSided(double_sided); |
| 80 test_layer->SetHideLayerAndSubtree(hide_layer_and_subtree); | |
| 81 test_layer->SetMasksToBounds(masks_to_bounds); | 79 test_layer->SetMasksToBounds(masks_to_bounds); |
| 82 test_layer->SetScrollClipLayerId(scrollable ? test_layer->id() | 80 test_layer->SetScrollClipLayerId(scrollable ? test_layer->id() |
| 83 : Layer::INVALID_ID); | 81 : Layer::INVALID_ID); |
| 84 test_layer->PushPropertiesTo(impl_layer.get()); | 82 test_layer->PushPropertiesTo(impl_layer.get()); |
| 85 | 83 |
| 86 transform_origin_z += 0.01f; | 84 transform_origin_z += 0.01f; |
| 87 scrollable = !scrollable; | 85 scrollable = !scrollable; |
| 88 contents_opaque = !contents_opaque; | 86 contents_opaque = !contents_opaque; |
| 89 double_sided = !double_sided; | 87 double_sided = !double_sided; |
| 90 hide_layer_and_subtree = !hide_layer_and_subtree; | |
| 91 masks_to_bounds = !masks_to_bounds; | 88 masks_to_bounds = !masks_to_bounds; |
| 92 | 89 |
| 93 timer_.NextLap(); | 90 timer_.NextLap(); |
| 94 } while (!timer_.HasTimeLimitExpired()); | 91 } while (!timer_.HasTimeLimitExpired()); |
| 95 | 92 |
| 96 perf_test::PrintResult("push_properties_to", | 93 perf_test::PrintResult("push_properties_to", |
| 97 "", | 94 "", |
| 98 "props_changed", | 95 "props_changed", |
| 99 timer_.LapsPerSecond(), | 96 timer_.LapsPerSecond(), |
| 100 "runs/s", | 97 "runs/s", |
| (...skipping 10 matching lines...) Expand all Loading... |
| 111 "", | 108 "", |
| 112 "props_didnt_change", | 109 "props_didnt_change", |
| 113 timer_.LapsPerSecond(), | 110 timer_.LapsPerSecond(), |
| 114 "runs/s", | 111 "runs/s", |
| 115 true); | 112 true); |
| 116 } | 113 } |
| 117 | 114 |
| 118 | 115 |
| 119 } // namespace | 116 } // namespace |
| 120 } // namespace cc | 117 } // namespace cc |
| OLD | NEW |