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