fix build for linux
partial impl for GPU on linux (need getProcAddress and SkEGLContext)
git-svn-id: http://skia.googlecode.com/svn/trunk@661 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 17ed8e4..e406c79 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -218,9 +218,11 @@
}
// 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 @@
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();