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/pixel_test.h" | 5 #include "cc/test/pixel_test.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "cc/output/compositor_frame_metadata.h" | 8 #include "cc/output/compositor_frame_metadata.h" |
9 #include "cc/output/gl_renderer.h" | 9 #include "cc/output/gl_renderer.h" |
10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 LayerTreeSettings settings_; | 50 LayerTreeSettings settings_; |
51 }; | 51 }; |
52 | 52 |
53 PixelTest::PixelTest() : device_viewport_size_(gfx::Size(200, 200)) {} | 53 PixelTest::PixelTest() : device_viewport_size_(gfx::Size(200, 200)) {} |
54 | 54 |
55 PixelTest::~PixelTest() {} | 55 PixelTest::~PixelTest() {} |
56 | 56 |
57 void PixelTest::SetUp() { | 57 void PixelTest::SetUp() { |
58 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); | 58 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); |
59 | 59 |
60 scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> | 60 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; |
61 context3d( | 61 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( |
62 new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl( | 62 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( |
63 WebKit::WebGraphicsContext3D::Attributes())); | 63 WebKit::WebGraphicsContext3D::Attributes())); |
64 output_surface_.reset(new OutputSurface( | 64 output_surface_.reset(new OutputSurface( |
65 context3d.PassAs<WebKit::WebGraphicsContext3D>())); | 65 context3d.PassAs<WebKit::WebGraphicsContext3D>())); |
66 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0); | 66 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0); |
67 fake_client_ = | 67 fake_client_ = |
68 make_scoped_ptr(new PixelTestRendererClient(device_viewport_size_)); | 68 make_scoped_ptr(new PixelTestRendererClient(device_viewport_size_)); |
69 renderer_ = GLRenderer::Create(fake_client_.get(), | 69 renderer_ = GLRenderer::Create(fake_client_.get(), |
70 output_surface_.get(), | 70 output_surface_.get(), |
71 resource_provider_.get(), | 71 resource_provider_.get(), |
72 0); | 72 0); |
73 | 73 |
(...skipping 19 matching lines...) Expand all Loading... |
93 if (!PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)) | 93 if (!PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)) |
94 return false; | 94 return false; |
95 | 95 |
96 // To rebaseline: | 96 // To rebaseline: |
97 // return WritePNGFile(bitmap, test_data_dir.Append(ref_file)); | 97 // return WritePNGFile(bitmap, test_data_dir.Append(ref_file)); |
98 | 98 |
99 return MatchesPNGFile(bitmap, test_data_dir.Append(ref_file), comparator); | 99 return MatchesPNGFile(bitmap, test_data_dir.Append(ref_file), comparator); |
100 } | 100 } |
101 | 101 |
102 } // namespace cc | 102 } // namespace cc |
OLD | NEW |