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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "cc/base/switches.h" | 9 #include "cc/base/switches.h" |
10 #include "cc/layers/solid_color_layer.h" | 10 #include "cc/layers/solid_color_layer.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 : layer_tree_host()->root_layer(); | 100 : layer_tree_host()->root_layer(); |
101 target->RequestCopyOfOutput(CreateCopyOutputRequest().Pass()); | 101 target->RequestCopyOfOutput(CreateCopyOutputRequest().Pass()); |
102 PostSetNeedsCommitToMainThread(); | 102 PostSetNeedsCommitToMainThread(); |
103 } | 103 } |
104 | 104 |
105 void LayerTreePixelTest::AfterTest() { | 105 void LayerTreePixelTest::AfterTest() { |
106 base::FilePath test_data_dir; | 106 base::FilePath test_data_dir; |
107 EXPECT_TRUE(PathService::Get(CCPaths::DIR_TEST_DATA, &test_data_dir)); | 107 EXPECT_TRUE(PathService::Get(CCPaths::DIR_TEST_DATA, &test_data_dir)); |
108 base::FilePath ref_file_path = test_data_dir.Append(ref_file_); | 108 base::FilePath ref_file_path = test_data_dir.Append(ref_file_); |
109 | 109 |
110 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 110 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
111 if (cmd->HasSwitch(switches::kCCRebaselinePixeltests)) | 111 if (cmd->HasSwitch(switches::kCCRebaselinePixeltests)) |
112 EXPECT_TRUE(WritePNGFile(*result_bitmap_, ref_file_path, true)); | 112 EXPECT_TRUE(WritePNGFile(*result_bitmap_, ref_file_path, true)); |
113 EXPECT_TRUE(MatchesPNGFile(*result_bitmap_, | 113 EXPECT_TRUE(MatchesPNGFile(*result_bitmap_, |
114 ref_file_path, | 114 ref_file_path, |
115 *pixel_comparator_)); | 115 *pixel_comparator_)); |
116 } | 116 } |
117 | 117 |
118 scoped_refptr<SolidColorLayer> LayerTreePixelTest::CreateSolidColorLayer( | 118 scoped_refptr<SolidColorLayer> LayerTreePixelTest::CreateSolidColorLayer( |
119 const gfx::Rect& rect, SkColor color) { | 119 const gfx::Rect& rect, SkColor color) { |
120 scoped_refptr<SolidColorLayer> layer = SolidColorLayer::Create(); | 120 scoped_refptr<SolidColorLayer> layer = SolidColorLayer::Create(); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 372 |
373 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); | 373 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); |
374 *release_callback = SingleReleaseCallback::Create( | 374 *release_callback = SingleReleaseCallback::Create( |
375 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, | 375 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, |
376 base::Unretained(this), | 376 base::Unretained(this), |
377 base::Passed(&context), | 377 base::Passed(&context), |
378 texture_id)); | 378 texture_id)); |
379 } | 379 } |
380 | 380 |
381 } // namespace cc | 381 } // namespace cc |
OLD | NEW |