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

Unified Diff: cc/test/pixel_test.h

Issue 13863015: Add flag for drawing layers to screen with Ganesh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again Created 7 years, 7 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/resources/tile_manager.cc ('k') | cc/test/pixel_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | cc/test/pixel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698