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_in_process.h" |
| 13 #include "cc/trees/layer_tree_settings.h" |
13 #include "public/platform/Platform.h" | 14 #include "public/platform/Platform.h" |
14 #include "public/platform/WebLayer.h" | 15 #include "public/platform/WebLayer.h" |
15 #include "public/platform/WebLayerTreeView.h" | 16 #include "public/platform/WebLayerTreeView.h" |
16 #include "public/platform/WebSize.h" | 17 #include "public/platform/WebSize.h" |
17 | 18 |
18 namespace blink { | 19 namespace blink { |
19 | 20 |
20 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting() | 21 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting() |
21 : WebLayerTreeViewImplForTesting(defaultLayerTreeSettings()) | 22 : WebLayerTreeViewImplForTesting(defaultLayerTreeSettings()) |
22 { | 23 { |
23 } | 24 } |
24 | 25 |
25 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting(const cc::LayerTr
eeSettings& settings) | 26 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting(const cc::LayerTr
eeSettings& settings) |
26 { | 27 { |
27 cc::LayerTreeHost::InitParams params; | 28 cc::LayerTreeHostInProcess::InitParams params; |
28 params.client = this; | 29 params.client = this; |
29 params.settings = &settings; | 30 params.settings = &settings; |
30 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 31 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
31 params.task_graph_runner = &m_taskGraphRunner; | 32 params.task_graph_runner = &m_taskGraphRunner; |
32 params.animation_host = cc::AnimationHost::CreateForTesting(cc::ThreadInstan
ce::MAIN); | 33 params.animation_host = cc::AnimationHost::CreateForTesting(cc::ThreadInstan
ce::MAIN); |
33 m_layerTreeHost = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); | 34 m_layerTreeHost = cc::LayerTreeHostInProcess::CreateSingleThreaded(this, &pa
rams); |
34 ASSERT(m_layerTreeHost); | 35 ASSERT(m_layerTreeHost); |
35 } | 36 } |
36 | 37 |
37 WebLayerTreeViewImplForTesting::~WebLayerTreeViewImplForTesting() {} | 38 WebLayerTreeViewImplForTesting::~WebLayerTreeViewImplForTesting() {} |
38 | 39 |
39 // static | 40 // static |
40 cc::LayerTreeSettings WebLayerTreeViewImplForTesting::defaultLayerTreeSettings() | 41 cc::LayerTreeSettings WebLayerTreeViewImplForTesting::defaultLayerTreeSettings() |
41 { | 42 { |
42 cc::LayerTreeSettings settings; | 43 cc::LayerTreeSettings settings; |
43 | 44 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 { | 217 { |
217 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers
); | 218 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers
); |
218 } | 219 } |
219 | 220 |
220 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const | 221 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const |
221 { | 222 { |
222 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); | 223 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); |
223 } | 224 } |
224 | 225 |
225 } // namespace blink | 226 } // namespace blink |
OLD | NEW |