| 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 "platform/testing/WebLayerTreeViewImplForTesting.h" | 5 #include "platform/testing/WebLayerTreeViewImplForTesting.h" |
| 6 | 6 |
| 7 #include "base/threading/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "cc/animation/animation_host.h" | 8 #include "cc/animation/animation_host.h" |
| 9 #include "cc/animation/animation_timeline.h" | 9 #include "cc/animation/animation_timeline.h" |
| 10 #include "cc/blink/web_layer_impl.h" | 10 #include "cc/blink/web_layer_impl.h" |
| 11 #include "cc/layers/layer.h" | 11 #include "cc/layers/layer.h" |
| 12 #include "cc/trees/layer_tree_host.h" | 12 #include "cc/trees/layer_tree_host.h" |
| 13 #include "public/platform/Platform.h" | 13 #include "public/platform/Platform.h" |
| 14 #include "public/platform/WebLayer.h" | 14 #include "public/platform/WebLayer.h" |
| 15 #include "public/platform/WebLayerTreeView.h" | 15 #include "public/platform/WebLayerTreeView.h" |
| 16 #include "public/platform/WebSize.h" | 16 #include "public/platform/WebSize.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting() | 20 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting() |
| 21 : WebLayerTreeViewImplForTesting(defaultLayerTreeSettings()) | 21 : WebLayerTreeViewImplForTesting(defaultLayerTreeSettings()) |
| 22 { | 22 { |
| 23 } | 23 } |
| 24 | 24 |
| 25 static cc::LayerTreeSettings settingsForLayerListPolicy(WebLayerTreeViewImplForT
esting::LayerListPolicy policy) | |
| 26 { | |
| 27 cc::LayerTreeSettings settings = WebLayerTreeViewImplForTesting::defaultLaye
rTreeSettings(); | |
| 28 settings.use_layer_lists = policy == WebLayerTreeViewImplForTesting::UseLaye
rLists; | |
| 29 return settings; | |
| 30 } | |
| 31 | |
| 32 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting(LayerListPolicy p
olicy) | |
| 33 : WebLayerTreeViewImplForTesting(settingsForLayerListPolicy(policy)) | |
| 34 { | |
| 35 } | |
| 36 | |
| 37 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting(const cc::LayerTr
eeSettings& settings) | 25 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting(const cc::LayerTr
eeSettings& settings) |
| 38 { | 26 { |
| 39 cc::LayerTreeHost::InitParams params; | 27 cc::LayerTreeHost::InitParams params; |
| 40 params.client = this; | 28 params.client = this; |
| 41 params.settings = &settings; | 29 params.settings = &settings; |
| 42 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 30 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
| 43 params.task_graph_runner = &m_taskGraphRunner; | 31 params.task_graph_runner = &m_taskGraphRunner; |
| 44 params.animation_host = cc::AnimationHost::CreateForTesting(cc::ThreadInstan
ce::MAIN); | 32 params.animation_host = cc::AnimationHost::CreateForTesting(cc::ThreadInstan
ce::MAIN); |
| 45 m_layerTreeHost = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); | 33 m_layerTreeHost = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
| 46 ASSERT(m_layerTreeHost); | 34 ASSERT(m_layerTreeHost); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 { | 216 { |
| 229 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers
); | 217 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers
); |
| 230 } | 218 } |
| 231 | 219 |
| 232 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const | 220 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const |
| 233 { | 221 { |
| 234 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); | 222 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); |
| 235 } | 223 } |
| 236 | 224 |
| 237 } // namespace blink | 225 } // namespace blink |
| OLD | NEW |