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/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/memory/scoped_ptr.h" |
6 #include "cc/layers/solid_color_layer.h" | 8 #include "cc/layers/solid_color_layer.h" |
7 #include "cc/test/layer_tree_test.h" | 9 #include "cc/test/layer_tree_test.h" |
8 | 10 |
9 #ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | 11 #ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
10 #define CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | 12 #define CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
11 | 13 |
12 namespace cc { | 14 namespace cc { |
13 class LayerTreeHost; | 15 class LayerTreeHost; |
| 16 class PixelComparator; |
14 | 17 |
15 class LayerTreePixelTest : public LayerTreeTest { | 18 class LayerTreePixelTest : public LayerTreeTest { |
16 protected: | 19 protected: |
17 LayerTreePixelTest(); | 20 LayerTreePixelTest(); |
18 virtual ~LayerTreePixelTest(); | 21 virtual ~LayerTreePixelTest(); |
19 | 22 |
20 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE; | 23 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE; |
21 virtual scoped_refptr<cc::ContextProvider> | 24 virtual scoped_refptr<cc::ContextProvider> |
22 OffscreenContextProviderForMainThread() OVERRIDE; | 25 OffscreenContextProviderForMainThread() OVERRIDE; |
23 virtual scoped_refptr<cc::ContextProvider> | 26 virtual scoped_refptr<cc::ContextProvider> |
24 OffscreenContextProviderForCompositorThread() OVERRIDE; | 27 OffscreenContextProviderForCompositorThread() OVERRIDE; |
25 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, | 28 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, |
26 bool result) OVERRIDE; | 29 bool result) OVERRIDE; |
27 | 30 |
28 virtual void BeginTest() OVERRIDE; | 31 virtual void BeginTest() OVERRIDE; |
29 virtual void SetupTree() OVERRIDE; | 32 virtual void SetupTree() OVERRIDE; |
30 virtual void AfterTest() OVERRIDE; | 33 virtual void AfterTest() OVERRIDE; |
31 | 34 |
32 scoped_refptr<SolidColorLayer> CreateSolidColorLayer(gfx::Rect rect, | 35 scoped_refptr<SolidColorLayer> CreateSolidColorLayer(gfx::Rect rect, |
33 SkColor color); | 36 SkColor color); |
| 37 scoped_refptr<SolidColorLayer> CreateSolidColorLayerWithBorder( |
| 38 gfx::Rect rect, |
| 39 SkColor color, |
| 40 int border_width, |
| 41 SkColor border_color); |
34 | 42 |
35 void RunPixelTest(scoped_refptr<Layer> content_root, | 43 void RunPixelTest(scoped_refptr<Layer> content_root, |
36 base::FilePath file_name); | 44 base::FilePath file_name); |
37 | 45 |
38 // Common CSS colors defined for tests to use. | 46 // Common CSS colors defined for tests to use. |
39 enum Colors { | 47 enum Colors { |
40 kCSSOrange = 0xffffa500, | 48 kCSSOrange = 0xffffa500, |
41 kCSSBrown = 0xffa52a2a, | 49 kCSSBrown = 0xffa52a2a, |
42 kCSSGreen = 0xff008000, | 50 kCSSGreen = 0xff008000, |
43 }; | 51 }; |
44 | 52 |
| 53 scoped_ptr<PixelComparator> pixel_comparator_; |
| 54 |
45 private: | 55 private: |
46 scoped_refptr<Layer> content_root_; | 56 scoped_refptr<Layer> content_root_; |
47 base::FilePath ref_file_; | 57 base::FilePath ref_file_; |
48 }; | 58 }; |
49 | 59 |
50 } // namespace cc | 60 } // namespace cc |
51 | 61 |
52 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | 62 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
OLD | NEW |