Commit ad32d9a2d2c3b1202867f8563a69afb93effecd0
- Diff rendering mode:
- inline
- side by side
|   | |||
| 68 | 68 | QMAKE_LIBS_NETWORK = | |
| 69 | 69 | QMAKE_LIBS_EGL = -llibEGL | |
| 70 | 70 | QMAKE_LIBS_OPENGL = | |
| 71 | QMAKE_LIBS_OPENVG = -llibOpenVG | ||
| 71 | QMAKE_LIBS_OPENVG = -llibOpenVG -lgraphicsresource | ||
| 72 | 72 | QMAKE_LIBS_COMPAT = | |
| 73 | 73 | QMAKE_LIBS_QT_ENTRY = -llibcrt0.lib | |
| 74 | 74 | QMAKE_LIBS_S60 = -lavkon |
src/corelib/global/qglobal.h
(3 / 1)
|   | |||
| 820 | 820 | # define Q_WS_WIN | |
| 821 | 821 | #endif | |
| 822 | 822 | ||
| 823 | |||
| 824 | 823 | QT_BEGIN_HEADER | |
| 825 | 824 | QT_BEGIN_NAMESPACE | |
| 826 | 825 | ||
| … | … | ||
| 2389 | 2389 | //RWsPointerCursor is fixed, so don't use low performance sprites | |
| 2390 | 2390 | #define Q_SYMBIAN_FIXED_POINTER_CURSORS | |
| 2391 | 2391 | #define Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE | |
| 2392 | //enabling new graphics resources | ||
| 2393 | #define QT_SYMBIAN_SUPPORTS_SGIMAGE | ||
| 2392 | 2394 | #endif | |
| 2395 | |||
| 2393 | 2396 | ||
| 2394 | 2397 | //Symbian does not support data imports from a DLL | |
| 2395 | 2398 | #define Q_NO_DATA_RELOCATION |
src/gui/egl/qegl_symbian.cpp
(3 / 0)
|   | |||
| 98 | 98 | // Set pixel format and other properties based on a paint device. | |
| 99 | 99 | void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev) | |
| 100 | 100 | { | |
| 101 | if(!dev) | ||
| 102 | return; | ||
| 103 | |||
| 101 | 104 | int devType = dev->devType(); | |
| 102 | 105 | if (devType == QInternal::Image) | |
| 103 | 106 | setPixelFormat(static_cast<QImage *>(dev)->format()); |
src/gui/image/image.pri
(1 / 1)
|   | |||
| 24 | 24 | image/qpixmap.h \ | |
| 25 | 25 | image/qpixmap_raster_p.h \ | |
| 26 | 26 | image/qpixmapcache.h \ | |
| 27 | image/qpixmapcache_p.h \ | ||
| 27 | image/qpixmapcache_p.h \ | ||
| 28 | 28 | image/qpixmapdata_p.h \ | |
| 29 | 29 | image/qpixmapdatafactory_p.h \ | |
| 30 | 30 | image/qpixmapfilter_p.h \ |
src/gui/image/qpixmap.h
(4 / 1)
|   | |||
| 54 | 54 | ||
| 55 | 55 | #if defined(Q_OS_SYMBIAN) | |
| 56 | 56 | class CFbsBitmap; | |
| 57 | class RSgImage; | ||
| 57 | 58 | #endif | |
| 58 | 59 | ||
| 59 | 60 | QT_BEGIN_NAMESPACE | |
| … | … | ||
| 159 | 159 | ||
| 160 | 160 | #if defined(Q_OS_SYMBIAN) | |
| 161 | 161 | enum ConversionMode { CopyData, DuplicateHandle }; | |
| 162 | |||
| 162 | |||
| 163 | 163 | CFbsBitmap *toSymbianCFbsBitmap(ConversionMode mode = DuplicateHandle) const; | |
| 164 | 164 | static QPixmap fromSymbianCFbsBitmap(CFbsBitmap *bitmap, ConversionMode mode = DuplicateHandle); | |
| 165 | RSgImage* toSymbianRSgImage() const; | ||
| 166 | static QPixmap fromSymbianRSgImage(RSgImage *sgImage); | ||
| 165 | 167 | #endif | |
| 166 | 168 | ||
| 167 | 169 | inline QPixmap copy(int x, int y, int width, int height) const; |
src/gui/image/qpixmap_s60.cpp
(58 / 0)
|   | |||
| 42 | 42 | #include <w32std.h> | |
| 43 | 43 | #include <fbs.h> | |
| 44 | 44 | ||
| 45 | #include <private/qapplication_p.h> | ||
| 46 | #include <private/qgraphicssystem_p.h> | ||
| 45 | 47 | #include <private/qt_s60_p.h> | |
| 46 | 48 | #include <private/qpaintengine_s60_p.h> | |
| 47 | 49 | ||
| … | … | ||
| 897 | 897 | symbianBitmapDataAccess->endDataAccess(cfbsBitmap); | |
| 898 | 898 | } | |
| 899 | 899 | ||
| 900 | /*! | ||
| 901 | \since 4.6 | ||
| 902 | |||
| 903 | Returns a QPixmap that wraps given \c RSgImage \a graphics resource. | ||
| 904 | The data should be valid even when original RSgImage handle has been | ||
| 905 | closed. | ||
| 906 | |||
| 907 | \warning This function is only available on Symbian OS. | ||
| 908 | |||
| 909 | \sa toSymbianRSgImage(), {QPixmap#Pixmap Conversion}{Pixmap Conversion} | ||
| 910 | */ | ||
| 911 | |||
| 912 | QPixmap QPixmap::fromSymbianRSgImage(RSgImage *sgImage) | ||
| 913 | { | ||
| 914 | // It is expected that RSgImage will | ||
| 915 | // CURRENTLY be used in conjuction with | ||
| 916 | // OpenVG graphics system | ||
| 917 | // | ||
| 918 | // Surely things might change in future | ||
| 919 | |||
| 920 | if (!sgImage) | ||
| 921 | return QPixmap(); | ||
| 922 | |||
| 923 | QPixmap pixmap; | ||
| 924 | pixmap.pixmapData()->fromRSgImage(sgImage); | ||
| 925 | |||
| 926 | return pixmap; | ||
| 927 | } | ||
| 928 | |||
| 929 | /*! | ||
| 930 | \since 4.6 | ||
| 931 | |||
| 932 | Returns a \c RSgImage that is equivalent to the QPixmap by copying the data. | ||
| 933 | |||
| 934 | It is the caller's responsibility to close/delete the \c RSgImage after use. | ||
| 935 | |||
| 936 | \warning This function is only available on Symbian OS. | ||
| 937 | |||
| 938 | \sa fromSymbianRSgImage() | ||
| 939 | */ | ||
| 940 | |||
| 941 | RSgImage *QPixmap::toSymbianRSgImage() const | ||
| 942 | { | ||
| 943 | // It is expected that RSgImage will | ||
| 944 | // CURRENTLY be used in conjuction with | ||
| 945 | // OpenVG graphics system | ||
| 946 | // | ||
| 947 | // Surely things might change in future | ||
| 948 | |||
| 949 | if (isNull()) | ||
| 950 | return 0; | ||
| 951 | |||
| 952 | RSgImage *sgImage = pixmapData()->toRSgImage(); | ||
| 953 | |||
| 954 | return sgImage; | ||
| 955 | } | ||
| 900 | 956 | ||
| 901 | 957 | QT_END_NAMESPACE |
src/gui/image/qpixmapdata.cpp
(11 / 0)
|   | |||
| 223 | 223 | return 0; | |
| 224 | 224 | } | |
| 225 | 225 | ||
| 226 | #if defined(Q_OS_SYMBIAN) | ||
| 227 | RSgImage* QPixmapData::toRSgImage() | ||
| 228 | { | ||
| 229 | return 0; | ||
| 230 | } | ||
| 231 | |||
| 232 | void QPixmapData::fromRSgImage(RSgImage* rsgImage) | ||
| 233 | { | ||
| 234 | return; | ||
| 235 | } | ||
| 236 | #endif | ||
| 226 | 237 | QT_END_NAMESPACE |
|   | |||
| 56 | 56 | #include <QtGui/qpixmap.h> | |
| 57 | 57 | #include <QtCore/qatomic.h> | |
| 58 | 58 | ||
| 59 | #if defined(Q_OS_SYMBIAN) | ||
| 60 | class RSgImage; | ||
| 61 | #endif | ||
| 62 | |||
| 59 | 63 | QT_BEGIN_NAMESPACE | |
| 60 | 64 | ||
| 61 | 65 | class Q_GUI_EXPORT QPixmapData | |
| … | … | ||
| 112 | 112 | inline int numColors() const { return metric(QPaintDevice::PdmNumColors); } | |
| 113 | 113 | inline int depth() const { return d; } | |
| 114 | 114 | inline bool isNull() const { return is_null; } | |
| 115 | |||
| 116 | #if defined(Q_OS_SYMBIAN) | ||
| 117 | virtual RSgImage* toRSgImage(); | ||
| 118 | virtual void fromRSgImage(RSgImage* rsgImage); | ||
| 119 | #endif | ||
| 115 | 120 | ||
| 116 | 121 | protected: | |
| 117 | 122 | void setSerialNumber(int serNo); |
src/openvg/qpixmapdata_vg.cpp
(178 / 0)
|   | |||
| 44 | 44 | #include <QtGui/private/qdrawhelper_p.h> | |
| 45 | 45 | #include "qvg_p.h" | |
| 46 | 46 | ||
| 47 | #ifdef QT_SYMBIAN_SUPPORTS_SGIMAGE | ||
| 48 | #include <graphics/sgimage.h> | ||
| 49 | typedef EGLImageKHR (*pfnEglCreateImageKHR)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, EGLint*); | ||
| 50 | typedef EGLBoolean (*pfnEglDestroyImageKHR)(EGLDisplay, EGLImageKHR); | ||
| 51 | typedef VGImage (*pfnVgCreateEGLImageTargetKHR)(VGeglImageKHR); | ||
| 52 | #endif | ||
| 53 | |||
| 47 | 54 | QT_BEGIN_NAMESPACE | |
| 48 | 55 | ||
| 49 | 56 | static int qt_vg_pixmap_serial = 0; | |
| … | … | ||
| 373 | 373 | return VG_INVALID_HANDLE; | |
| 374 | 374 | } | |
| 375 | 375 | ||
| 376 | #if defined(Q_OS_SYMBIAN) | ||
| 377 | void QVGPixmapData::cleanup() | ||
| 378 | { | ||
| 379 | is_null = w = h = 0; | ||
| 380 | recreate = false; | ||
| 381 | source = QImage(); | ||
| 382 | } | ||
| 383 | |||
| 384 | void QVGPixmapData::fromRSgImage(RSgImage* sgImage) | ||
| 385 | { | ||
| 386 | Q_UNUSED(sgImage); | ||
| 387 | #if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL) | ||
| 388 | // when "0" used as argument then | ||
| 389 | // default display, context are used | ||
| 390 | if (!context) | ||
| 391 | context = qt_vg_create_context(0); | ||
| 392 | |||
| 393 | if (vgImage != VG_INVALID_HANDLE) { | ||
| 394 | vgDestroyImage(vgImage); | ||
| 395 | vgImage = VG_INVALID_HANDLE; | ||
| 396 | } | ||
| 397 | if (vgImageOpacity != VG_INVALID_HANDLE) { | ||
| 398 | vgDestroyImage(vgImageOpacity); | ||
| 399 | vgImageOpacity = VG_INVALID_HANDLE; | ||
| 400 | } | ||
| 401 | |||
| 402 | TInt err = 0; | ||
| 403 | |||
| 404 | err = SgDriver::Open(); | ||
| 405 | if(err != KErrNone) { | ||
| 406 | cleanup(); | ||
| 407 | return; | ||
| 408 | } | ||
| 409 | |||
| 410 | if(sgImage->IsNull()) { | ||
| 411 | cleanup(); | ||
| 412 | SgDriver::Close(); | ||
| 413 | return; | ||
| 414 | } | ||
| 415 | |||
| 416 | TSgImageInfo sgImageInfo; | ||
| 417 | err = sgImage->GetInfo(sgImageInfo); | ||
| 418 | if(err != KErrNone) { | ||
| 419 | cleanup(); | ||
| 420 | SgDriver::Close(); | ||
| 421 | return; | ||
| 422 | } | ||
| 423 | |||
| 424 | pfnEglCreateImageKHR eglCreateImageKHR = (pfnEglCreateImageKHR) eglGetProcAddress("eglCreateImageKHR"); | ||
| 425 | pfnEglDestroyImageKHR eglDestroyImageKHR = (pfnEglDestroyImageKHR) eglGetProcAddress("eglDestroyImageKHR"); | ||
| 426 | pfnVgCreateEGLImageTargetKHR vgCreateEGLImageTargetKHR = (pfnVgCreateEGLImageTargetKHR) eglGetProcAddress("vgCreateEGLImageTargetKHR"); | ||
| 427 | |||
| 428 | if(eglGetError() != EGL_SUCCESS || !eglCreateImageKHR || !eglDestroyImageKHR || !vgCreateEGLImageTargetKHR) { | ||
| 429 | cleanup(); | ||
| 430 | SgDriver::Close(); | ||
| 431 | return; | ||
| 432 | } | ||
| 433 | |||
| 434 | const EGLint KEglImageAttribs[] = {EGL_IMAGE_PRESERVED_SYMBIAN, EGL_TRUE, EGL_NONE}; | ||
| 435 | EGLImageKHR eglImage = eglCreateImageKHR(context->display(), | ||
| 436 | EGL_NO_CONTEXT, | ||
| 437 | EGL_NATIVE_PIXMAP_KHR, | ||
| 438 | (EGLClientBuffer)sgImage, | ||
| 439 | (EGLint*)KEglImageAttribs); | ||
| 440 | |||
| 441 | if(eglGetError() != EGL_SUCCESS) { | ||
| 442 | cleanup(); | ||
| 443 | SgDriver::Close(); | ||
| 444 | return; | ||
| 445 | } | ||
| 446 | |||
| 447 | vgImage = vgCreateEGLImageTargetKHR(eglImage); | ||
| 448 | if(vgGetError() != VG_NO_ERROR) { | ||
| 449 | cleanup(); | ||
| 450 | eglDestroyImageKHR(context->display(), eglImage); | ||
| 451 | SgDriver::Close(); | ||
| 452 | return; | ||
| 453 | } | ||
| 454 | |||
| 455 | w = sgImageInfo.iSizeInPixels.iWidth; | ||
| 456 | h = sgImageInfo.iSizeInPixels.iHeight; | ||
| 457 | d = 32; // We always use ARGB_Premultiplied for VG pixmaps. | ||
| 458 | is_null = (w <= 0 || h <= 0); | ||
| 459 | source = QImage(); | ||
| 460 | recreate = false; | ||
| 461 | setSerialNumber(++qt_vg_pixmap_serial); | ||
| 462 | // release stuff | ||
| 463 | eglDestroyImageKHR(context->display(), eglImage); | ||
| 464 | SgDriver::Close(); | ||
| 465 | #else | ||
| 466 | #endif | ||
| 467 | } | ||
| 468 | |||
| 469 | RSgImage* QVGPixmapData::toRSgImage() | ||
| 470 | { | ||
| 471 | #if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL) | ||
| 472 | toVGImage(); | ||
| 473 | |||
| 474 | if(!isValid() || vgImage == VG_INVALID_HANDLE) | ||
| 475 | return 0; | ||
| 476 | |||
| 477 | TInt err = 0; | ||
| 478 | |||
| 479 | err = SgDriver::Open(); | ||
| 480 | if(err != KErrNone) | ||
| 481 | return 0; | ||
| 482 | |||
| 483 | TSgImageInfo sgInfo; | ||
| 484 | sgInfo.iPixelFormat = EUidPixelFormatARGB_8888_PRE; | ||
| 485 | sgInfo.iSizeInPixels.SetSize(w, h); | ||
| 486 | sgInfo.iUsage = ESgUsageOpenVgImage | ESgUsageOpenVgTarget; | ||
| 487 | sgInfo.iShareable = ETrue; | ||
| 488 | sgInfo.iCpuAccess = ESgCpuAccessNone; | ||
| 489 | sgInfo.iScreenId = KSgScreenIdMain; //KSgScreenIdAny; | ||
| 490 | sgInfo.iUserAttributes = NULL; | ||
| 491 | sgInfo.iUserAttributeCount = 0; | ||
| 492 | |||
| 493 | RSgImage *sgImage = q_check_ptr(new RSgImage()); | ||
| 494 | err = sgImage->Create(sgInfo, NULL, NULL); | ||
| 495 | if(err != KErrNone) { | ||
| 496 | SgDriver::Close(); | ||
| 497 | return 0; | ||
| 498 | } | ||
| 499 | |||
| 500 | pfnEglCreateImageKHR eglCreateImageKHR = (pfnEglCreateImageKHR) eglGetProcAddress("eglCreateImageKHR"); | ||
| 501 | pfnEglDestroyImageKHR eglDestroyImageKHR = (pfnEglDestroyImageKHR) eglGetProcAddress("eglDestroyImageKHR"); | ||
| 502 | pfnVgCreateEGLImageTargetKHR vgCreateEGLImageTargetKHR = (pfnVgCreateEGLImageTargetKHR) eglGetProcAddress("vgCreateEGLImageTargetKHR"); | ||
| 503 | |||
| 504 | if(eglGetError() != EGL_SUCCESS || !eglCreateImageKHR || !eglDestroyImageKHR || !vgCreateEGLImageTargetKHR) { | ||
| 505 | SgDriver::Close(); | ||
| 506 | return 0; | ||
| 507 | } | ||
| 508 | |||
| 509 | const EGLint KEglImageAttribs[] = {EGL_IMAGE_PRESERVED_SYMBIAN, EGL_TRUE, EGL_NONE}; | ||
| 510 | EGLImageKHR eglImage = eglCreateImageKHR(context->display(), | ||
| 511 | EGL_NO_CONTEXT, | ||
| 512 | EGL_NATIVE_PIXMAP_KHR, | ||
| 513 | (EGLClientBuffer)sgImage, | ||
| 514 | (EGLint*)KEglImageAttribs); | ||
| 515 | if(eglGetError() != EGL_SUCCESS) { | ||
| 516 | sgImage->Close(); | ||
| 517 | SgDriver::Close(); | ||
| 518 | return 0; | ||
| 519 | } | ||
| 520 | |||
| 521 | VGImage dstVgImage = vgCreateEGLImageTargetKHR(eglImage); | ||
| 522 | if(vgGetError() != VG_NO_ERROR) { | ||
| 523 | eglDestroyImageKHR(context->display(), eglImage); | ||
| 524 | sgImage->Close(); | ||
| 525 | SgDriver::Close(); | ||
| 526 | return 0; | ||
| 527 | } | ||
| 528 | |||
| 529 | vgCopyImage(dstVgImage, 0, 0, | ||
| 530 | vgImage, 0, 0, | ||
| 531 | w, h, VG_FALSE); | ||
| 532 | |||
| 533 | if(vgGetError() != VG_NO_ERROR) { | ||
| 534 | sgImage->Close(); | ||
| 535 | sgImage = 0; | ||
| 536 | } | ||
| 537 | // release stuff | ||
| 538 | vgDestroyImage(dstVgImage); | ||
| 539 | eglDestroyImageKHR(context->display(), eglImage); | ||
| 540 | SgDriver::Close(); | ||
| 541 | return sgImage; | ||
| 542 | #else | ||
| 543 | return 0; | ||
| 544 | #endif | ||
| 545 | } | ||
| 546 | #endif //Q_OS_SYMBIAN | ||
| 376 | 547 | QT_END_NAMESPACE |
src/openvg/qpixmapdata_vg_p.h
(13 / 1)
|   | |||
| 56 | 56 | #include <QtGui/private/qpixmap_raster_p.h> | |
| 57 | 57 | #include <private/qvg_p.h> | |
| 58 | 58 | #if !defined(QT_NO_EGL) | |
| 59 | #include <QtGui/private/qegl_p.h> | ||
| 60 | 59 | #endif | |
| 61 | 60 | ||
| 61 | #if defined(Q_OS_SYMBIAN) | ||
| 62 | class RSGImage; | ||
| 63 | #endif | ||
| 64 | |||
| 62 | 65 | QT_BEGIN_NAMESPACE | |
| 63 | 66 | ||
| 64 | 67 | class QEglContext; | |
| … | … | ||
| 94 | 94 | ||
| 95 | 95 | QSize size() const { return QSize(w, h); } | |
| 96 | 96 | ||
| 97 | #if defined(Q_OS_SYMBIAN) | ||
| 98 | RSgImage* toRSgImage(); | ||
| 99 | void fromRSgImage(RSgImage* sgImage); | ||
| 100 | #endif | ||
| 101 | |||
| 97 | 102 | protected: | |
| 98 | 103 | int metric(QPaintDevice::PaintDeviceMetric metric) const; | |
| 104 | |||
| 105 | #if defined(Q_OS_SYMBIAN) | ||
| 106 | void cleanup(); | ||
| 107 | #endif | ||
| 99 | 108 | ||
| 100 | 109 | private: | |
| 101 | 110 | VGImage vgImage; |
|   | |||
| 14 | 14 | } symbian*: { | |
| 15 | 15 | DEPLOYMENT_PLUGIN += qmng | |
| 16 | 16 | LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll | |
| 17 | contains(QT_CONFIG, openvg) { | ||
| 18 | LIBS += $$QMAKE_LIBS_OPENVG | ||
| 19 | } | ||
| 17 | 20 | } else { | |
| 18 | 21 | DEFINES += SRCDIR=\\\"$$PWD\\\" | |
| 19 | 22 | win32:LIBS += -lgdi32 -luser32 |

