aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-10-30 11:34:15 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-30 11:34:15 -0700
commitf037e0bf138a4e842f39e19864d05010a54950c9 (patch)
tree8065bc69d569ef1deba83f6797412343510474cb
parent6374f57d77044b4c9260e50f7983d6f418e852d5 (diff)
allow SkUserConfig.h to control NOGPU
-rw-r--r--gm/discard.cpp4
-rw-r--r--src/gpu/SkGpuDevice.cpp4
-rw-r--r--src/image/SkSurface_Gpu.cpp4
-rw-r--r--tests/ReadWriteAlphaTest.cpp3
4 files changed, 12 insertions, 3 deletions
diff --git a/gm/discard.cpp b/gm/discard.cpp
index ce89e98507..ff8fe4a4b8 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 0dc626cd66..35c3ab532d 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 @@ SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
// filter traversal.
return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
}
+
+#endif
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index c7ebe0ebe1..3e1eb9452b 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 @@ SkSurface* SkSurface::NewScratchRenderTarget(GrContext* ctx, const SkImageInfo&
return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true));
}
+
+#endif
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp
index 7b6a05d299..6bcc51faf2 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;