diff options
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | gm/gmmain.cpp | 9 | ||||
-rw-r--r-- | gpu/include/GrGLConfig.h | 10 | ||||
-rw-r--r-- | gpu/src/GrGpuGL.cpp | 4 | ||||
-rw-r--r-- | src/utils/SkEGLContext_none.cpp | 11 |
5 files changed, 31 insertions, 12 deletions
@@ -81,7 +81,7 @@ ifeq ($(SKIA_BUILD_FOR),mac) # CC := gcc-4.0 $(SDK_OPTS) C_INCLUDES += -I/opt/local/include - LINKER_OPTS += -L/opt/local/lib -framework Carbon -lpng12 + LINKER_OPTS += -L/opt/local/lib -framework Carbon -lpng12 -framework OpenGL -framework AGL DEFINES += -DSK_BUILD_FOR_MAC -DSK_ENABLE_LIBPNG C_INCLUDES += -Iinclude/utils/mac @@ -97,8 +97,8 @@ ifeq ($(SKIA_BUILD_FOR),mac) # support files SRC_LIST += src/images/SkScaledBitmapSampler.cpp else - LINKER_OPTS += -lpng -lfreetype - DEFINES += -DSK_BUILD_FOR_UNIX -DSK_ENABLE_LIBPNG + LINKER_OPTS += -lpng -lfreetype -lGL + DEFINES += -DSK_BUILD_FOR_UNIX -DSK_ENABLE_LIBPNG -DGR_LINUX_BUILD=1 # needed for freetype support C_INCLUDES += -I/usr/include/freetype2 @@ -107,6 +107,7 @@ else SRC_LIST += src/ports/SkFontHost_FreeType.cpp SRC_LIST += src/ports/SkFontHost_FreeType_Subpixel.cpp SRC_LIST += src/utils/SkOSFile.cpp + SRC_LIST += src/utils/SkEGLContext_none.cpp # these are our registry-based factories SRC_LIST += src/images/SkImageDecoder_Factory.cpp SRC_LIST += src/images/SkImageEncoder_Factory.cpp @@ -221,7 +222,7 @@ GM_OBJS := $(addprefix out/, $(GM_OBJS)) gm: $(GM_OBJS) out/libskia.a @echo "linking gm..." - $(HIDE)$(GPP) $(GM_OBJS) out/libskia.a -o out/gm/gm -framework OpenGL -framework AGL $(LINKER_OPTS) + $(HIDE)$(GPP) $(GM_OBJS) out/libskia.a -o out/gm/gm $(LINKER_OPTS) SAMPLEPDF_SRCS := samplepdf.cpp diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 17ed8e479f..e406c7955f 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -218,9 +218,11 @@ int main (int argc, char * const argv[]) { } // setup a GL context for drawing offscreen + GrContext* context = NULL; SkEGLContext eglContext; - eglContext.init(1024, 1024); - GrContext* context = GrContext::CreateGLShaderContext(); + if (eglContext.init(1024, 1024)) { + context = GrContext::CreateGLShaderContext(); + } Iter iter; GM* gm; @@ -244,6 +246,9 @@ int main (int argc, char * const argv[]) { SkCanvas canvas(bitmap); if (gRec[i].fUseGPU) { + if (NULL == context) { + continue; + } SkGpuCanvas gc(context); gc.setDevice(gc.createDevice(bitmap.config(), bitmap.width(), bitmap.height(), bitmap.isOpaque(), false))->unref(); diff --git a/gpu/include/GrGLConfig.h b/gpu/include/GrGLConfig.h index 90763abc5c..7fab1b5189 100644 --- a/gpu/include/GrGLConfig.h +++ b/gpu/include/GrGLConfig.h @@ -50,10 +50,12 @@ #ifndef GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES #endif - #define GR_INCLUDE_GLES1 <GLES/gl.h> - #define GR_INCLUDE_GLES1ext <GLES/glext.h> - #define GR_INCLUDE_GLES2 <GLES2/gl2.h> - #define GR_INCLUDE_GLES2ext <GLES2/gl2ext.h> + #define GR_INCLUDE_GLDESKTOP <GL/gl.h> + #define GR_INCLUDE_GLDESKTOPext <GL/glext.h> +// #define GR_INCLUDE_GLES1 <GLES/gl.h> +// #define GR_INCLUDE_GLES1ext <GLES/glext.h> +// #define GR_INCLUDE_GLES2 <GLES2/gl2.h> +// #define GR_INCLUDE_GLES2ext <GLES2/gl2ext.h> #define GR_GL_FUNC #elif GR_QNX_BUILD #ifndef GL_GLEXT_PROTOTYPES diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp index 5198dbbc4e..ebd0d03c20 100644 --- a/gpu/src/GrGpuGL.cpp +++ b/gpu/src/GrGpuGL.cpp @@ -1721,9 +1721,9 @@ void get_gl_proc(const char procName[], glProc *address) { *address = eglGetProcAddress(procName); GrAssert(NULL != *address); #elif GR_LINUX_BUILD - GR_STATIC_ASSERT(!"Add environment-dependent implementation here"); +// GR_STATIC_ASSERT(!"Add environment-dependent implementation here"); //*address = glXGetProcAddressARB(procName); - //*address = eglGetProcAddress(procName); + *address = NULL;//eglGetProcAddress(procName); #elif GR_QNX_BUILD *address = eglGetProcAddress(procName); GrAssert(NULL != *address); diff --git a/src/utils/SkEGLContext_none.cpp b/src/utils/SkEGLContext_none.cpp new file mode 100644 index 0000000000..1c55c95e36 --- /dev/null +++ b/src/utils/SkEGLContext_none.cpp @@ -0,0 +1,11 @@ +#include "SkEGLContext.h" + +SkEGLContext::SkEGLContext() : fContext(NULL) { +} + +SkEGLContext::~SkEGLContext() { +} + +bool SkEGLContext::init(int width, int height) { + return false; +} |