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 "cc/test/layer_tree_pixel_test.h" | 5 #include "cc/test/layer_tree_pixel_test.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
9 #include "cc/test/paths.h" | 9 #include "cc/test/paths.h" |
10 #include "cc/test/pixel_comparator.h" | 10 #include "cc/test/pixel_comparator.h" |
11 #include "cc/test/pixel_test_utils.h" | 11 #include "cc/test/pixel_test_utils.h" |
12 #include "cc/trees/layer_tree_impl.h" | 12 #include "cc/trees/layer_tree_impl.h" |
13 #include "ui/gl/gl_implementation.h" | 13 #include "ui/gl/gl_implementation.h" |
14 #include "webkit/common/gpu/context_provider_in_process.h" | 14 #include "webkit/common/gpu/context_provider_in_process.h" |
15 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 15 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
16 | 16 |
17 namespace cc { | 17 namespace cc { |
18 | 18 |
19 LayerTreePixelTest::LayerTreePixelTest() | 19 LayerTreePixelTest::LayerTreePixelTest() |
20 : pixel_comparator_(new ExactPixelComparator(true)) {} | 20 : pixel_comparator_(new ExactPixelComparator(true)) {} |
21 | 21 |
22 LayerTreePixelTest::~LayerTreePixelTest() {} | 22 LayerTreePixelTest::~LayerTreePixelTest() {} |
23 | 23 |
24 scoped_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() { | 24 scoped_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() { |
25 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); | 25 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); |
26 | 26 |
27 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; | 27 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; |
28 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( | 28 scoped_ptr<WebKit::WebGraphicsContext3D> context3d( |
29 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( | 29 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( |
30 WebKit::WebGraphicsContext3D::Attributes())); | 30 WebKit::WebGraphicsContext3D::Attributes())); |
31 return make_scoped_ptr( | 31 return make_scoped_ptr( |
32 new OutputSurface(context3d.PassAs<WebKit::WebGraphicsContext3D>())); | 32 new OutputSurface(context3d.PassAs<WebKit::WebGraphicsContext3D>())); |
33 } | 33 } |
34 | 34 |
35 scoped_refptr<cc::ContextProvider> | 35 scoped_refptr<cc::ContextProvider> |
36 LayerTreePixelTest::OffscreenContextProviderForMainThread() { | 36 LayerTreePixelTest::OffscreenContextProviderForMainThread() { |
37 scoped_refptr<webkit::gpu::ContextProviderInProcess> provider = | 37 scoped_refptr<webkit::gpu::ContextProviderInProcess> provider = |
38 webkit::gpu::ContextProviderInProcess::Create(); | 38 webkit::gpu::ContextProviderInProcess::Create(); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 void LayerTreePixelTest::SetupTree() { | 135 void LayerTreePixelTest::SetupTree() { |
136 scoped_refptr<Layer> root = Layer::Create(); | 136 scoped_refptr<Layer> root = Layer::Create(); |
137 root->SetBounds(content_root_->bounds()); | 137 root->SetBounds(content_root_->bounds()); |
138 root->AddChild(content_root_); | 138 root->AddChild(content_root_); |
139 layer_tree_host()->SetRootLayer(root); | 139 layer_tree_host()->SetRootLayer(root); |
140 LayerTreeTest::SetupTree(); | 140 LayerTreeTest::SetupTree(); |
141 } | 141 } |
142 | 142 |
143 } // namespace cc | 143 } // namespace cc |
OLD | NEW |