else
LINKER_OPTS += -lpng -lfreetype -lrt
- DEFINES += -DSK_BUILD_FOR_UNIX -DSK_ENABLE_LIBPNG -DGR_LINUX_BUILD=1
+ DEFINES += -DSK_BUILD_FOR_UNIX -DSK_ENABLE_LIBPNG
ifeq ($(SKIA_MESA),true)
LINKER_OPTS += -lOSMesa -lGLU
DEFINES += -DSK_MESA
'sources/': [ ['exclude', '_nacl.(h|cpp)$'],
],
}],
- [ 'skia_os == "android"', {
- 'defines': [
- 'GR_ANDROID_BUILD=1',
- ],
- }],
- [ 'skia_os == "mac"', {
- 'defines': [
- 'GR_MAC_BUILD=1',
- ],
- }],
- [ 'skia_os == "linux" or skia_os == "chromeos"', {
- 'defines': [
- 'GR_LINUX_BUILD=1',
- ],
- }],
- [ 'skia_os == "ios"', {
- 'defines': [
- 'GR_IOS_BUILD=1',
- ],
- }],
- [ 'skia_os == "win"', {
- 'defines': [
- 'GR_WIN32_BUILD=1',
- ],
- }],
# nullify the targets in this gyp file if skia_gpu is 0
[ 'skia_gpu == 0', {
'sources/': [
],
'direct_dependent_settings': {
'conditions': [
- [ 'skia_os == "android"', {
- 'defines': [
- 'GR_ANDROID_BUILD=1',
- ],
- }],
- [ 'skia_os == "mac"', {
- 'defines': [
- 'GR_MAC_BUILD=1',
- ],
- }],
- [ 'skia_os == "linux"', {
- 'defines': [
- 'GR_LINUX_BUILD=1',
- ],
- }],
- [ 'skia_os == "ios"', {
- 'defines': [
- 'GR_IOS_BUILD=1',
- ],
- }],
[ 'skia_os == "win"', {
'defines': [
- 'GR_WIN32_BUILD=1',
'GR_GL_FUNCTION_TYPE=__stdcall',
],
}],
* Gr defines are set to 0 or 1, rather than being undefined or defined
*/
-#if !defined(GR_ANDROID_BUILD)
- #define GR_ANDROID_BUILD 0
-#endif
-#if !defined(GR_IOS_BUILD)
- #define GR_IOS_BUILD 0
-#endif
-#if !defined(GR_LINUX_BUILD)
- #define GR_LINUX_BUILD 0
-#endif
-#if !defined(GR_MAC_BUILD)
- #define GR_MAC_BUILD 0
-#endif
-#if !defined(GR_WIN32_BUILD)
- #define GR_WIN32_BUILD 0
-#endif
-#if !defined(GR_QNX_BUILD)
- #define GR_QNX_BUILD 0
-#endif
#if !defined(GR_CACHE_STATS)
#define GR_CACHE_STATS 0
#endif
-/**
- * If no build target has been defined, attempt to infer.
- */
-#if !GR_ANDROID_BUILD && !GR_IOS_BUILD && !GR_LINUX_BUILD && !GR_MAC_BUILD && !GR_WIN32_BUILD && !GR_QNX_BUILD
- #if defined(_WIN32)
- #undef GR_WIN32_BUILD
- #define GR_WIN32_BUILD 1
-// #error "WIN"
- #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
- #undef GR_IOS_BUILD
- #define GR_IOS_BUILD 1
-// #error "IOS"
- #elif defined(SK_BUILD_FOR_ANDROID)
- #undef GR_ANDROID_BUILD
- #define GR_ANDROID_BUILD 1
-// #error "ANDROID"
- #elif TARGET_OS_MAC
- #undef GR_MAC_BUILD
- #define GR_MAC_BUILD 1
-// #error "MAC"
- #elif TARGET_OS_QNX || defined(__QNXNTO__)
- #undef GR_QNX_BUILD
- #define GR_QNX_BUILD 1
-// #error "QNX"
- #else
- #undef GR_LINUX_BUILD
- #define GR_LINUX_BUILD 1
-// #error "LINUX"
- #endif
-#endif
-
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-#if GR_WIN32_BUILD
+#if defined(SK_BUILD_FOR_WIN32)
// VC8 doesn't support stdint.h, so we define those types here.
typedef signed char int8_t;
typedef unsigned char uint8_t;
* GR_ALWAYSBREAK is an unconditional break in all builds.
*/
#if !defined(GR_ALWAYSBREAK)
- #if GR_WIN32_BUILD
+ #if defined(SK_BUILD_FOR_WIN32)
#define GR_ALWAYSBREAK SkNO_RETURN_HINT(); __debugbreak()
#else
// TODO: do other platforms really not have continuable breakpoints?
#define GR_STROKE_PATH_RENDERING 0
#endif
-///////////////////////////////////////////////////////////////////////////////
-// tail section:
-//
-// Now we just assert if we are missing some required define, or if we detect
-// and inconsistent combination of defines
-//
-
-
-/**
- * Only one build target macro should be 1 and the rest should be 0.
- */
-#define GR_BUILD_SUM (GR_WIN32_BUILD + GR_MAC_BUILD + GR_IOS_BUILD + GR_ANDROID_BUILD + GR_LINUX_BUILD + GR_QNX_BUILD)
-#if 0 == GR_BUILD_SUM
- #error "Missing a GR_BUILD define"
-#elif 1 != GR_BUILD_SUM
- #error "More than one GR_BUILD defined"
-#endif
-
-#if 0
-#if GR_WIN32_BUILD
-// #pragma message GR_WARN("GR_WIN32_BUILD")
-#endif
-#if GR_MAC_BUILD
-// #pragma message GR_WARN("GR_MAC_BUILD")
-#endif
-#if GR_IOS_BUILD
-// #pragma message GR_WARN("GR_IOS_BUILD")
-#endif
-#if GR_ANDROID_BUILD
-// #pragma message GR_WARN("GR_ANDROID_BUILD")
-#endif
-#if GR_LINUX_BUILD
-// #pragma message GR_WARN("GR_LINUX_BUILD")
-#endif
-#if GR_QNX_BUILD
-// #pragma message GR_WARN("GR_QNX_BUILD")
-#endif
-#endif
-
#endif
* OS/driver level fix.
*/
#define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND \
- (GR_MAC_BUILD && \
+ (defined(SK_BUILD_FOR_MAC) && \
!GR_GL_USE_BUFFER_DATA_NULL_HINT)
#endif
// glGetError() forces a sync with gpu process on chrome
#define GR_GL_CHECK_ERROR_START 0
+#if defined(SK_BUILD_FOR_WIN32)
// ANGLE creates a temp VB for vertex attributes not specified per-vertex.
-#define GR_GL_NO_CONSTANT_ATTRIBUTES GR_WIN32_BUILD
+#define GR_GL_NO_CONSTANT_ATTRIBUTES 1
// For RGBA teximage/readpixels ANGLE will sw-convert to/from BGRA.
-#define GR_GL_RGBA_8888_PIXEL_OPS_SLOW GR_WIN32_BUILD
+#define GR_GL_RGBA_8888_PIXEL_OPS_SLOW 1
// ANGLE can go faster if the entire fbo is read rather than a subrect
-#define GR_GL_FULL_READPIXELS_FASTER_THAN_PARTIAL GR_WIN32_BUILD
+#define GR_GL_FULL_READPIXELS_FASTER_THAN_PARTIAL 1
+#else
+#define GR_GL_NO_CONSTANT_ATTRIBUTES 0
+#define GR_GL_RGBA_8888_PIXEL_OPS_SLOW 0
+#define GR_GL_FULL_READPIXELS_FASTER_THAN_PARTIAL 0
+#endif
// cmd buffer allocates memory and memsets it to zero when it sees glBufferData
// with NULL.
// We expect to be at least as fast or faster since it doesn't use an intermediate texture as
// we do below.
-#if !GR_MAC_BUILD
+#if !defined(SK_BUILD_FOR_MAC)
// At least some drivers on the Mac get confused when glTexImage2D is called on a texture
// attached to an FBO. The FBO still sees the old image. TODO: determine what OS versions and/or
// HW is affected.
#define SWAP_PER_DRAW 0
#if SWAP_PER_DRAW
- #if GR_MAC_BUILD
+ #if defined(SK_BUILD_FOR_MAC)
#include <AGL/agl.h>
- #elif GR_WIN32_BUILD
+ #elif defined(SK_BUILD_FOR_WIN32)
#include <gl/GL.h>
void SwapBuf() {
DWORD procID = GetCurrentProcessId();
}
#if SWAP_PER_DRAW
glFlush();
- #if GR_MAC_BUILD
+ #if defined(SK_BUILD_FOR_MAC)
aglSwapBuffers(aglGetCurrentContext());
int set_a_break_pt_here = 9;
aglSwapBuffers(aglGetCurrentContext());
- #elif GR_WIN32_BUILD
+ #elif defined(SK_BUILD_FOR_WIN32)
SwapBuf();
int set_a_break_pt_here = 9;
SwapBuf();