| Index: cc/test/pixel_test.h
|
| diff --git a/cc/test/pixel_test.h b/cc/test/pixel_test.h
|
| index 148ecf939ecaadf28a94fb74ec3f4ff308ccdfc5..24b62e19d1167d0205adae598e5354c0b9b83b66 100644
|
| --- a/cc/test/pixel_test.h
|
| +++ b/cc/test/pixel_test.h
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/file_util.h"
|
| +#include "cc/output/gl_renderer.h"
|
| #include "cc/quads/render_pass.h"
|
| #include "cc/test/pixel_comparator.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -13,7 +14,6 @@
|
|
|
| namespace cc {
|
| class DirectRenderer;
|
| -class GLRenderer;
|
| class SoftwareRenderer;
|
| class OutputSurface;
|
| class ResourceProvider;
|
| @@ -40,7 +40,7 @@ class PixelTest : public testing::Test {
|
| scoped_ptr<DirectRenderer> renderer_;
|
| scoped_ptr<SkBitmap> result_bitmap_;
|
|
|
| - void SetUpGLRenderer();
|
| + void SetUpGLRenderer(bool use_ganesh);
|
| void SetUpSoftwareRenderer();
|
|
|
| private:
|
| @@ -57,13 +57,44 @@ class RendererPixelTest : public PixelTest {
|
| return static_cast<RendererType*>(renderer_.get());
|
| }
|
|
|
| + bool UseGanesh() const;
|
| +
|
| protected:
|
| - virtual void SetUp() OVERRIDE;
|
| + void SetUp();
|
| +};
|
| +
|
| +// A simple wrapper to differentiate a renderer that should use ganesh
|
| +// and one that shouldn't in templates.
|
| +class GLRendererWithGanesh : public GLRenderer {
|
| + public:
|
| + GLRendererWithGanesh(RendererClient* client,
|
| + OutputSurface* output_surface,
|
| + ResourceProvider* resource_provider,
|
| + int highp_threshold_min)
|
| + : GLRenderer(client,
|
| + output_surface,
|
| + resource_provider,
|
| + highp_threshold_min) {}
|
| };
|
|
|
| template<>
|
| inline void RendererPixelTest<GLRenderer>::SetUp() {
|
| - SetUpGLRenderer();
|
| + SetUpGLRenderer(false);
|
| +}
|
| +
|
| +template<>
|
| +inline bool RendererPixelTest<GLRenderer>::UseGanesh() const {
|
| + return false;
|
| +}
|
| +
|
| +template<>
|
| +inline void RendererPixelTest<GLRendererWithGanesh>::SetUp() {
|
| + SetUpGLRenderer(true);
|
| +}
|
| +
|
| +template<>
|
| +inline bool RendererPixelTest<GLRendererWithGanesh>::UseGanesh() const {
|
| + return true;
|
| }
|
|
|
| template<>
|
| @@ -71,7 +102,13 @@ inline void RendererPixelTest<SoftwareRenderer>::SetUp() {
|
| SetUpSoftwareRenderer();
|
| }
|
|
|
| +template<>
|
| +inline bool RendererPixelTest<SoftwareRenderer>::UseGanesh() const {
|
| + return false;
|
| +}
|
| +
|
| typedef RendererPixelTest<GLRenderer> GLRendererPixelTest;
|
| +typedef RendererPixelTest<GLRendererWithGanesh> GLRendererGaneshPixelTest;
|
| typedef RendererPixelTest<SoftwareRenderer> SoftwareRendererPixelTest;
|
|
|
| } // namespace cc
|
|
|