コード例 #1
0
ファイル: OEGLSurface.cpp プロジェクト: vslash/NWTPI
EGLSurface OEGLSurface::createSurface() {

    switch (surfaceType)
    {
    case OEGL_WINDOW_SURFACE:
        return ( createWindowSurface() );
        break;
    case OEGL_PBUFFER_SURFACE:
        return ( createPbufferSurface() );
        break;
    case OEGL_PIXMAP_SURFACE:
        return ( createPixmapSurface() );
        break;
    default:
        return ( EGL_NO_SURFACE );
    }

    return ( EGL_NO_SURFACE );
}
コード例 #2
0
SurfaceOpenVG* EGLDisplayOpenVG::sharedPlatformSurface()
{
    if (!m_sharedPlatformSurface) {
        // The shared surface doesn't need to be drawn on, it just exists so
        // that we can always make the shared context current (which in turn is
        // the owner of long-living resources such as images, paths and fonts).
        // We'll just make the shared surface as small as possible: 1x1 pixel.
        EGLConfig config = defaultPbufferConfig();
        EGLSurface surface = createPbufferSurface(IntSize(1, 1), config);

        EGLContext context = eglCreateContext(m_display, config, EGL_NO_CONTEXT, 0);
        ASSERT_EGL_NO_ERROR();
        m_contexts.set(m_surfaceConfigIds.get(surface), context);

        m_sharedPlatformSurface = SurfaceOpenVG::adoptExistingSurface(
            m_display, surface, context, SurfaceOpenVG::TakeSurfaceOwnership, EGL_PBUFFER_BIT);
    }
    return m_sharedPlatformSurface;
}
コード例 #3
0
ファイル: EGLDisplayOpenVG.cpp プロジェクト: 1833183060/wke
SurfaceOpenVG* EGLDisplayOpenVG::sharedPlatformSurface()
{
    if (!m_sharedPlatformSurface) {
        // The shared surface doesn't need to be drawn on, it just exists so
        // that we can always make the shared context current (which in turn is
        // the owner of long-living resources such as images, paths and fonts).
        // We'll just make the shared surface as small as possible: 1x1 pixel.
        EGLConfig config = defaultPbufferConfig();
        EGLSurface surface = createPbufferSurface(IntSize(1, 1), config);

        EGLContext context = eglCreateContext(m_display, config, EGL_NO_CONTEXT, 0);
        ASSERT_EGL_NO_ERROR();
        m_contexts.set(m_surfaceConfigIds.get(surface), context);

        m_sharedPlatformSurface = new SurfaceOpenVG;
        m_sharedPlatformSurface->m_eglDisplay = m_display;
        m_sharedPlatformSurface->m_eglSurface = surface;
        m_sharedPlatformSurface->m_eglContext = context;
        m_platformSurfaces.set(surface, m_sharedPlatformSurface); // a.k.a. registerPlatformSurface()
    }
    return m_sharedPlatformSurface;
}