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_test_utils.h" | 9 #include "cc/test/pixel_test_utils.h" |
10 #include "cc/trees/layer_tree_impl.h" | 10 #include "cc/trees/layer_tree_impl.h" |
11 #include "ui/gl/gl_implementation.h" | 11 #include "ui/gl/gl_implementation.h" |
12 #include "webkit/gpu/context_provider_in_process.h" | 12 #include "webkit/gpu/context_provider_in_process.h" |
13 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 13 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 LayerTreePixelTest::LayerTreePixelTest() {} | 17 LayerTreePixelTest::LayerTreePixelTest() {} |
18 | 18 |
19 LayerTreePixelTest::~LayerTreePixelTest() {} | 19 LayerTreePixelTest::~LayerTreePixelTest() {} |
20 | 20 |
21 scoped_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() { | 21 scoped_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() { |
22 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); | 22 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); |
23 | 23 |
24 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; | 24 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; |
25 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( | 25 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( |
26 new WebGraphicsContext3DInProcessCommandBufferImpl); | 26 new WebGraphicsContext3DInProcessCommandBufferImpl( |
27 context3d->Initialize(WebKit::WebGraphicsContext3D::Attributes(), NULL); | 27 WebKit::WebGraphicsContext3D::Attributes())); |
28 return make_scoped_ptr( | 28 return make_scoped_ptr( |
29 new OutputSurface(context3d.PassAs<WebKit::WebGraphicsContext3D>())); | 29 new OutputSurface(context3d.PassAs<WebKit::WebGraphicsContext3D>())); |
30 } | 30 } |
31 | 31 |
32 scoped_refptr<cc::ContextProvider> | 32 scoped_refptr<cc::ContextProvider> |
33 LayerTreePixelTest::OffscreenContextProviderForMainThread() { | 33 LayerTreePixelTest::OffscreenContextProviderForMainThread() { |
34 scoped_refptr<webkit::gpu::ContextProviderInProcess> provider = | 34 scoped_refptr<webkit::gpu::ContextProviderInProcess> provider = |
35 webkit::gpu::ContextProviderInProcess::Create(); | 35 webkit::gpu::ContextProviderInProcess::Create(); |
36 CHECK(provider->BindToCurrentThread()); | 36 CHECK(provider->BindToCurrentThread()); |
37 return provider; | 37 return provider; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 void LayerTreePixelTest::SetupTree() { | 99 void LayerTreePixelTest::SetupTree() { |
100 scoped_refptr<Layer> root = Layer::Create(); | 100 scoped_refptr<Layer> root = Layer::Create(); |
101 root->SetBounds(content_root_->bounds()); | 101 root->SetBounds(content_root_->bounds()); |
102 root->AddChild(content_root_); | 102 root->AddChild(content_root_); |
103 layer_tree_host()->SetRootLayer(root); | 103 layer_tree_host()->SetRootLayer(root); |
104 LayerTreeTest::SetupTree(); | 104 LayerTreeTest::SetupTree(); |
105 } | 105 } |
106 | 106 |
107 } // namespace cc | 107 } // namespace cc |
OLD | NEW |