| 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 |
| 26 bool RunPixelTest(RenderPassList* pass_list, |
| 27 const base::FilePath& ref_file, |
| 28 const PixelComparator& comparator); |
| 29 |
| 30 void ReadbackResult(scoped_ptr<SkBitmap> bitmap); |
| 31 |
| 25 bool PixelsMatchReference(const base::FilePath& ref_file, | 32 bool PixelsMatchReference(const base::FilePath& ref_file, |
| 26 const PixelComparator& comparator); | 33 const PixelComparator& comparator); |
| 27 | 34 |
| 28 gfx::Size device_viewport_size_; | 35 gfx::Size device_viewport_size_; |
| 29 scoped_ptr<OutputSurface> output_surface_; | 36 scoped_ptr<OutputSurface> output_surface_; |
| 30 scoped_ptr<ResourceProvider> resource_provider_; | 37 scoped_ptr<ResourceProvider> resource_provider_; |
| 31 class PixelTestRendererClient; | 38 class PixelTestRendererClient; |
| 32 scoped_ptr<PixelTestRendererClient> fake_client_; | 39 scoped_ptr<PixelTestRendererClient> fake_client_; |
| 33 scoped_ptr<GLRenderer> renderer_; | 40 scoped_ptr<GLRenderer> renderer_; |
| 41 scoped_ptr<SkBitmap> result_bitmap_; |
| 34 }; | 42 }; |
| 35 | 43 |
| 36 } // namespace cc | 44 } // namespace cc |
| 37 | 45 |
| 38 #endif // CC_TEST_PIXEL_TEST_H_ | 46 #endif // CC_TEST_PIXEL_TEST_H_ |
| OLD | NEW |