// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "cc/layers/solid_color_layer.h" #include "cc/test/layer_tree_test.h" #ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_ #define CC_TEST_LAYER_TREE_PIXEL_TEST_H_ namespace cc { class LayerTreeHost; class PixelComparator; class LayerTreePixelTest : public LayerTreeTest { protected: LayerTreePixelTest(); virtual ~LayerTreePixelTest(); virtual scoped_ptr CreateOutputSurface() OVERRIDE; virtual scoped_refptr OffscreenContextProviderForMainThread() OVERRIDE; virtual scoped_refptr OffscreenContextProviderForCompositorThread() OVERRIDE; void ReadbackResult(scoped_ptr bitmap); virtual void BeginTest() OVERRIDE; virtual void SetupTree() OVERRIDE; virtual void AfterTest() OVERRIDE; scoped_refptr CreateSolidColorLayer(gfx::Rect rect, SkColor color); scoped_refptr CreateSolidColorLayerWithBorder( gfx::Rect rect, SkColor color, int border_width, SkColor border_color); void RunPixelTest(scoped_refptr content_root, base::FilePath file_name); void RunPixelTestWithReadbackTarget(scoped_refptr content_root, Layer* target, base::FilePath file_name); // Common CSS colors defined for tests to use. enum Colors { kCSSOrange = 0xffffa500, kCSSBrown = 0xffa52a2a, kCSSGreen = 0xff008000, }; scoped_ptr pixel_comparator_; private: scoped_refptr content_root_; Layer* readback_target_; base::FilePath ref_file_; }; } // namespace cc #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_