Exemplo n.º 1
0
SurfaceOpenVG::SurfaceOpenVG(EGLClientBuffer buffer, EGLenum bufferType, const EGLDisplay& display, EGLConfig* confPtr, EGLint* errorCode)
    : m_activePainter(0)
    , m_eglDisplay(display)
    , m_eglSurface(EGL_NO_SURFACE)
    , m_eglContext(EGL_NO_CONTEXT)
{
    ASSERT(m_eglDisplay != EGL_NO_DISPLAY);

    EGLDisplayOpenVG* displayManager = EGLDisplayOpenVG::forDisplay(m_eglDisplay);
    EGLConfig config = confPtr ? (*confPtr) : displayManager->defaultPbufferConfig();
    m_eglSurface = displayManager->createPbufferFromClientBuffer(buffer, bufferType, config, errorCode);

    if (m_eglSurface == EGL_NO_SURFACE)
        return;

    EGLint width = 0, height = 0;
    eglQuerySurface(m_eglDisplay, m_eglSurface, EGL_WIDTH, &width);
    ASSERT_EGL_NO_ERROR();
    eglQuerySurface(m_eglDisplay, m_eglSurface, EGL_HEIGHT, &height);
    ASSERT_EGL_NO_ERROR();
    m_size = IntSize(width, height);

    m_eglContext = displayManager->contextForSurface(m_eglSurface);
    EGLDisplayOpenVG::registerPlatformSurface(this);
}
FontPlatformDataStaticPrivate::FontPlatformDataStaticPrivate()
{
    m_engine = Olympia::Platform::Text::engine();
    ASSERT(m_engine);

    Olympia::Platform::Text::NativeGraphicsDisplay display;
#if PLATFORM(EGL)
    ASSERT_EGL_NO_ERROR();
    EGLDisplayOpenVG* displayManager = EGLDisplayOpenVG::current();
    display = static_cast<Olympia::Platform::Text::NativeGraphicsDisplay>(displayManager->display());
#endif
    Olympia::Platform::Text::ReturnCode error;
    m_context = m_engine->createGraphicsContext(error, Olympia::Platform::Text::OpenVGGraphicsContext, display);
    ASSERT(m_context);
    ASSERT(!error);

#if PLATFORM(EGL)
    ASSERT_EGL_NO_ERROR();
    SurfaceOpenVG* sharedSurface = displayManager->sharedPlatformSurface();
    m_context->setDisplay(static_cast<Olympia::Platform::Text::NativeGraphicsDisplay>(sharedSurface->eglDisplay()));
    m_context->setSurface(static_cast<Olympia::Platform::Text::NativeGraphicsSurface>(sharedSurface->eglSurface()));
    m_context->setContext(static_cast<Olympia::Platform::Text::NativeGraphicsContext>(sharedSurface->eglContext()));
    ASSERT_EGL_NO_ERROR();
#endif
}
Exemplo n.º 3
0
SurfaceOpenVG::SurfaceOpenVG(EGLNativeWindowType window, const EGLDisplay& display, EGLConfig* confPtr)
    : m_activePainter(0)
    , m_eglDisplay(display)
    , m_eglSurface(EGL_NO_SURFACE)
    , m_eglContext(EGL_NO_CONTEXT)
{
    ASSERT(m_eglDisplay != EGL_NO_DISPLAY);

    EGLDisplayOpenVG* displayManager = EGLDisplayOpenVG::forDisplay(m_eglDisplay);
    EGLConfig config = confPtr ? (*confPtr) : displayManager->defaultWindowConfig();
    m_eglSurface = displayManager->surfaceForWindow(window, config);
    ASSERT(m_eglSurface != EGL_NO_SURFACE);

    m_eglContext = displayManager->contextForSurface(m_eglSurface);
    EGLDisplayOpenVG::registerPlatformSurface(this);
}
Exemplo n.º 4
0
SurfaceOpenVG::SurfaceOpenVG(const IntSize& size, const EGLDisplay& display, EGLConfig* confPtr, EGLint* errorCode)
    : m_activePainter(0)
    , m_eglDisplay(display)
    , m_eglSurface(EGL_NO_SURFACE)
    , m_eglContext(EGL_NO_CONTEXT)
{
    ASSERT(m_eglDisplay != EGL_NO_DISPLAY);

    EGLDisplayOpenVG* displayManager = EGLDisplayOpenVG::forDisplay(m_eglDisplay);
    EGLConfig config = confPtr ? (*confPtr) : displayManager->defaultPbufferConfig();
    m_eglSurface = displayManager->createPbufferSurface(size, config, errorCode);

    if (m_eglSurface == EGL_NO_SURFACE)
        return;

    m_eglContext = displayManager->contextForSurface(m_eglSurface);
    EGLDisplayOpenVG::registerPlatformSurface(this);
}
Exemplo n.º 5
0
SurfaceOpenVG::SurfaceOpenVG(EGLNativeWindowType window, const EGLDisplay& display, EGLConfig* confPtr)
    : m_activePainter(0)
    , m_eglDisplay(display)
    , m_eglSurface(EGL_NO_SURFACE)
    , m_eglContext(EGL_NO_CONTEXT)
{
    ASSERT(m_eglDisplay != EGL_NO_DISPLAY);

    EGLDisplayOpenVG* displayManager = EGLDisplayOpenVG::forDisplay(m_eglDisplay);
    EGLConfig config = confPtr ? (*confPtr) : displayManager->defaultWindowConfig();
    m_eglSurface = displayManager->surfaceForWindow(window, config);
    ASSERT(m_eglSurface != EGL_NO_SURFACE);

    // We can't really cache the size for window surfaces as they can
    // change size underneath us without any notification whatsoever.
    // So width() and height() will still query every time.

    m_eglContext = displayManager->contextForSurface(m_eglSurface);
    EGLDisplayOpenVG::registerPlatformSurface(this);
}