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/path_service.h" | 7 #include "base/path_service.h" |
8 #include "cc/test/paths.h" | 8 #include "cc/test/paths.h" |
9 #include "cc/test/pixel_test_utils.h" | 9 #include "cc/test/pixel_test_utils.h" |
10 #include "cc/trees/layer_tree_impl.h" | 10 #include "cc/trees/layer_tree_impl.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 device_viewport_rect.width(), | 57 device_viewport_rect.width(), |
58 device_viewport_rect.height()); | 58 device_viewport_rect.height()); |
59 bitmap.allocPixels(); | 59 bitmap.allocPixels(); |
60 unsigned char* pixels = static_cast<unsigned char*>(bitmap.getPixels()); | 60 unsigned char* pixels = static_cast<unsigned char*>(bitmap.getPixels()); |
61 host_impl->Readback(pixels, device_viewport_rect); | 61 host_impl->Readback(pixels, device_viewport_rect); |
62 | 62 |
63 base::FilePath test_data_dir; | 63 base::FilePath test_data_dir; |
64 EXPECT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)); | 64 EXPECT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)); |
65 | 65 |
66 // To rebaseline: | 66 // To rebaseline: |
67 //EXPECT_TRUE(WritePNGFile(bitmap, test_data_dir.Append(ref_file_))); | 67 // EXPECT_TRUE(WritePNGFile(bitmap, test_data_dir.Append(ref_file_))); |
68 | 68 |
69 EXPECT_TRUE(IsSameAsPNGFile(bitmap, test_data_dir.Append(ref_file_))); | 69 EXPECT_TRUE(IsSameAsPNGFile(bitmap, test_data_dir.Append(ref_file_))); |
70 | 70 |
71 EndTest(); | 71 EndTest(); |
72 } | 72 } |
73 | 73 |
74 void LayerTreePixelTest::BeginTest() { | 74 void LayerTreePixelTest::BeginTest() { |
75 PostSetNeedsCommitToMainThread(); | 75 PostSetNeedsCommitToMainThread(); |
76 } | 76 } |
77 | 77 |
(...skipping 20 matching lines...) Expand all Loading... |
98 | 98 |
99 void LayerTreePixelTest::SetupTree() { | 99 void LayerTreePixelTest::SetupTree() { |
100 scoped_refptr<Layer> root = Layer::Create(); | 100 scoped_refptr<Layer> root = Layer::Create(); |
101 root->SetBounds(content_root_->bounds()); | 101 root->SetBounds(content_root_->bounds()); |
102 root->AddChild(content_root_); | 102 root->AddChild(content_root_); |
103 layer_tree_host()->SetRootLayer(root); | 103 layer_tree_host()->SetRootLayer(root); |
104 LayerTreeTest::SetupTree(); | 104 LayerTreeTest::SetupTree(); |
105 } | 105 } |
106 | 106 |
107 } // namespace cc | 107 } // namespace cc |
OLD | NEW |