Fix build break
[chromium-blink-merge.git] / cc / test / layer_tree_pixel_test.h
blobceddfab81e380e208e65c59f401da92b7cbf0d37
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.
5 #include "base/files/file_path.h"
6 #include "base/memory/ref_counted.h"
7 #include "base/memory/scoped_ptr.h"
8 #include "cc/layers/solid_color_layer.h"
9 #include "cc/test/layer_tree_test.h"
11 #ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_
12 #define CC_TEST_LAYER_TREE_PIXEL_TEST_H_
14 namespace cc {
15 class LayerTreeHost;
16 class PixelComparator;
18 class LayerTreePixelTest : public LayerTreeTest {
19 protected:
20 LayerTreePixelTest();
21 virtual ~LayerTreePixelTest();
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;
31 virtual void BeginTest() OVERRIDE;
32 virtual void SetupTree() OVERRIDE;
33 virtual void AfterTest() OVERRIDE;
35 scoped_refptr<SolidColorLayer> CreateSolidColorLayer(gfx::Rect rect,
36 SkColor color);
37 scoped_refptr<SolidColorLayer> CreateSolidColorLayerWithBorder(
38 gfx::Rect rect,
39 SkColor color,
40 int border_width,
41 SkColor border_color);
43 void RunPixelTest(scoped_refptr<Layer> content_root,
44 base::FilePath file_name);
46 // Common CSS colors defined for tests to use.
47 enum Colors {
48 kCSSOrange = 0xffffa500,
49 kCSSBrown = 0xffa52a2a,
50 kCSSGreen = 0xff008000,
53 scoped_ptr<PixelComparator> pixel_comparator_;
55 private:
56 scoped_refptr<Layer> content_root_;
57 base::FilePath ref_file_;
60 } // namespace cc
62 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_