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. |
| 42 enum Colors { |
| 43 kCSSOrange = 0xffffa500, |
| 44 kCSSBrown = 0xffa52a2a, |
| 45 kCSSGreen = 0xff008000, |
| 46 }; |
| 47 |
| 48 private: |
| 49 scoped_refptr<Layer> content_root_; |
| 50 base::FilePath ref_file_; |
| 51 }; |
| 52 |
| 53 } // namespace cc |
| 54 |
| 55 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
OLD | NEW |