Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/openvg/qwindowsurface_vgegl.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    7272QImage::Format qt_vg_config_to_image_format(QEglContext *context)
    7373{
    74     EGLint red = 0;
    75     EGLint green = 0;
    76     EGLint blue = 0;
    77     EGLint alpha = 0;
    78     context->configAttrib(EGL_RED_SIZE, &red);
    79     context->configAttrib(EGL_GREEN_SIZE, &green);
    80     context->configAttrib(EGL_BLUE_SIZE, &blue);
    81     context->configAttrib(EGL_ALPHA_SIZE, &alpha);
     74    EGLint red = context->configAttrib(EGL_RED_SIZE);
     75    EGLint green = context->configAttrib(EGL_GREEN_SIZE);
     76    EGLint blue = context->configAttrib(EGL_BLUE_SIZE);
     77    EGLint alpha = context->configAttrib(EGL_ALPHA_SIZE);
    8278    QImage::Format argbFormat;
    8379#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
    84     EGLint type = 0;
    85     context->configAttrib(EGL_SURFACE_TYPE, &type);
     80    EGLint type = context->configAttrib(EGL_SURFACE_TYPE);
    8681    if ((type & EGL_VG_ALPHA_FORMAT_PRE_BIT) != 0)
    8782        argbFormat = QImage::Format_ARGB32_Premultiplied;
     
    211206static bool isPremultipliedContext(const QEglContext *context)
    212207{
    213     EGLint value = 0;
    214     if (context->configAttrib(EGL_SURFACE_TYPE, &value))
    215         return (value & EGL_VG_ALPHA_FORMAT_PRE_BIT) != 0;
    216     else
    217         return false;
     208    return context->configAttrib(EGL_SURFACE_TYPE) & EGL_VG_ALPHA_FORMAT_PRE_BIT;
    218209}
    219210
     
    231222    QByteArray interval = qgetenv("QT_VG_SWAP_INTERVAL");
    232223    if (!interval.isEmpty())
    233         eglSwapInterval(QEglContext::display(), interval.toInt());
     224        eglSwapInterval(QEgl::display(), interval.toInt());
    234225    else
    235         eglSwapInterval(QEglContext::display(), 1);
     226        eglSwapInterval(QEgl::display(), 1);
    236227
    237228#ifdef EGL_RENDERABLE_TYPE
     
    247238        EGLConfig cfg;
    248239        if (eglChooseConfig
    249                     (QEglContext::display(), properties, &cfg, 1, &matching) &&
     240                    (QEgl::display(), properties, &cfg, 1, &matching) &&
    250241                matching > 0) {
    251242            // Check that the selected configuration actually supports OpenVG
     
    254245            EGLint type = 0;
    255246            eglGetConfigAttrib
    256                 (QEglContext::display(), cfg, EGL_CONFIG_ID, &id);
     247                (QEgl::display(), cfg, EGL_CONFIG_ID, &id);
    257248            eglGetConfigAttrib
    258                 (QEglContext::display(), cfg, EGL_RENDERABLE_TYPE, &type);
     249                (QEgl::display(), cfg, EGL_RENDERABLE_TYPE, &type);
    259250            if (cfgId == id && (type & EGL_OPENVG_BIT) != 0) {
    260251                context->setConfig(cfg);
     
    277268    if (redSize == EGL_DONT_CARE || redSize == 0)
    278269        configProps.setPixelFormat(QImage::Format_ARGB32);  // XXX
    279 #ifndef QVG_SCISSOR_CLIP
    280     // If we are using the mask to clip, then explicitly request a mask.
    281270    configProps.setValue(EGL_ALPHA_MASK_SIZE, 1);
    282 #endif
    283271#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
    284272    configProps.setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT |
     
    335323    shared->context->doneCurrent();
    336324    if (shared->surface != EGL_NO_SURFACE) {
    337         eglDestroySurface(QEglContext::display(), shared->surface);
     325        eglDestroySurface(QEgl::display(), shared->surface);
    338326        shared->surface = EGL_NO_SURFACE;
    339327    }
     
    413401        }
    414402        shared->surface = eglCreatePbufferSurface
    415             (QEglContext::display(), shared->context->config(), attribs);
     403            (QEgl::display(), shared->context->config(), attribs);
    416404    }
    417405    return shared->surface;
     
    556544            recreateBackBuffer = false;
    557545            if (backBufferSurface != EGL_NO_SURFACE) {
    558                 eglDestroySurface(QEglContext::display(), backBufferSurface);
     546                eglDestroySurface(QEgl::display(), backBufferSurface);
    559547                backBufferSurface = EGL_NO_SURFACE;
    560548            }
     
    569557                // Create an EGL surface for rendering into the VGImage.
    570558                backBufferSurface = eglCreatePbufferFromClientBuffer
    571                     (QEglContext::display(), EGL_OPENVG_IMAGE,
     559                    (QEgl::display(), EGL_OPENVG_IMAGE,
    572560                     (EGLClientBuffer)(backBuffer),
    573561                     context->config(), NULL);
     
    706694        // Did we get a direct to window rendering surface?
    707695        EGLint buffer = 0;
    708         if (eglQueryContext(QEglContext::display(), context->context(),
     696        if (eglQueryContext(QEgl::display(), context->context(),
    709697                            EGL_RENDER_BUFFER, &buffer) &&
    710698                buffer == EGL_SINGLE_BUFFER) {
     
    719707    // Try to force the surface back buffer to preserve its contents.
    720708    if (needToSwap) {
    721         eglGetError();  // Clear error state first.
    722         eglSurfaceAttrib(QEglContext::display(), windowSurface,
     709        bool succeeded = eglSurfaceAttrib(QEgl::display(), windowSurface,
    723710                EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
    724         if (eglGetError() != EGL_SUCCESS) {
     711        if (eglGetError() != EGL_SUCCESS) {
    725712            qWarning("QVG: could not enable preserved swap");
    726713        }
Note: See TracChangeset for help on using the changeset viewer.