Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4442)

Unified Diff: cc/test/layer_tree_pixel_test.h

Issue 12518026: cc: Add layer-based pixel tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_host_pixeltest_filters.cc ('k') | cc/test/layer_tree_pixel_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_pixel_test.h
diff --git a/cc/test/layer_tree_pixel_test.h b/cc/test/layer_tree_pixel_test.h
new file mode 100644
index 0000000000000000000000000000000000000000..4682d9e6b23b256574d51f6835c6044a0a8b4dd5
--- /dev/null
+++ b/cc/test/layer_tree_pixel_test.h
@@ -0,0 +1,55 @@
+// 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 "cc/solid_color_layer.h"
+#include "cc/test/layer_tree_test_common.h"
+
+#ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_
+#define CC_TEST_LAYER_TREE_PIXEL_TEST_H_
+
+namespace cc {
+class LayerTreeHost;
+
+class LayerTreePixelTest : public ThreadedTest {
+ protected:
+ LayerTreePixelTest();
+ virtual ~LayerTreePixelTest();
+
+ bool RunTest(scoped_refptr<Layer> root_layer,
+ const base::FilePath::StringType& file_name);
+
+ virtual scoped_ptr<OutputSurface> createOutputSurface() OVERRIDE;
+ virtual scoped_refptr<cc::ContextProvider>
+ OffscreenContextProviderForMainThread() OVERRIDE;
+ virtual scoped_refptr<cc::ContextProvider>
+ OffscreenContextProviderForCompositorThread() OVERRIDE;
+ virtual void swapBuffersOnThread(LayerTreeHostImpl* host_impl,
+ bool result) OVERRIDE;
+
+ virtual void beginTest() OVERRIDE;
+ virtual void setupTree() OVERRIDE;
+ virtual void afterTest() OVERRIDE;
+
+ scoped_refptr<SolidColorLayer> CreateSolidColorLayer(gfx::Rect rect,
+ SkColor color);
+
+ void RunPixelTest(scoped_refptr<Layer> content_root,
+ base::FilePath file_name);
+
+ // Common CSS colors defined for tests to use.
+ enum Colors {
+ kCSSOrange = 0xffffa500,
+ kCSSBrown = 0xffa52a2a,
+ kCSSGreen = 0xff008000,
+ };
+
+ private:
+ scoped_refptr<Layer> content_root_;
+ base::FilePath ref_file_;
+};
+
+} // namespace cc
+
+#endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_
« no previous file with comments | « cc/layer_tree_host_pixeltest_filters.cc ('k') | cc/test/layer_tree_pixel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698