allow SkUserConfig.h to control NOGPU

BUG=skia:

Review URL: https://codereview.chromium.org/685243002
diff --git a/gm/discard.cpp b/gm/discard.cpp
index ce89e98..ff8fe4a 100644
--- a/gm/discard.cpp
+++ b/gm/discard.cpp
@@ -5,14 +5,14 @@
  * found in the LICENSE file.
  */
 
-#if SK_SUPPORT_GPU
-
 #include "gm.h"
 #include "SkCanvas.h"
 #include "SkColorShader.h"
 #include "SkPaint.h"
 #include "SkSurface.h"
 
+#if SK_SUPPORT_GPU
+
 namespace skiagm {
 
 /*
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 0dc626c..35c3ab5 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -43,6 +43,8 @@
 #include "SkXfermode.h"
 #include "SkErrorInternals.h"
 
+#if SK_SUPPORT_GPU
+
 enum { kDefaultImageFilterCacheSize = 32 * 1024 * 1024 };
 
 #define CACHE_COMPATIBLE_DEVICE_TEXTURES 1
@@ -1855,3 +1857,5 @@
     // filter traversal.
     return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
 }
+
+#endif
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index c7ebe0e..3e1eb94 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -10,6 +10,8 @@
 #include "SkCanvas.h"
 #include "SkGpuDevice.h"
 
+#if SK_SUPPORT_GPU
+
 class SkSurface_Gpu : public SkSurface_Base {
 public:
     SK_DECLARE_INST_COUNT(SkSurface_Gpu)
@@ -154,3 +156,5 @@
 
     return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true));
 }
+
+#endif
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp
index 7b6a05d..6bcc51f 100644
--- a/tests/ReadWriteAlphaTest.cpp
+++ b/tests/ReadWriteAlphaTest.cpp
@@ -5,12 +5,13 @@
  * found in the LICENSE file.
  */
 
+#include "Test.h"
+
 // This test is specific to the GPU backend.
 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID)
 
 #include "GrContextFactory.h"
 #include "SkGpuDevice.h"
-#include "Test.h"
 
 static const int X_SIZE = 12;
 static const int Y_SIZE = 12;