| 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/debug/test_context_provider.h" | 11 #include "cc/debug/test_context_provider.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/output/output_surface.h" | 14 #include "cc/output/output_surface.h" |
| 15 #include "cc/trees/layer_tree_host.h" | 15 #include "cc/trees/layer_tree_host.h" |
| 16 #include "content/test/test_webkit_platform_support.h" | 16 #include "content/test/test_webkit_platform_support.h" |
| 17 #include "third_party/WebKit/public/platform/Platform.h" | 17 #include "third_party/WebKit/public/platform/Platform.h" |
| 18 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 18 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 19 #include "third_party/WebKit/public/platform/WebLayer.h" | 19 #include "third_party/WebKit/public/platform/WebLayer.h" |
| 20 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" | 20 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" |
| 21 #include "third_party/WebKit/public/platform/WebRenderingStats.h" | 21 #include "third_party/WebKit/public/platform/WebRenderingStats.h" |
| 22 #include "third_party/WebKit/public/platform/WebSize.h" | 22 #include "third_party/WebKit/public/platform/WebSize.h" |
| 23 #include "ui/gfx/frame_time.h" |
| 23 #include "webkit/common/gpu/test_context_provider_factory.h" | 24 #include "webkit/common/gpu/test_context_provider_factory.h" |
| 24 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | 25 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
| 25 | 26 |
| 26 using WebKit::WebColor; | 27 using WebKit::WebColor; |
| 27 using WebKit::WebGraphicsContext3D; | 28 using WebKit::WebGraphicsContext3D; |
| 28 using WebKit::WebRect; | 29 using WebKit::WebRect; |
| 29 using WebKit::WebRenderingStats; | 30 using WebKit::WebRenderingStats; |
| 30 using WebKit::WebSize; | 31 using WebKit::WebSize; |
| 31 | 32 |
| 32 namespace webkit { | 33 namespace webkit { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 121 |
| 121 void WebLayerTreeViewImplForTesting::setNeedsRedraw() { | 122 void WebLayerTreeViewImplForTesting::setNeedsRedraw() { |
| 122 layer_tree_host_->SetNeedsRedraw(); | 123 layer_tree_host_->SetNeedsRedraw(); |
| 123 } | 124 } |
| 124 | 125 |
| 125 bool WebLayerTreeViewImplForTesting::commitRequested() const { | 126 bool WebLayerTreeViewImplForTesting::commitRequested() const { |
| 126 return layer_tree_host_->CommitRequested(); | 127 return layer_tree_host_->CommitRequested(); |
| 127 } | 128 } |
| 128 | 129 |
| 129 void WebLayerTreeViewImplForTesting::composite() { | 130 void WebLayerTreeViewImplForTesting::composite() { |
| 130 layer_tree_host_->Composite(base::TimeTicks::Now()); | 131 layer_tree_host_->Composite(gfx::FrameTime::Now()); |
| 131 } | 132 } |
| 132 | 133 |
| 133 void WebLayerTreeViewImplForTesting::didStopFlinging() {} | 134 void WebLayerTreeViewImplForTesting::didStopFlinging() {} |
| 134 | 135 |
| 135 bool WebLayerTreeViewImplForTesting::compositeAndReadback( | 136 bool WebLayerTreeViewImplForTesting::compositeAndReadback( |
| 136 void* pixels, const WebRect& rect_in_device_viewport) { | 137 void* pixels, const WebRect& rect_in_device_viewport) { |
| 137 return layer_tree_host_->CompositeAndReadback(pixels, | 138 return layer_tree_host_->CompositeAndReadback(pixels, |
| 138 rect_in_device_viewport); | 139 rect_in_device_viewport); |
| 139 } | 140 } |
| 140 | 141 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 165 } | 166 } |
| 166 | 167 |
| 167 scoped_refptr<cc::ContextProvider> | 168 scoped_refptr<cc::ContextProvider> |
| 168 WebLayerTreeViewImplForTesting::OffscreenContextProvider() { | 169 WebLayerTreeViewImplForTesting::OffscreenContextProvider() { |
| 169 // Unit tests only run in single threaded mode. | 170 // Unit tests only run in single threaded mode. |
| 170 return webkit::gpu::TestContextProviderFactory::GetInstance()-> | 171 return webkit::gpu::TestContextProviderFactory::GetInstance()-> |
| 171 OffscreenContextProviderForMainThread(); | 172 OffscreenContextProviderForMainThread(); |
| 172 } | 173 } |
| 173 | 174 |
| 174 } // namespace webkit | 175 } // namespace webkit |
| OLD | NEW |