Changeset 651 for trunk/src/openvg
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
-
. (modified) (1 prop)
-
src/openvg/qpaintengine_vg.cpp (modified) (28 diffs)
-
src/openvg/qpaintengine_vg_p.h (modified) (1 diff)
-
src/openvg/qpixmapdata_vg.cpp (modified) (5 diffs)
-
src/openvg/qpixmapdata_vg_p.h (modified) (1 diff)
-
src/openvg/qpixmapfilter_vg.cpp (modified) (1 diff)
-
src/openvg/qpixmapfilter_vg_p.h (modified) (1 diff)
-
src/openvg/qvg.h (modified) (1 diff)
-
src/openvg/qvg_p.h (modified) (1 diff)
-
src/openvg/qvgcompositionhelper_p.h (modified) (1 diff)
-
src/openvg/qvgimagepool.cpp (modified) (1 diff)
-
src/openvg/qvgimagepool_p.h (modified) (1 diff)
-
src/openvg/qwindowsurface_vg.cpp (modified) (1 diff)
-
src/openvg/qwindowsurface_vg_p.h (modified) (1 diff)
-
src/openvg/qwindowsurface_vgegl.cpp (modified) (1 diff)
-
src/openvg/qwindowsurface_vgegl_p.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/openvg/qpaintengine_vg.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 189 189 bool maskValid; // True if vgMask() contains valid data. 190 190 bool maskIsSet; // True if mask would be fully set if it was valid. 191 191 192 bool rawVG; // True if processing a raw VG escape. 192 193 … … 356 357 maskValid = false; 357 358 maskIsSet = false; 359 358 360 rawVG = false; 359 361 … … 1543 1545 { 1544 1546 QTransform::TransformationType type = transform.type(); 1545 return (type == QTransform::TxNone || type == QTransform::TxTranslate); 1547 if (type == QTransform::TxNone || type == QTransform::TxTranslate) 1548 return true; 1549 if (type == QTransform::TxRotate) { 1550 // Check for 0, 90, 180, and 270 degree rotations. 1551 // (0 might happen after 4 rotations of 90 degrees). 1552 qreal m11 = transform.m11(); 1553 qreal m12 = transform.m12(); 1554 qreal m21 = transform.m21(); 1555 qreal m22 = transform.m22(); 1556 if (m11 == 0.0f && m22 == 0.0f) { 1557 if (m12 == 1.0f && m21 == -1.0f) 1558 return true; // 90 degrees. 1559 else if (m12 == -1.0f && m21 == 1.0f) 1560 return true; // 270 degrees. 1561 } else if (m12 == 0.0f && m21 == 0.0f) { 1562 if (m11 == -1.0f && m22 == -1.0f) 1563 return true; // 180 degrees. 1564 else if (m11 == 1.0f && m22 == 1.0f) 1565 return true; // 0 degrees. 1566 } 1567 } 1568 return false; 1546 1569 } 1547 1570 … … 1665 1688 d->maskValid = false; 1666 1689 d->maskIsSet = true; 1690 1667 1691 d->maskRect = QRect(); 1668 1692 vgSeti(VG_MASKING, VG_FALSE); … … 1670 1694 } 1671 1695 1672 #if defined(QVG_NO_RENDER_TO_MASK)1673 1696 // We don't have vgRenderToMask(), so handle simple QRectF's only. 1674 1697 if (path.shape() == QVectorPath::RectangleHint && … … 1680 1703 points[5] - points[1]); 1681 1704 clip(rect.toRect(), op); 1682 } 1683 #else 1705 return; 1706 } 1707 1708 #if !defined(QVG_NO_RENDER_TO_MASK) 1684 1709 QPaintDevice *pdev = paintDevice(); 1685 1710 int width = pdev->width(); … … 1712 1737 d->maskValid = true; 1713 1738 d->maskIsSet = false; 1739 1714 1740 #endif 1715 1741 } … … 1732 1758 d->maskValid = false; 1733 1759 d->maskIsSet = true; 1760 1734 1761 d->maskRect = QRect(); 1735 1762 vgSeti(VG_MASKING, VG_FALSE); … … 1747 1774 d->maskValid = false; 1748 1775 d->maskIsSet = true; 1776 1749 1777 d->maskRect = QRect(); 1750 1778 } else { … … 1764 1792 d->maskValid = false; 1765 1793 d->maskIsSet = false; 1794 1766 1795 d->maskRect = QRect(); 1767 1796 d->modifyMask(this, VG_FILL_MASK, r); … … 1772 1801 d->maskValid = false; 1773 1802 d->maskIsSet = false; 1803 1774 1804 d->maskRect = clipRect; 1775 1805 vgSeti(VG_MASKING, VG_FALSE); … … 1782 1812 { 1783 1813 QRect r = d->transform.mapRect(rect); 1784 if (d->maskIsSet && isDefaultClipRect(r)) { 1814 if (!d->maskValid) { 1815 // Mask has not been used yet, so intersect with 1816 // the previous scissor-based region in maskRect. 1817 if (d->scissorMask) 1818 r = r.intersect(d->maskRect); 1819 if (isDefaultClipRect(r)) { 1820 // The clip is the full window, so turn off clipping. 1821 d->maskIsSet = true; 1822 d->maskRect = QRect(); 1823 } else { 1824 // Activate the scissor on a smaller maskRect. 1825 d->maskIsSet = false; 1826 d->maskRect = r; 1827 } 1828 d->scissorMask = true; 1829 updateScissor(); 1830 } else if (d->maskIsSet && isDefaultClipRect(r)) { 1785 1831 // Intersecting a full-window clip with a full-window 1786 1832 // region is the same as turning off clipping. … … 1789 1835 d->maskValid = false; 1790 1836 d->maskIsSet = true; 1837 1791 1838 d->maskRect = QRect(); 1792 1839 } else { … … 1830 1877 d->maskValid = false; 1831 1878 d->maskIsSet = true; 1879 1832 1880 d->maskRect = QRect(); 1833 1881 vgSeti(VG_MASKING, VG_FALSE); … … 1845 1893 d->maskValid = false; 1846 1894 d->maskIsSet = true; 1895 1847 1896 d->maskRect = QRect(); 1848 1897 } else { … … 1858 1907 d->maskValid = false; 1859 1908 d->maskIsSet = false; 1909 1860 1910 d->maskRect = clip.boundingRect(); 1861 1911 vgSeti(VG_MASKING, VG_FALSE); … … 1864 1914 d->maskValid = false; 1865 1915 d->maskIsSet = false; 1916 1866 1917 d->maskRect = QRect(); 1867 1918 d->modifyMask(this, VG_FILL_MASK, r); … … 1888 1939 d->maskValid = false; 1889 1940 d->maskIsSet = true; 1941 1890 1942 d->maskRect = QRect(); 1891 1943 } else { … … 1966 2018 d->maskValid = false; 1967 2019 d->maskIsSet = true; 2020 1968 2021 d->maskRect = QRect(); 1969 2022 vgSeti(VG_MASKING, VG_FALSE); … … 2001 2054 d->maskValid = true; 2002 2055 d->maskIsSet = false; 2056 2003 2057 #else 2004 2058 QPaintEngineEx::clip(path, op); … … 2044 2098 maskValid = true; 2045 2099 maskIsSet = false; 2100 2046 2101 } 2047 2102 … … 2065 2120 maskValid = true; 2066 2121 maskIsSet = false; 2122 2067 2123 } 2068 2124 … … 2097 2153 #if !defined(QVG_SCISSOR_CLIP) 2098 2154 // Combine the system clip with the simple mask rectangle. 2099 if ( !d->maskRect.isNull()) {2155 if () { 2100 2156 if (region.isEmpty()) 2101 2157 region = d->maskRect; … … 2188 2244 d->maskValid = false; 2189 2245 d->maskIsSet = true; 2246 2190 2247 d->maskRect = QRect(); 2191 2248 s->clipRegion = defaultClipRegion(); … … 2197 2254 d->maskValid = false; 2198 2255 d->maskIsSet = false; 2256 2199 2257 d->maskRect = QRect(); 2200 2258 } … … 2315 2373 QVGPainterState *s = state(); 2316 2374 if (!s->clipEnabled || s->clipOperation == Qt::NoClip) { 2317 // The transform will either be identity or a simple translation, 2318 // so do a simpler version of "r = d->transform.map(rect).toRect()". 2319 QRect r = QRect(qRound(rect.x() + d->transform.dx()), 2320 qRound(rect.y() + d->transform.dy()), 2321 qRound(rect.width()), 2322 qRound(rect.height())); 2375 QRect r = d->transform.mapRect(rect).toRect(); 2323 2376 int height = paintDevice()->height(); 2324 2377 if (d->clearColor != color || d->clearOpacity != s->opacity) { … … 3399 3452 d->maskValid = false; 3400 3453 d->maskIsSet = false; 3454 3401 3455 d->maskRect = QRect(); 3402 3456 clipEnabledChanged(); -
trunk/src/openvg/qpaintengine_vg_p.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qpixmapdata_vg.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 47 47 48 48 #ifdef QT_SYMBIAN_SUPPORTS_SGIMAGE 49 50 49 51 #include <graphics/sgimage.h> 50 52 typedef EGLImageKHR (*pfnEglCreateImageKHR)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, EGLint*); 51 53 typedef EGLBoolean (*pfnEglDestroyImageKHR)(EGLDisplay, EGLImageKHR); 52 54 typedef VGImage (*pfnVgCreateEGLImageTargetKHR)(VGeglImageKHR); 53 #endif 55 #endif 54 56 55 57 QT_BEGIN_NAMESPACE … … 426 428 427 429 #if defined(Q_OS_SYMBIAN) 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 428 458 void QVGPixmapData::cleanup() 429 459 { … … 511 541 SgDriver::Close(); 512 542 } else if (type == QPixmapData::FbsBitmap) { 513 543 CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap*>(pixmap); 544 545 bool deleteSourceBitmap = false; 546 547 #ifdef Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE 548 549 // Rasterize extended bitmaps 550 551 TUid extendedBitmapType = bitmap->ExtendedBitmapType(); 552 if (extendedBitmapType != KNullUid) { 553 bitmap = createBlitCopy(bitmap); 554 deleteSourceBitmap = true; 555 } 556 #endif 557 558 if (bitmap->IsCompressedInRAM()) { 559 bitmap = createBlitCopy(bitmap); 560 deleteSourceBitmap = true; 561 } 562 563 TDisplayMode displayMode = bitmap->DisplayMode(); 564 QImage::Format format = qt_TDisplayMode2Format(displayMode); 565 566 TSize size = bitmap->SizeInPixels(); 567 568 bitmap->BeginDataAccess(); 569 uchar *bytes = (uchar*)bitmap->DataAddress(); 570 QImage img = QImage(bytes, size.iWidth, size.iHeight, format); 571 img = img.copy(); 572 bitmap->EndDataAccess(); 573 574 if(displayMode == EGray2) { 575 //Symbian thinks set pixels are white/transparent, Qt thinks they are foreground/solid 576 //So invert mono bitmaps so that masks work correctly. 577 img.invertPixels(); 578 } else if(displayMode == EColor16M) { 579 img = img.rgbSwapped(); // EColor16M is BGR 580 } 581 582 fromImage(img, Qt::AutoColor); 583 584 if(deleteSourceBitmap) 585 delete bitmap; 514 586 } 515 587 #else … … 594 666 return reinterpret_cast<void*>(sgImage); 595 667 } else if (type == QPixmapData::FbsBitmap) { 596 return 0; 668 CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); 669 670 if (bitmap) { 671 if (bitmap->Create(TSize(source.width(), source.height()), 672 EColor16MAP) == KErrNone) { 673 const uchar *sptr = qt_vg_imageBits(source); 674 bitmap->BeginDataAccess(); 675 676 uchar *dptr = (uchar*)bitmap->DataAddress(); 677 Mem::Copy(dptr, sptr, source.byteCount()); 678 679 bitmap->EndDataAccess(); 680 } else { 681 delete bitmap; 682 bitmap = 0; 683 } 684 } 685 686 return reinterpret_cast<void*>(bitmap); 597 687 } 598 688 #else -
trunk/src/openvg/qpixmapdata_vg_p.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qpixmapfilter_vg.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qpixmapfilter_vg_p.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qvg.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qvg_p.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qvgcompositionhelper_p.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qvgimagepool.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qvgimagepool_p.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qwindowsurface_vg.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qwindowsurface_vg_p.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qwindowsurface_vgegl.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/src/openvg/qwindowsurface_vgegl_p.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected])
Note:
See TracChangeset
for help on using the changeset viewer.
