Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Side by Side Diff: third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.cpp

Issue 2650303002: cc: Remove the LayerTreeHost abstraction. (Closed)
Patch Set: missed ui Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_in_process.h" 12 #include "cc/trees/layer_tree_host.h"
13 #include "cc/trees/layer_tree_settings.h" 13 #include "cc/trees/layer_tree_settings.h"
14 #include "public/platform/Platform.h" 14 #include "public/platform/Platform.h"
15 #include "public/platform/WebLayer.h" 15 #include "public/platform/WebLayer.h"
16 #include "public/platform/WebLayerTreeView.h" 16 #include "public/platform/WebLayerTreeView.h"
17 #include "public/platform/WebSize.h" 17 #include "public/platform/WebSize.h"
18 18
19 namespace blink { 19 namespace blink {
20 20
21 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting() 21 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting()
22 : WebLayerTreeViewImplForTesting(defaultLayerTreeSettings()) {} 22 : WebLayerTreeViewImplForTesting(defaultLayerTreeSettings()) {}
23 23
24 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting( 24 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting(
25 const cc::LayerTreeSettings& settings) { 25 const cc::LayerTreeSettings& settings) {
26 m_animationHost = cc::AnimationHost::CreateMainInstance(); 26 m_animationHost = cc::AnimationHost::CreateMainInstance();
27 cc::LayerTreeHostInProcess::InitParams params; 27 cc::LayerTreeHost::InitParams params;
28 params.client = this; 28 params.client = this;
29 params.settings = &settings; 29 params.settings = &settings;
30 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); 30 params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
31 params.task_graph_runner = &m_taskGraphRunner; 31 params.task_graph_runner = &m_taskGraphRunner;
32 params.mutator_host = m_animationHost.get(); 32 params.mutator_host = m_animationHost.get();
33 m_layerTreeHost = 33 m_layerTreeHost = cc::LayerTreeHost::CreateSingleThreaded(this, &params);
34 cc::LayerTreeHostInProcess::CreateSingleThreaded(this, &params);
35 ASSERT(m_layerTreeHost); 34 ASSERT(m_layerTreeHost);
36 } 35 }
37 36
38 WebLayerTreeViewImplForTesting::~WebLayerTreeViewImplForTesting() {} 37 WebLayerTreeViewImplForTesting::~WebLayerTreeViewImplForTesting() {}
39 38
40 // static 39 // static
41 cc::LayerTreeSettings 40 cc::LayerTreeSettings
42 WebLayerTreeViewImplForTesting::defaultLayerTreeSettings() { 41 WebLayerTreeViewImplForTesting::defaultLayerTreeSettings() {
43 cc::LayerTreeSettings settings; 42 cc::LayerTreeSettings settings;
44 43
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 void WebLayerTreeViewImplForTesting::setHaveScrollEventHandlers( 205 void WebLayerTreeViewImplForTesting::setHaveScrollEventHandlers(
207 bool haveEentHandlers) { 206 bool haveEentHandlers) {
208 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers); 207 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers);
209 } 208 }
210 209
211 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const { 210 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const {
212 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); 211 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers();
213 } 212 }
214 213
215 } // namespace blink 214 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698