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/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 bool PixelTest::PixelsMatchReference(const base::FilePath& ref_file, | 107 bool PixelTest::PixelsMatchReference(const base::FilePath& ref_file, |
108 const PixelComparator& comparator) { | 108 const PixelComparator& comparator) { |
109 base::FilePath test_data_dir; | 109 base::FilePath test_data_dir; |
110 if (!PathService::Get(CCPaths::DIR_TEST_DATA, &test_data_dir)) | 110 if (!PathService::Get(CCPaths::DIR_TEST_DATA, &test_data_dir)) |
111 return false; | 111 return false; |
112 | 112 |
113 // If this is false, we didn't set up a readback on a render pass. | 113 // If this is false, we didn't set up a readback on a render pass. |
114 if (!result_bitmap_) | 114 if (!result_bitmap_) |
115 return false; | 115 return false; |
116 | 116 |
117 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 117 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
118 if (cmd->HasSwitch(switches::kCCRebaselinePixeltests)) | 118 if (cmd->HasSwitch(switches::kCCRebaselinePixeltests)) |
119 return WritePNGFile(*result_bitmap_, test_data_dir.Append(ref_file), true); | 119 return WritePNGFile(*result_bitmap_, test_data_dir.Append(ref_file), true); |
120 | 120 |
121 return MatchesPNGFile( | 121 return MatchesPNGFile( |
122 *result_bitmap_, test_data_dir.Append(ref_file), comparator); | 122 *result_bitmap_, test_data_dir.Append(ref_file), comparator); |
123 } | 123 } |
124 | 124 |
125 void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend, | 125 void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend, |
126 bool flipped_output_surface) { | 126 bool flipped_output_surface) { |
127 enable_pixel_output_.reset(new gfx::DisableNullDrawGLBindings); | 127 enable_pixel_output_.reset(new gfx::DisableNullDrawGLBindings); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 gpu_memory_buffer_manager_.get(), | 186 gpu_memory_buffer_manager_.get(), |
187 main_thread_task_runner_.get(), | 187 main_thread_task_runner_.get(), |
188 0, | 188 0, |
189 false, | 189 false, |
190 1); | 190 1); |
191 renderer_ = SoftwareRenderer::Create( | 191 renderer_ = SoftwareRenderer::Create( |
192 this, &settings_, output_surface_.get(), resource_provider_.get()); | 192 this, &settings_, output_surface_.get(), resource_provider_.get()); |
193 } | 193 } |
194 | 194 |
195 } // namespace cc | 195 } // namespace cc |
OLD | NEW |