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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 163 } |
164 | 164 |
165 void LayerTreePixelTest::RunPixelTest( | 165 void LayerTreePixelTest::RunPixelTest( |
166 PixelTestType test_type, | 166 PixelTestType test_type, |
167 scoped_refptr<Layer> content_root, | 167 scoped_refptr<Layer> content_root, |
168 base::FilePath file_name) { | 168 base::FilePath file_name) { |
169 test_type_ = test_type; | 169 test_type_ = test_type; |
170 content_root_ = content_root; | 170 content_root_ = content_root; |
171 readback_target_ = NULL; | 171 readback_target_ = NULL; |
172 ref_file_ = file_name; | 172 ref_file_ = file_name; |
173 RunTest(CompositorMode::Threaded, false); | 173 RunTest(CompositorMode::THREADED, false); |
174 } | 174 } |
175 | 175 |
176 void LayerTreePixelTest::RunSingleThreadedPixelTest( | 176 void LayerTreePixelTest::RunSingleThreadedPixelTest( |
177 PixelTestType test_type, | 177 PixelTestType test_type, |
178 scoped_refptr<Layer> content_root, | 178 scoped_refptr<Layer> content_root, |
179 base::FilePath file_name) { | 179 base::FilePath file_name) { |
180 test_type_ = test_type; | 180 test_type_ = test_type; |
181 content_root_ = content_root; | 181 content_root_ = content_root; |
182 readback_target_ = NULL; | 182 readback_target_ = NULL; |
183 ref_file_ = file_name; | 183 ref_file_ = file_name; |
184 RunTest(CompositorMode::SingleThreaded, false); | 184 RunTest(CompositorMode::SINGLE_THREADED, false); |
185 } | 185 } |
186 | 186 |
187 void LayerTreePixelTest::RunPixelTestWithReadbackTarget( | 187 void LayerTreePixelTest::RunPixelTestWithReadbackTarget( |
188 PixelTestType test_type, | 188 PixelTestType test_type, |
189 scoped_refptr<Layer> content_root, | 189 scoped_refptr<Layer> content_root, |
190 Layer* target, | 190 Layer* target, |
191 base::FilePath file_name) { | 191 base::FilePath file_name) { |
192 test_type_ = test_type; | 192 test_type_ = test_type; |
193 content_root_ = content_root; | 193 content_root_ = content_root; |
194 readback_target_ = target; | 194 readback_target_ = target; |
195 ref_file_ = file_name; | 195 ref_file_ = file_name; |
196 RunTest(CompositorMode::Threaded, false); | 196 RunTest(CompositorMode::THREADED, false); |
197 } | 197 } |
198 | 198 |
199 void LayerTreePixelTest::SetupTree() { | 199 void LayerTreePixelTest::SetupTree() { |
200 scoped_refptr<Layer> root = Layer::Create(layer_settings()); | 200 scoped_refptr<Layer> root = Layer::Create(layer_settings()); |
201 root->SetBounds(content_root_->bounds()); | 201 root->SetBounds(content_root_->bounds()); |
202 root->AddChild(content_root_); | 202 root->AddChild(content_root_); |
203 layer_tree_host()->SetRootLayer(root); | 203 layer_tree_host()->SetRootLayer(root); |
204 LayerTreeTest::SetupTree(); | 204 LayerTreeTest::SetupTree(); |
205 } | 205 } |
206 | 206 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 return bitmap; | 269 return bitmap; |
270 } | 270 } |
271 | 271 |
272 void LayerTreePixelTest::Finish() { | 272 void LayerTreePixelTest::Finish() { |
273 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); | 273 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); |
274 GLES2Interface* gl = context->GetImplementation(); | 274 GLES2Interface* gl = context->GetImplementation(); |
275 gl->Finish(); | 275 gl->Finish(); |
276 } | 276 } |
277 | 277 |
278 } // namespace cc | 278 } // namespace cc |
OLD | NEW |