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