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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "cc/quads/render_pass.h" |
6 #include "cc/test/pixel_comparator.h" | 7 #include "cc/test/pixel_comparator.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/gfx/size.h" | 9 #include "ui/gfx/size.h" |
9 | 10 |
10 #ifndef CC_TEST_PIXEL_TEST_H_ | 11 #ifndef CC_TEST_PIXEL_TEST_H_ |
11 #define CC_TEST_PIXEL_TEST_H_ | 12 #define CC_TEST_PIXEL_TEST_H_ |
12 | 13 |
13 namespace cc { | 14 namespace cc { |
14 class GLRenderer; | 15 class GLRenderer; |
15 class OutputSurface; | 16 class OutputSurface; |
16 class ResourceProvider; | 17 class ResourceProvider; |
17 | 18 |
18 class PixelTest : public testing::Test { | 19 class PixelTest : public testing::Test { |
19 protected: | 20 protected: |
20 PixelTest(); | 21 PixelTest(); |
21 virtual ~PixelTest(); | 22 virtual ~PixelTest(); |
22 | 23 |
23 virtual void SetUp() OVERRIDE; | 24 virtual void SetUp() OVERRIDE; |
24 | 25 |
25 bool PixelsMatchReference(const base::FilePath& ref_file, | 26 bool RunPixelTest(RenderPassList* pass_list, |
26 const PixelComparator& comparator); | 27 const base::FilePath& ref_file, |
| 28 const PixelComparator& comparator); |
27 | 29 |
28 gfx::Size device_viewport_size_; | 30 gfx::Size device_viewport_size_; |
29 scoped_ptr<OutputSurface> output_surface_; | 31 scoped_ptr<OutputSurface> output_surface_; |
30 scoped_ptr<ResourceProvider> resource_provider_; | 32 scoped_ptr<ResourceProvider> resource_provider_; |
31 class PixelTestRendererClient; | 33 class PixelTestRendererClient; |
32 scoped_ptr<PixelTestRendererClient> fake_client_; | 34 scoped_ptr<PixelTestRendererClient> fake_client_; |
33 scoped_ptr<GLRenderer> renderer_; | 35 scoped_ptr<GLRenderer> renderer_; |
| 36 scoped_ptr<SkBitmap> result_bitmap_; |
| 37 |
| 38 private: |
| 39 void ReadbackResult(scoped_ptr<SkBitmap> bitmap); |
| 40 |
| 41 bool PixelsMatchReference(const base::FilePath& ref_file, |
| 42 const PixelComparator& comparator); |
34 }; | 43 }; |
35 | 44 |
36 } // namespace cc | 45 } // namespace cc |
37 | 46 |
38 #endif // CC_TEST_PIXEL_TEST_H_ | 47 #endif // CC_TEST_PIXEL_TEST_H_ |
OLD | NEW |