Example #1
0
extern "C" AzSkiaSharedGLContextRef
AzCreateSkiaSharedGLContext(AzGLContext aGLContext, void *extra, AzIntSize *aSize) {
    SkNativeSharedGLContext *sharedGLContext = new SkNativeSharedGLContext(aGLContext, extra);
    if (sharedGLContext == NULL) {
        return NULL;
    }
    if (!sharedGLContext->init(aSize->width, aSize->height)) {
        return NULL;
    }
    return sharedGLContext;
}
Example #2
0
extern "C" AzSkiaSharedGLContextRef
AzCreateSkiaSharedGLContext(AzGLNativeContextRef aNativeContext, AzIntSize *aSize) {
    GrGLNativeContext* nativeContext = reinterpret_cast<GrGLNativeContext*>(aNativeContext);
    SkNativeSharedGLContext *sharedGLContext = new SkNativeSharedGLContext(*nativeContext);
    if (sharedGLContext == NULL) {
        return NULL;
    }
    if (!sharedGLContext->init(aSize->width, aSize->height)) {
        return NULL;
    }
    return sharedGLContext;
}