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" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 new cc::OutputSurface(cc::TestContextProvider::Create())); | 163 new cc::OutputSurface(cc::TestContextProvider::Create())); |
164 } | 164 } |
165 | 165 |
166 scoped_refptr<cc::ContextProvider> | 166 scoped_refptr<cc::ContextProvider> |
167 WebLayerTreeViewImplForTesting::OffscreenContextProvider() { | 167 WebLayerTreeViewImplForTesting::OffscreenContextProvider() { |
168 // Unit tests only run in single threaded mode. | 168 // Unit tests only run in single threaded mode. |
169 return webkit::gpu::TestContextProviderFactory::GetInstance()-> | 169 return webkit::gpu::TestContextProviderFactory::GetInstance()-> |
170 OffscreenContextProviderForMainThread(); | 170 OffscreenContextProviderForMainThread(); |
171 } | 171 } |
172 | 172 |
| 173 void WebLayerTreeViewImplForTesting::registerViewportLayers( |
| 174 const blink::WebLayer* pageScaleLayer, |
| 175 const blink::WebLayer* innerViewportScrollLayer, |
| 176 const blink::WebLayer* outerViewportScrollLayer) { |
| 177 layer_tree_host_->RegisterViewportLayers( |
| 178 static_cast<const WebLayerImpl*>(pageScaleLayer)->layer(), |
| 179 static_cast<const WebLayerImpl*>(innerViewportScrollLayer) |
| 180 ->layer(), |
| 181 // The outer viewport layer will only exist when using pinch virtual |
| 182 // viewports. |
| 183 outerViewportScrollLayer ? static_cast<const WebLayerImpl*>( |
| 184 outerViewportScrollLayer)->layer() |
| 185 : NULL); |
| 186 } |
| 187 |
| 188 void WebLayerTreeViewImplForTesting::clearViewportLayers() { |
| 189 layer_tree_host_->RegisterViewportLayers(scoped_refptr<cc::Layer>(), |
| 190 scoped_refptr<cc::Layer>(), |
| 191 scoped_refptr<cc::Layer>()); |
| 192 } |
| 193 |
173 } // namespace webkit | 194 } // namespace webkit |
OLD | NEW |