src/openvg/qwindowsurface_vgegl.cpp
changeset 18 2f34d5167611
parent 3 41300fa6a67c
child 19 fcece45ef507
equal deleted inserted replaced
3:41300fa6a67c 18:2f34d5167611
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtOpenVG module of the Qt Toolkit.
     7 ** This file is part of the QtOpenVG module of the Qt Toolkit.
     8 **
     8 **
    37 **
    37 **
    38 ** $QT_END_LICENSE$
    38 ** $QT_END_LICENSE$
    39 **
    39 **
    40 ****************************************************************************/
    40 ****************************************************************************/
    41 
    41 
       
    42 #include "../src/gui/egl/qegl_p.h"
    42 #include "qwindowsurface_vgegl_p.h"
    43 #include "qwindowsurface_vgegl_p.h"
    43 #include "qpaintengine_vg_p.h"
    44 #include "qpaintengine_vg_p.h"
    44 #include "qpixmapdata_vg_p.h"
    45 #include "qpixmapdata_vg_p.h"
    45 #include "qvgimagepool_p.h"
    46 #include "qvgimagepool_p.h"
    46 #include "qvg_p.h"
    47 #include "qvg_p.h"
       
    48 
    47 
    49 
    48 #if !defined(QT_NO_EGL)
    50 #if !defined(QT_NO_EGL)
    49 
    51 
    50 QT_BEGIN_NAMESPACE
    52 QT_BEGIN_NAMESPACE
    51 
    53 
   225     QEglContext *context;
   227     QEglContext *context;
   226 
   228 
   227     // Create the context object and open the display.
   229     // Create the context object and open the display.
   228     context = new QEglContext();
   230     context = new QEglContext();
   229     context->setApi(QEgl::OpenVG);
   231     context->setApi(QEgl::OpenVG);
   230     if (!context->openDisplay(device)) {
       
   231         delete context;
       
   232         return 0;
       
   233     }
       
   234 
   232 
   235     // Set the swap interval for the display.
   233     // Set the swap interval for the display.
   236     QByteArray interval = qgetenv("QT_VG_SWAP_INTERVAL");
   234     QByteArray interval = qgetenv("QT_VG_SWAP_INTERVAL");
   237     if (!interval.isEmpty())
   235     if (!interval.isEmpty())
   238         eglSwapInterval(context->display(), interval.toInt());
   236         eglSwapInterval(context->display(), interval.toInt());