| Index: cc/test/pixel_test.h
|
| diff --git a/cc/test/pixel_test.h b/cc/test/pixel_test.h
|
| index 148ecf939ecaadf28a94fb74ec3f4ff308ccdfc5..c7dd7aaf94824f5a6d34de3e4c0fbc30909d865c 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_skia_gpu_backend);
|
| void SetUpSoftwareRenderer();
|
|
|
| private:
|
| @@ -57,13 +57,47 @@ class RendererPixelTest : public PixelTest {
|
| return static_cast<RendererType*>(renderer_.get());
|
| }
|
|
|
| + bool UseSkiaGPUBackend() const;
|
| +
|
| protected:
|
| virtual void SetUp() OVERRIDE;
|
| };
|
|
|
| +// A simple wrapper to differentiate a renderer that should use ganesh
|
| +// and one that shouldn't in templates.
|
| +class GLRendererWithSkiaGPUBackend : public GLRenderer {
|
| + public:
|
| + GLRendererWithSkiaGPUBackend(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);
|
| + DCHECK(!renderer()->CanUseSkiaGPUBackend());
|
| +}
|
| +
|
| +template<>
|
| +inline bool RendererPixelTest<GLRenderer>::UseSkiaGPUBackend() const {
|
| + return false;
|
| +}
|
| +
|
| +template<>
|
| +inline void RendererPixelTest<GLRendererWithSkiaGPUBackend>::SetUp() {
|
| + SetUpGLRenderer(true);
|
| + DCHECK(renderer()->CanUseSkiaGPUBackend());
|
| +}
|
| +
|
| +template <>
|
| +inline bool
|
| +RendererPixelTest<GLRendererWithSkiaGPUBackend>::UseSkiaGPUBackend() const {
|
| + return true;
|
| }
|
|
|
| template<>
|
| @@ -71,7 +105,14 @@ inline void RendererPixelTest<SoftwareRenderer>::SetUp() {
|
| SetUpSoftwareRenderer();
|
| }
|
|
|
| +template<>
|
| +inline bool RendererPixelTest<SoftwareRenderer>::UseSkiaGPUBackend() const {
|
| + return false;
|
| +}
|
| +
|
| typedef RendererPixelTest<GLRenderer> GLRendererPixelTest;
|
| +typedef RendererPixelTest<GLRendererWithSkiaGPUBackend>
|
| + GLRendererSkiaGPUBackendPixelTest;
|
| typedef RendererPixelTest<SoftwareRenderer> SoftwareRendererPixelTest;
|
|
|
| } // namespace cc
|
|
|