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 "content/test/web_layer_tree_view_impl_for_testing.h" | 5 #include "content/test/web_layer_tree_view_impl_for_testing.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "cc/base/switches.h" | 10 #include "cc/base/switches.h" |
11 #include "cc/blink/web_layer_impl.h" | 11 #include "cc/blink/web_layer_impl.h" |
12 #include "cc/input/input_handler.h" | 12 #include "cc/input/input_handler.h" |
13 #include "cc/layers/layer.h" | 13 #include "cc/layers/layer.h" |
| 14 #include "cc/scheduler/begin_frame_source.h" |
14 #include "cc/test/pixel_test_output_surface.h" | 15 #include "cc/test/pixel_test_output_surface.h" |
15 #include "cc/test/test_context_provider.h" | 16 #include "cc/test/test_context_provider.h" |
16 #include "cc/trees/layer_tree_host.h" | 17 #include "cc/trees/layer_tree_host.h" |
17 #include "content/test/test_blink_web_unit_test_support.h" | 18 #include "content/test/test_blink_web_unit_test_support.h" |
18 #include "third_party/WebKit/public/platform/Platform.h" | 19 #include "third_party/WebKit/public/platform/Platform.h" |
19 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 20 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
20 #include "third_party/WebKit/public/platform/WebLayer.h" | 21 #include "third_party/WebKit/public/platform/WebLayer.h" |
21 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" | 22 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" |
22 #include "third_party/WebKit/public/platform/WebSize.h" | 23 #include "third_party/WebKit/public/platform/WebSize.h" |
23 #include "ui/gfx/frame_time.h" | 24 #include "ui/gfx/frame_time.h" |
(...skipping 12 matching lines...) Expand all Loading... |
36 void WebLayerTreeViewImplForTesting::Initialize() { | 37 void WebLayerTreeViewImplForTesting::Initialize() { |
37 cc::LayerTreeSettings settings; | 38 cc::LayerTreeSettings settings; |
38 | 39 |
39 // For web contents, layer transforms should scale up the contents of layers | 40 // For web contents, layer transforms should scale up the contents of layers |
40 // to keep content always crisp when possible. | 41 // to keep content always crisp when possible. |
41 settings.layer_transforms_should_scale_layer_contents = true; | 42 settings.layer_transforms_should_scale_layer_contents = true; |
42 | 43 |
43 // Accelerated animations are enabled for unit tests. | 44 // Accelerated animations are enabled for unit tests. |
44 settings.accelerated_animation_enabled = true; | 45 settings.accelerated_animation_enabled = true; |
45 layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded( | 46 layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded( |
46 this, this, NULL, NULL, settings, base::MessageLoopProxy::current()); | 47 this, |
| 48 this, |
| 49 nullptr, |
| 50 nullptr, |
| 51 settings, |
| 52 base::MessageLoopProxy::current(), |
| 53 nullptr); |
47 DCHECK(layer_tree_host_); | 54 DCHECK(layer_tree_host_); |
48 } | 55 } |
49 | 56 |
50 void WebLayerTreeViewImplForTesting::setSurfaceReady() { | 57 void WebLayerTreeViewImplForTesting::setSurfaceReady() { |
51 layer_tree_host_->SetLayerTreeHostClientReady(); | 58 layer_tree_host_->SetLayerTreeHostClientReady(); |
52 } | 59 } |
53 | 60 |
54 void WebLayerTreeViewImplForTesting::setRootLayer( | 61 void WebLayerTreeViewImplForTesting::setRootLayer( |
55 const blink::WebLayer& root) { | 62 const blink::WebLayer& root) { |
56 layer_tree_host_->SetRootLayer( | 63 layer_tree_host_->SetRootLayer( |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 186 |
180 void WebLayerTreeViewImplForTesting::registerSelection( | 187 void WebLayerTreeViewImplForTesting::registerSelection( |
181 const blink::WebSelectionBound& start, | 188 const blink::WebSelectionBound& start, |
182 const blink::WebSelectionBound& end) { | 189 const blink::WebSelectionBound& end) { |
183 } | 190 } |
184 | 191 |
185 void WebLayerTreeViewImplForTesting::clearSelection() { | 192 void WebLayerTreeViewImplForTesting::clearSelection() { |
186 } | 193 } |
187 | 194 |
188 } // namespace content | 195 } // namespace content |
OLD | NEW |