make GR_TEST_UTILS=0 work

Change-Id: Icce35140ca08b65217b32e6b1ffc6ad2f38ab37f
Reviewed-on: https://skia-review.googlesource.com/7840
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index e6d738d..19f190e 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -93,9 +93,11 @@
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(BigKeyProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> BigKeyProcessor::TestCreate(GrProcessorTestData*) {
     return BigKeyProcessor::Make();
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -164,6 +166,7 @@
     return renderTargetContext;
 }
 
+#if GR_TEST_UTILS
 static void set_random_xpf(GrPaint* paint, GrProcessorTestData* d) {
     paint->setXPFactory(GrXPFactoryTestFactory::Get(d));
 }
@@ -281,7 +284,11 @@
         return &kDoesNotWriteStencil;
     }
 }
+#endif
 
+#if !GR_TEST_UTILS
+bool GrDrawingManager::ProgramUnitTest(GrContext*, int) { return true; }
+#else
 bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
     GrDrawingManager* drawingManager = context->contextPriv().drawingManager();
 
@@ -378,6 +385,7 @@
 
     return true;
 }
+#endif
 
 static int get_glprograms_max_stages(GrContext* context) {
     GrGLGpu* gpu = static_cast<GrGLGpu*>(context->getGpu());
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index ff31e49..a23b40a 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -244,6 +244,7 @@
 
 static GrColor4f texel_color4f(int i, int j) { return GrColor4f::FromGrColor(texel_color(i, j)); }
 
+#if GR_TEST_UTILS
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, reporter, ctxInfo) {
     // This tests code under development but not used in skia lib. Leaving this disabled until
     // some platform-specific issues are addressed.
@@ -370,6 +371,6 @@
         }
     }
 }
-#endif
-
-#endif
+#endif  // GR_TEST_UTILS
+#endif  // SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
+#endif  // SK_SUPPORT_GPU