OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/files/file_path.h" | |
6 #include "cc/solid_color_layer.h" | |
7 #include "cc/test/layer_tree_test_common.h" | |
8 | |
9 #ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | |
10 #define CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | |
11 | |
12 namespace cc { | |
13 class LayerTreeHost; | |
14 | |
15 class LayerTreePixelTest : public ThreadedTest { | |
16 protected: | |
17 LayerTreePixelTest(); | |
18 virtual ~LayerTreePixelTest(); | |
19 | |
20 bool RunTest(scoped_refptr<Layer> root_layer, | |
21 const base::FilePath::StringType& file_name); | |
22 | |
23 virtual scoped_ptr<OutputSurface> createOutputSurface() OVERRIDE; | |
24 virtual scoped_refptr<cc::ContextProvider> | |
25 OffscreenContextProviderForMainThread() OVERRIDE; | |
26 virtual scoped_refptr<cc::ContextProvider> | |
27 OffscreenContextProviderForCompositorThread() OVERRIDE; | |
28 virtual void swapBuffersOnThread(LayerTreeHostImpl* host_impl, | |
29 bool result) OVERRIDE; | |
30 | |
31 virtual void beginTest() OVERRIDE; | |
32 virtual void setupTree() OVERRIDE; | |
33 virtual void afterTest() OVERRIDE; | |
34 | |
35 scoped_refptr<SolidColorLayer> CreateSolidColorLayer(gfx::Rect rect, | |
36 SkColor color); | |
37 | |
38 void RunPixelTest(scoped_refptr<Layer> content_root, | |
39 base::FilePath file_name); | |
40 | |
41 // Common CSS colors defined for tests to use. | |
jamesr
2013/03/14 20:00:46
third_party/skia/include/core/SkColor already has
danakj
2013/03/14 20:43:50
Yeh, these colors are not the same as web colors a
| |
42 enum Colors { | |
43 kTransparent = 0x00000000, | |
44 kBlack = 0xff000000, | |
45 kRed = 0xffff0000, | |
46 kCyan = 0xff00ffff, | |
47 kBlue = 0xff0000ff, | |
48 kYellow = 0xffffff00, | |
49 kOrange = 0xffffa500, | |
50 kBrown = 0xffa52a2a, | |
51 kGreen = 0xff008000, | |
52 }; | |
53 | |
54 private: | |
55 scoped_refptr<Layer> content_root_; | |
56 base::FilePath ref_file_; | |
57 }; | |
58 | |
59 } // namespace cc | |
60 | |
61 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | |
OLD | NEW |