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/gui/egl/qegl_wince.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])
     
    4343#include <QtGui/qpixmap.h>
    4444#include <QtGui/qwidget.h>
     45
    4546#include "qegl_p.h"
     47
    4648
    4749#include <windows.h>
     
    5052QT_BEGIN_NAMESPACE
    5153
    52 EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties *properties)
    53 {
    54     // Create the native drawable for the paint device.
    55     int devType = device->devType();
    56     EGLNativePixmapType pixmapDrawable = 0;
    57     EGLNativeWindowType windowDrawable = 0;
    58     bool ok;
    59     if (devType == QInternal::Pixmap) {
    60         pixmapDrawable = 0;
    61         ok = (pixmapDrawable != 0);
    62     } else if (devType == QInternal::Widget) {
    63         windowDrawable = (EGLNativeWindowType)(static_cast<QWidget *>(device))->winId();
    64         ok = (windowDrawable != 0);
    65     } else {
    66         ok = false;
    67     }
    68     if (!ok) {
    69         qWarning("QEglContext::createSurface(): Cannot create the native EGL drawable");
    70         return EGL_NO_SURFACE;
    71     }
    72 
    73     // Create the EGL surface to draw into, based on the native drawable.
    74     const int *props;
    75     if (properties)
    76         props = properties->properties();
    77     else
    78         props = 0;
    79     EGLSurface surf;
    80     if (devType == QInternal::Widget)
    81         surf = eglCreateWindowSurface(dpy, cfg, windowDrawable, props);
    82     else
    83         surf = eglCreatePixmapSurface(dpy, cfg, pixmapDrawable, props);
    84     if (surf == EGL_NO_SURFACE) {
    85         qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
    86     }
    87     return surf;
    88 }
    89 
    90 EGLNativeDisplayType QEglContext::nativeDisplay()
     54EGLNativeDisplayType QEgl::nativeDisplay()
    9155{
    9256    HDC myDc = GetDC(0);
    93 
    9457    if (!myDc) {
    9558        qWarning("QEglContext::nativeDisplay(): WinCE display is not open");
     
    9760    }
    9861    return EGLNativeDisplayType(myDc);
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
    9973}
    10074
Note: See TracChangeset for help on using the changeset viewer.