diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-02 14:03:32 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-02 14:03:32 +0000 |
commit | cf8fb1f6f03fc77f9927564f9ef9abeeeec508d2 (patch) | |
tree | 7534f5f2edd97cd61f18ee35ae4a14407a53453e /include | |
parent | f2a9e58858423be9cbfa72e01e8284754e7d6381 (diff) |
Create GPU-less build of Skia.
git-svn-id: http://skia.googlecode.com/svn/trunk@4912 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/config/SkUserConfig.h | 9 | ||||
-rw-r--r-- | include/core/SkPostConfig.h | 4 | ||||
-rw-r--r-- | include/views/SkOSWindow_Mac.h | 4 | ||||
-rw-r--r-- | include/views/SkOSWindow_Win.h | 12 |
4 files changed, 26 insertions, 3 deletions
diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h index b180c89fa8..b51a801626 100644 --- a/include/config/SkUserConfig.h +++ b/include/config/SkUserConfig.h @@ -176,4 +176,13 @@ #define SK_A32_SHIFT 24 #endif + +/* Determines whether to build code that supports the GPU backend. Some classes + that are not GPU-specific, such as SkShader subclasses, have optional code + that is used allows them to interact with the GPU backend. If you'd like to + omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu + directories from your include search path when you're not building the GPU + backend. Defaults to 1 (build the GPU code). + */ +//#define SK_SUPPORT_GPU 1 #endif diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h index 9130a3a4f4..cc00f7925a 100644 --- a/include/core/SkPostConfig.h +++ b/include/core/SkPostConfig.h @@ -55,6 +55,10 @@ #endif #endif +#if !defined(SK_SUPPORT_GPU) + #define SK_SUPPORT_GPU 1 +#endif + /** * The clang static analyzer likes to know that when the program is not * expected to continue (crash, assertion failure, etc). It will notice that diff --git a/include/views/SkOSWindow_Mac.h b/include/views/SkOSWindow_Mac.h index e3bcea9081..3391785ef9 100644 --- a/include/views/SkOSWindow_Mac.h +++ b/include/views/SkOSWindow_Mac.h @@ -21,7 +21,9 @@ public: void* owner); enum SkBackEndTypes { kNone_BackEndType, +#if SK_SUPPORT_GPU kNativeGL_BackEndType, +#endif }; void detach(); @@ -42,7 +44,9 @@ private: void* fHWND; bool fInvalEventIsPending; void* fNotifier; +#if SK_SUPPORT_GPU void* fGLContext; +#endif typedef SkWindow INHERITED; }; diff --git a/include/views/SkOSWindow_Win.h b/include/views/SkOSWindow_Win.h index f61c80a6b0..5add420803 100644 --- a/include/views/SkOSWindow_Win.h +++ b/include/views/SkOSWindow_Win.h @@ -29,10 +29,12 @@ public: enum SkBackEndTypes { kNone_BackEndType, +#if SK_SUPPORT_GPU kNativeGL_BackEndType, #if SK_ANGLE kANGLE_BackEndType, -#endif +#endif // SK_ANGLE +#endif // SK_SUPPORT_GPU }; bool attach(SkBackEndTypes attachType, int msaaSampleCount); @@ -62,17 +64,20 @@ private: void doPaint(void* ctx); +#if SK_SUPPORT_GPU void* fHGLRC; #if SK_ANGLE EGLDisplay fDisplay; EGLContext fContext; EGLSurface fSurface; -#endif +#endif // SK_ANGLE +#endif // SK_SUPPORT_GPU HMENU fMBar; SkBackEndTypes fAttached; +#if SK_SUPPORT_GPU bool attachGL(int msaaSampleCount); void detachGL(); void presentGL(); @@ -81,7 +86,8 @@ private: bool attachANGLE(int msaaSampleCount); void detachANGLE(); void presentANGLE(); -#endif +#endif // SK_ANGLE +#endif // SK_SUPPORT_GPU typedef SkWindow INHERITED; }; |