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_
16 class PixelComparator
;
18 class LayerTreePixelTest
: public LayerTreeTest
{
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
,
37 scoped_refptr
<SolidColorLayer
> CreateSolidColorLayerWithBorder(
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.
48 kCSSOrange
= 0xffffa500,
49 kCSSBrown
= 0xffa52a2a,
50 kCSSGreen
= 0xff008000,
53 scoped_ptr
<PixelComparator
> pixel_comparator_
;
56 scoped_refptr
<Layer
> content_root_
;
57 base::FilePath ref_file_
;
62 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_