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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "cc/base/switches.h" | 10 #include "cc/base/switches.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 if (cmd->HasSwitch(switches::kCCRebaselinePixeltests)) | 149 if (cmd->HasSwitch(switches::kCCRebaselinePixeltests)) |
150 return WritePNGFile(*result_bitmap_, test_data_dir.Append(ref_file), true); | 150 return WritePNGFile(*result_bitmap_, test_data_dir.Append(ref_file), true); |
151 | 151 |
152 return MatchesPNGFile(*result_bitmap_, | 152 return MatchesPNGFile(*result_bitmap_, |
153 test_data_dir.Append(ref_file), | 153 test_data_dir.Append(ref_file), |
154 comparator); | 154 comparator); |
155 } | 155 } |
156 | 156 |
157 void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend) { | 157 void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend) { |
158 CHECK(fake_client_); | 158 CHECK(fake_client_); |
159 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); | 159 CHECK(gfx::InitializeStaticGLBindings(gfx::kGLImplementationOSMesaGL)); |
160 | 160 |
161 using webkit::gpu::ContextProviderInProcess; | 161 using webkit::gpu::ContextProviderInProcess; |
162 output_surface_.reset(new PixelTestOutputSurface( | 162 output_surface_.reset(new PixelTestOutputSurface( |
163 ContextProviderInProcess::CreateOffscreen())); | 163 ContextProviderInProcess::CreateOffscreen())); |
164 output_surface_->BindToClient(fake_client_.get()); | 164 output_surface_->BindToClient(fake_client_.get()); |
165 | 165 |
166 resource_provider_ = | 166 resource_provider_ = |
167 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); | 167 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); |
168 | 168 |
169 texture_mailbox_deleter_ = make_scoped_ptr(new TextureMailboxDeleter); | 169 texture_mailbox_deleter_ = make_scoped_ptr(new TextureMailboxDeleter); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 resource_provider_ = | 209 resource_provider_ = |
210 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); | 210 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); |
211 renderer_ = SoftwareRenderer::Create(fake_client_.get(), | 211 renderer_ = SoftwareRenderer::Create(fake_client_.get(), |
212 &settings_, | 212 &settings_, |
213 output_surface_.get(), | 213 output_surface_.get(), |
214 resource_provider_.get()) | 214 resource_provider_.get()) |
215 .PassAs<DirectRenderer>(); | 215 .PassAs<DirectRenderer>(); |
216 } | 216 } |
217 | 217 |
218 } // namespace cc | 218 } // namespace cc |
OLD | NEW |