}
void SkNativeGLContext::destroyGLContext() {
- if ([EAGLContext currentContext] == EAGLCTX) {
- [EAGLContext setCurrentContext:nil];
+ if (fEAGLContext) {
+ if ([EAGLContext currentContext] == EAGLCTX) {
+ [EAGLContext setCurrentContext:nil];
+ }
+ [EAGLCTX release];
+ fEAGLContext = NULL;
}
- [EAGLCTX release];
}
-const GrGLInterface* SkNativeGLContext::createGLContext() {
+const GrGLInterface* SkNativeGLContext::createGLContext(GrGLStandard forcedGpuAPI) {
+ if (kGL_GrGLStandard == forcedGpuAPI) {
+ return NULL;
+ }
+
fEAGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
[EAGLContext setCurrentContext:EAGLCTX];
}
}
-void SkNativeGLContext::swapBuffers() const { }
\ No newline at end of file
+void SkNativeGLContext::swapBuffers() const { }