Пример #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;
}
Пример #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;
}
Пример #3
0
extern "C" AzDrawTargetRef
AzCreateSkiaDrawTargetForFBO(AzSkiaSharedGLContextRef aGLContext, AzIntSize *aSize, AzSurfaceFormat aFormat) {
    SkNativeSharedGLContext *sharedGLContext = static_cast<SkNativeSharedGLContext*>(aGLContext);
    GrContext *grContext = sharedGLContext->getGrContext();
    grContext->AddRef();
    gfx::IntSize *size = reinterpret_cast<gfx::IntSize*>(aSize);
    gfx::SurfaceFormat surfaceFormat = static_cast<gfx::SurfaceFormat>(aFormat);
    RefPtr<gfx::DrawTarget> target = gfx::Factory::CreateSkiaDrawTargetForFBO(sharedGLContext->getFBOID(),
                                                                              grContext,
                                                                              *size,
                                                                              surfaceFormat);
    target->AddRef();
    return target;
}
Пример #4
0
extern "C" void
AzSkiaSharedGLContextFlush(AzSkiaSharedGLContextRef aGLContext) {
    SkNativeSharedGLContext *sharedGLContext = static_cast<SkNativeSharedGLContext*>(aGLContext);
    sharedGLContext->flush();
}
Пример #5
0
extern "C" void
AzSkiaSharedGLContextMakeCurrent(AzSkiaSharedGLContextRef aGLContext) {
    SkNativeSharedGLContext *sharedGLContext = static_cast<SkNativeSharedGLContext*>(aGLContext);
    sharedGLContext->makeCurrent();
}
Пример #6
0
extern "C" AzSkiaGrContextRef
AzSkiaSharedGLContextGetGrContext(AzSkiaSharedGLContextRef aGLContext) {
    SkNativeSharedGLContext *sharedGLContext = static_cast<SkNativeSharedGLContext*>(aGLContext);
    return sharedGLContext->getGrContext();
}
Пример #7
0
extern "C" unsigned int
AzSkiaSharedGLContextStealTextureID(AzSkiaSharedGLContextRef aGLContext) {
    SkNativeSharedGLContext *sharedGLContext = static_cast<SkNativeSharedGLContext*>(aGLContext);
    return sharedGLContext->stealTextureID();
}
Пример #8
0
extern "C" unsigned int
AzSkiaSharedGLContextGetFBOID(AzSkiaSharedGLContextRef aGLContext) {
   SkNativeSharedGLContext *sharedGLContext = static_cast<SkNativeSharedGLContext*>(aGLContext);
   return sharedGLContext->getFBOID();
}
Пример #9
0
extern "C" void
AzReleaseSkiaSharedGLContext(AzSkiaSharedGLContextRef aGLContext) {
    SkNativeSharedGLContext *sharedGLContext = static_cast<SkNativeSharedGLContext*>(aGLContext);
    sharedGLContext->Release();
}
Пример #10
0
extern "C" void
AzRetainSkiaSharedGLContext(AzSkiaSharedGLContextRef aGLContext) {
    SkNativeSharedGLContext *sharedGLContext = static_cast<SkNativeSharedGLContext*>(aGLContext);
    sharedGLContext->AddRef();
}
Пример #11
0
extern "C" AzSkiaGrGLSharedSurfaceRef
AzSkiaSharedGLContextStealSurface(AzSkiaSharedGLContextRef aGLContext) {
    SkNativeSharedGLContext *sharedGLContext = static_cast<SkNativeSharedGLContext*>(aGLContext);
    return reinterpret_cast<void*>(sharedGLContext->stealSurface());
}