aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Test.cpp')
-rw-r--r--tests/Test.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/Test.cpp b/tests/Test.cpp
index 62df73130f..0441ab0fa7 100644
--- a/tests/Test.cpp
+++ b/tests/Test.cpp
@@ -7,9 +7,14 @@
*/
#include "Test.h"
+#include "SkTLazy.h"
+
+#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "gl/SkNativeGLContext.h"
-#include "SkTLazy.h"
+#else
+class GrContext;
+#endif
using namespace skiatest;
@@ -78,6 +83,7 @@ bool Test::run() {
GrContext* GpuTest::GetContext() {
+#if SK_SUPPORT_GPU
// preserve this order, we want gGrContext destroyed after gEGLContext
static SkTLazy<SkNativeGLContext> gGLContext;
static SkAutoTUnref<GrContext> gGrContext;
@@ -93,5 +99,8 @@ GrContext* GpuTest::GetContext() {
gGLContext.get()->makeCurrent();
}
return gGrContext.get();
+#else
+ return NULL;
+#endif
}