| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 | 183 |
| 184 void LayerTreePixelTest::RunPixelTest( | 184 void LayerTreePixelTest::RunPixelTest( |
| 185 PixelTestType test_type, | 185 PixelTestType test_type, |
| 186 scoped_refptr<Layer> content_root, | 186 scoped_refptr<Layer> content_root, |
| 187 base::FilePath file_name) { | 187 base::FilePath file_name) { |
| 188 test_type_ = test_type; | 188 test_type_ = test_type; |
| 189 content_root_ = content_root; | 189 content_root_ = content_root; |
| 190 readback_target_ = NULL; | 190 readback_target_ = NULL; |
| 191 ref_file_ = file_name; | 191 ref_file_ = file_name; |
| 192 RunTest(CompositorMode::THREADED, false); | 192 RunTest(CompositorMode::THREADED); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void LayerTreePixelTest::RunSingleThreadedPixelTest( | 195 void LayerTreePixelTest::RunSingleThreadedPixelTest( |
| 196 PixelTestType test_type, | 196 PixelTestType test_type, |
| 197 scoped_refptr<Layer> content_root, | 197 scoped_refptr<Layer> content_root, |
| 198 base::FilePath file_name) { | 198 base::FilePath file_name) { |
| 199 test_type_ = test_type; | 199 test_type_ = test_type; |
| 200 content_root_ = content_root; | 200 content_root_ = content_root; |
| 201 readback_target_ = NULL; | 201 readback_target_ = NULL; |
| 202 ref_file_ = file_name; | 202 ref_file_ = file_name; |
| 203 RunTest(CompositorMode::SINGLE_THREADED, false); | 203 RunTest(CompositorMode::SINGLE_THREADED); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void LayerTreePixelTest::RunPixelTestWithReadbackTarget( | 206 void LayerTreePixelTest::RunPixelTestWithReadbackTarget( |
| 207 PixelTestType test_type, | 207 PixelTestType test_type, |
| 208 scoped_refptr<Layer> content_root, | 208 scoped_refptr<Layer> content_root, |
| 209 Layer* target, | 209 Layer* target, |
| 210 base::FilePath file_name) { | 210 base::FilePath file_name) { |
| 211 test_type_ = test_type; | 211 test_type_ = test_type; |
| 212 content_root_ = content_root; | 212 content_root_ = content_root; |
| 213 readback_target_ = target; | 213 readback_target_ = target; |
| 214 ref_file_ = file_name; | 214 ref_file_ = file_name; |
| 215 RunTest(CompositorMode::THREADED, false); | 215 RunTest(CompositorMode::THREADED); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void LayerTreePixelTest::SetupTree() { | 218 void LayerTreePixelTest::SetupTree() { |
| 219 scoped_refptr<Layer> root = Layer::Create(); | 219 scoped_refptr<Layer> root = Layer::Create(); |
| 220 root->SetBounds(content_root_->bounds()); | 220 root->SetBounds(content_root_->bounds()); |
| 221 root->AddChild(content_root_); | 221 root->AddChild(content_root_); |
| 222 layer_tree_host()->SetRootLayer(root); | 222 layer_tree_host()->SetRootLayer(root); |
| 223 LayerTreeTest::SetupTree(); | 223 LayerTreeTest::SetupTree(); |
| 224 } | 224 } |
| 225 | 225 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 290 } |
| 291 | 291 |
| 292 void LayerTreePixelTest::Finish() { | 292 void LayerTreePixelTest::Finish() { |
| 293 std::unique_ptr<gpu::GLInProcessContext> context = | 293 std::unique_ptr<gpu::GLInProcessContext> context = |
| 294 CreateTestInProcessContext(); | 294 CreateTestInProcessContext(); |
| 295 GLES2Interface* gl = context->GetImplementation(); | 295 GLES2Interface* gl = context->GetImplementation(); |
| 296 gl->Finish(); | 296 gl->Finish(); |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace cc | 299 } // namespace cc |
| OLD | NEW |