Upstream version 11.39.266.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / gpu / gl / iOS / SkNativeGLContext_iOS.mm
index a276fd0..1bdaf70 100644 (file)
@@ -36,13 +36,20 @@ SkNativeGLContext::~SkNativeGLContext() {
 }
 
 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];
     
@@ -61,4 +68,4 @@ void SkNativeGLContext::makeCurrent() const {
     }
 }
 
-void SkNativeGLContext::swapBuffers() const { }
\ No newline at end of file
+void SkNativeGLContext::swapBuffers() const { }