summaryrefslogtreecommitdiffstats
path: root/src/openvg
Commit message (Collapse)AuthorAgeFilesLines
* Avoid a crash in the OpenVG paint engine when clipping to an empty pathJason Barron2010-07-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | The convertToPainterPath() function assumes that the QVectorPath contains at least one path element when creating the QPainterPath. This is not necessarily the case here though because if QVG_SCISSOR_CLIP is defined and setClipPath() is called with an empty QPainterPath, this is then converted to an empty QVectorPath in QPaintEngineEx::clip() which then calls QVGPaintEngine::clip(). This function then goes on to convert the QVectorPath back into a QPainterPath using the aforementioned function which crashes when attempting to access the first element of the path. In case you are wondering why this seemingly redundant conversion happens at all, it happens because when QVG_SCISSOR_CLIP is defined, we attempt to convert the path to a series of rects for scissor clipping and this conversion function operates on QPainterPath instead of QVectorPath which is what this clip() function was designed to deal with. The fix is to skip over the path conversion for empty paths and go directly to an empty QRegion. Reviewed-by: Alessandro Portale
* Include qmath.h to get the definition of ceil()Rhys Weatherley2010-07-051-0/+1
| | | | Reviewed-by: Julian de Bhal
* Avoid blurry text with OpenVG on SymbianAlessandro Portale2010-06-301-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt's graphics system uses qreal as measurement unit. The established paint engines (such as "raster") implicitly round textitem coordinates for technical reasons, e.g. for optimized blitting. Some Qt based Ui libraries (such as QWidgets) can in some cases cause textitems to be drawn on non-integer coordinates. In particular, this happens when centering text. Since these libraries have been developed against the established paint engines with implicit rounding, these non-integer coordinates were never an issue. The new OpenVG paintengine took these coordinates seriously without rounding them. On some OpenVG implementations (e.g. that of some Symbian phones), this led to blurry text rendering. This patch adds coordinate rounding for unscaled, unrotated textitems to the OpenVG paintengine. So that it does the same as the raster paint engine. Task-number: QT-3071 Reviewed-By: Jason Barron
* Clipping with rounded rectangles and QVG_SCISSOR_CLIPRhys Weatherley2010-06-021-4/+41
| | | | | | | | | | | | | | | | WebKit draws rounded rectangles by setting a rounded rect path as a clip and then filling the clip. This had problems when QVG_SCISSOR_CLIP was enabled because the scissor would only clip to the bounding box of complex paths. Thus, rounded rectangle clips were turned into normal rectangle clips. This change will make the scissor clipping code subdivide complex paths into rectangles and use a tighter clip if the number of rectangles is less than or equal to VG_MAX_SCISSOR_RECTS. If it is greater, then it will fall back to the bounding box of the path. Task-number: QT-3372 Reviewed-by: Jason Barron
* OpenVG blending modes from VG_KHR_advanced_blending extensionRhys Weatherley2010-05-121-4/+83
| | | | | | | | | | This change introduces the extra blending modes that are defined in the VG_KHR_advanced_blending extension. Patch originally provided by contributor: http://qt.gitorious.org/qt/qt/merge_requests/505 Reviewed-by: Julian de Bhal
* correctly position glyphs for complex languagesLars Knoll2010-04-211-32/+22
| | | | | | | | | | | | | Correctly use the positions calculated by getGlyphPositions to draw the glyphs. Simplify the logic a bit so that we don't need the glyphTransform anymore, but can instead just use the pathTransform for text drawing as well. Tested with latin, arabic, hebrew and Hindi text Task-number: QT-3300 Reviewed-by: Jason Barron
* Fix RTL text rendering in the QVGPaintEngineAlessandro Portale2010-04-161-2/+7
| | | | | | | | | | | | | | | The QVGPaintEngine calls vgDrawGlyphs() to draw the glyphs of a QTextItem. vgDrawGlyphs(), which is an official OpenVG function, and not implemented in Qt itself, expects glyphs coordinates differently than Qt's glyph painting loops of other paint engines expect. Therefore, we need to handle RTL text separately in QVGPaintEngine::drawTextItem(). Rhys Weatherley provided this patch. This issue is not Symbian specific, but rather QVGPaintEngine specific. Task-number: QT-3140 Reviewed-by: Rhys Weatherley
* Symbol visibility fixes for RVCT4 on SymbianIain2010-04-152-6/+6
| | | | | | | | | | | | | RVCT 4 is far more strict with regards to symbol visiblity that RVCT 2.2, and will hide symbols unless all references have default visibility in the object files. Update the various places in Qt code where the symbol visibility was set incorrectly for DLL-based platforms (those that use __declspec(dllimport) and (dllexport). Note: QtWebkit and QtScript are fixed in different commits. Task-number: QTBUG-9903 Reviewed-by: Jason Barron
* Implement OpenVG buffer scrolling and enable it on Symbian.Jason Barron2010-04-144-2/+36
| | | | | | | | | | | | | | | Add support for accelerated scrolling in the "direct" window surface implementation. Using vgCopyPixels(), the already rasterized content on the surface can be shifted to a new location such that only a portion of the suqsequent frame needs to be repainted instead of the entire frame. This only works when the "preserved" EGL swap behavior is enabled and the impact on performance is highly dependant on the specific hardware platform in use. Task-number: QT-2972 Reviewed-by: Rhys Weatherley
* Enable preserved swap behavior when surface is created due to resize.Jason Barron2010-04-091-11/+13
| | | | | | | | | | | | | | | When the QVG_RECREATE_ON_SIZE_CHANGE macro is defined the EGL surface is recreated. However, after creating the surface, we were neglecting to set the surface attribute that enabled the preserved swapping behavior of EGL. This lead to flicker because every second frame was swapping with an empty buffer and only the dirty areas were being painted leaving the rest empty. Reviewed-by: Lars Knoll Reviewed-by: Aleksandar Sasha Babic Task-number: QT-3198 Task-number: QT-3184 Task-number: QT-3201
* Another "off by 1" problem in OpenVG - in paths this time.Rhys Weatherley2010-03-301-19/+22
| | | | | | | | | Summary so far: paths and images do not need the 0.5 adjustment to the transform, but glyphs do. Not sure why glyphs do, but the fonts definitely look wrong without the adjustment. Task-number: QT-3192 Reviewed-by: trustme
* Fix another off-by-1 error in OpenVG image painting.Rhys Weatherley2010-03-251-1/+1
| | | | | | | Off in the vertical direction this time; previously was horizontal. Task-number: QT-2999 Reviewed-by: Jason Barron
* Fix OpenVG build on non-Symbian platforms.Rhys Weatherley2010-03-251-0/+2
| | | | Reviewed-by: trustme
* Fix #ifdef logic for Symbian conversion functions in QVGPixmapData.Jason Barron2010-03-221-9/+4
| | | | | | | | | | The previous #ifdef logic had the entire body of fromNativeType() and toNativeType() #ifdef'ed out meaning that the OpenVG graphics system could not convert CFbsBitmap instances to VGImage instances. This was obviously incorrect because this code has no dependancy on RSgImage (or EGL) and should therefore be outside of the #ifdef. Reviewed-by: TrustMe
* Change fromSymbianRSgImage() to use the newer version of RSgImageJason Barron2010-03-191-34/+31
| | | | | | | | | Symbian have changed the implementation of RSgImage to be more lightweight and have moved it to a new library. This patch changes Qt's usage of RSgImage to the new version and fixes some minor code style issues. Reviewed-by: Aleksandar Sasha Babic
* Build OpenVG on Symbian with QVG_RECREATE_ON_SIZE_CHANGE.Jason Barron2010-03-181-0/+2
| | | | | | | | | If the size of the window changes, then there is a chance that this will require a re-allocation so it's better to handle the re-allocation here when the window size has changed because we don't want the error to occur in eglSwapBuffers. Reviewed-by: TrustMe
* Fix linking issues of QtOpenVG.dllAlessandro Portale2010-03-162-21/+17
| | | | | | | | QEglContext::display() is a static function, and exported as such. qpixmapdata_vg.cpp and qwindowsurface_vgegl.cpp referenced it as a non- static function which made the linking of QtOpenVG.dll fail. Reviewed-by: Jason Barron
* Added check for null pointer in qt_vg_unregister_pixmap.Miikka Heikkinen2010-03-101-1/+2
| | | | | | | | | | The method qt_vg_unregister_pixmap is sometimes called when the QVGSharedContext is already destroyed. Do not try to access it if it is null. Part of QtP delta reduction effort. Reviewed-by: Jason Barron
* Image drawing in OpenVG was off by 0.5 of a pixelRhys Weatherley2010-03-051-9/+14
| | | | | | | | | Path transforms need to be adjusted by 0.5 for the difference in OpenVG and Qt co-ordinate systems. Image transforms do not need to be adjusted because OpenVG implicitly adjusts by 0.5. Task-number: QT-2999 Reviewed-by: Sarah Smith
* When using OpenVG alpha mask, turn off scissor-as-maskRhys Weatherley2010-03-051-0/+1
| | | | | Task-number: QT-3033 Reviewed-by: Julian de Bhal
* Remove vgClearPath() change to OpenVG paint engineRhys Weatherley2010-03-031-67/+57
| | | | | | | | | Upon further investigation, vgClearPath() doesn't help as much on target devices as just making a new path. Revert "Improve performance of VGPath creation by reusing the same path" This reverts commit 8597e03495f54614e53c6063f1f13077a08109fd.
* Improve performance of VGPath creation by reusing the same pathRhys Weatherley2010-02-221-57/+67
| | | | | | | | The vgClearPath() function can be used to clear a path for reuse more efficiently than destroying the path and creating a new one. Task-number: QT-2974 Reviewed-by: Daniel Pope
* Don't use vgClear() for semi-transparent brushes.Jason Barron2010-02-221-2/+2
| | | | | | | | | | | | | | | If the brush is not totally opaque we should not use vgClear() at this point because vgClear() does not support blending. Instead it writes the values directly into the surface which clobbers any existing content. The bug exhibits itself when a child widget fills itself with any transparent color. Instead of blending with the parent widget's content, it writes the semi-transparent color directly to the surface, overwriting the parent content and leaving the surface in a somewhat undefined state because the alpha channel is not honoured unless Qt::WA_TranslucentBackground is set. Task-number: QTBUG-8007 Reviewed-by: Rhys Weatherley
* Cleanup QEglContext & EGLDisplaysTom Cooksey2010-02-121-4/+0
| | | | | | | | | This basicaly replaces display(), openDisplay() & defaultDisplay() methods with a single display() and nativeDisplay(), the latter being implemented in the platform-specific files and everything else being cross-platform code. Reviewed-By: Trond
* Use OpenVG scissor on 90/180/270 rotations and simple clips.Rhys Weatherley2010-02-041-7/+23
| | | | | Task-number: QTBUG-7864 Reviewed-by: Sarah Smith
* Optimize single-rect IntersectClip in OpenVG using the scissorRhys Weatherley2010-02-041-4/+42
| | | | | Task-number: QTBUG-7791 Reviewed-by: Sarah Smith
* Implementation for QVGPixmapData to/fromSymbianCFbsBitmapJani Hautakangas2010-02-031-2/+92
| | | | functions.
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-0715-15/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QIODevice: Fix readAll() Temporary hackiesh solution to prevent BOM in the xml data. Fixed qxmlstream autotest when using shadow builds. Attempt at readding the capital P headers for Phonon Remove special Phonon processing from syncqt. Use the lowercase/shortname.h headers for Phonon includes Fixes a crash when setting focus on a widget with a focus proxy. Update copyright year to 2010 doc: Clarified activeSubControls and subControls. Remove warning "statement with no effect" doc: Clarified that .lnk files are System files on Windows.
| * Update copyright year to 2010Jason McDonald2010-01-0615-15/+15
| | | | | | | | Reviewed-by: Trust Me
* | Avoid deep QImage copies in the OpenVG paint engineRhys Weatherley2010-01-042-9/+12
| | | | | | | | | | Task-number: QTBUG-7015 Reviewed-by: Daniel Pope
* | Reset the OpenVG scissor after a native painting call-outRhys Weatherley2010-01-041-2/+11
|/ | | | | Task-number: QTBUG-7051 Reviewed-by: Daniel Pope
* Add an image allocation pool to the OpenVG paint engineRhys Weatherley2009-12-158-53/+479
| | | | | | | | | | | | | Some OpenVG GPU's have limitations on the amount of memory available to create VGImage's. When the memory runs out, vgCreateImage() will fail. This change introduces QVGImagePool, which keeps track of all QVGPixmapData image allocations and ejects least-recently-used pixmaps when GPU memory is exhausted. Task-number: QT-2554 Reviewed-by: trustme
* Recreate VGImage properly in out of memory caseRhys Weatherley2009-12-091-0/+8
| | | | | | | | | If vgCreateImage() runs out of memory, then the drawPixmap() will fail. But previously, it would also prevent future attempts to call vgImageSubData() to populate the data when memory was present. Task-number: QTBUG-6639 Reviewed-by: Sarah Smith
* Merge oslo-staging-2/4.6 into upstream/4.6Olivier Goffart2009-12-094-29/+169
|\
| * Automatically destroy VG pixmaps when the last window surface goes awayRhys Weatherley2009-12-064-29/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Under S60, Qt will destroy the window surfaces of an application that goes into the background, which frees up EGL surface objects. But the VGImage's for pixmaps, and the EGLContext, were still using GPU memory. This change keeps track of the number of widgets / window surfaces that are in use and then calls hibernate() on all QVGPixmapData objects when it goes to zero. Once all the VGImage's are destroyed, the EGLContext should also be destroyed. Task-number: QT-2555 Reviewed-by: Sarah Smith
* | Assign Symbian UID to QtOpenVg moduleIain2009-12-031-0/+1
|/ | | | Reviewed-by: TrustMe
* Fix infinite recursion in OpenVG scissor-only clippingRhys Weatherley2009-11-271-12/+0
| | | | | | | | | | | When a complex transform was set, clip(QVectorPath) would call clip(QRect) with the control point rect, which would then turn around and say "transform is complex, call clip(QVectorPath)", causing an infinite loop until stack crash. Remove the "fall back to vector path" case as it isn't useful for scissor-only clipping. Doesn't affect mask-based clipping. Reviewed-by: Sarah Smith
* QT_VG_EGL_CONFIG env var to specify explicit EGL configs for OpenVGRhys Weatherley2009-11-261-0/+36
| | | | Reviewed-by: Sarah Smith
* Don't ask for pbuffers when searching for an OpenVG configurationRhys Weatherley2009-11-261-3/+3
| | | | Reviewed-by: Sarah Smith
* Make QVGCompositionHelper::blitWindow() more genericRhys Weatherley2009-11-252-7/+4
| | | | | | | | | | Previously, the composition helper would use the VG window surface private structure to get the VGImage to blit. This change passes the VGImage and size values in directly so that the composition helper can also be used to blit GL surfaces that have been converted into a VGImage via an EGLImage. Reviewed-by: Tom Cooksey
* Support semi-transparent surfaces in the OpenVG graphics systemRhys Weatherley2009-11-223-3/+41
| | | | | Task-number: QT-2026 Reviewed-by: Jason Barron
* Do not recreate the VGImage if the size is unchangedRhys Weatherley2009-11-202-33/+10
| | | | | | | | | When a pixmap's contents change in QVGPixmapData, only recreate the VGImage in the GPU if the size is different than before. This should help reduce GPU memory fragmentation. Task-number: QT-2504 Reviewed-by: Sarah Smith
* Remove unmatched else in non-EGL mode for OpenVG pixmap dataRhys Weatherley2009-11-201-1/+0
| | | | Reviewed-by: Gunnar Sletta
* Prevent a deep copy of QImage::bits() in the OpenVG pixmap implementationRhys Weatherley2009-11-201-2/+10
| | | | | Task-number: QTBUG-5869 Reviewed-by: Sarah Smith
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-11-131-8/+8
|\ | | | | | | | | Conflicts: dist/changes-4.6.0
| * API review: Rename numRects() -> rectCount()Marius Storm-Olsen2009-11-091-8/+8
| | | | | | | | | | | | | | QRegion::numRects() is marked obsolete. Removed all usage of the old function inside Qt and test-cases. Reviewed-by: Andreas Aardal Hanssen
* | Support OpenVG graphics systems that inherit from QVGPixmapDataRhys Weatherley2009-11-111-3/+3
|/ | | | | | | | Custom graphics systems, may want to inherit from QVGPixmapData to implement alternative pixmap management strategies. We make toVGImage() overridable and the data members protected to support this. Reviewed-by: Sarah Smith
* Protect the OpenVG engine from null QPixmapData objectsRhys Weatherley2009-11-023-0/+24
| | | | Reviewed-by: Sarah Smith
* OpenVG pixmap filter classes don't need to be exported.Rhys Weatherley2009-10-301-4/+4
| | | | Reviewed-by: trustme
* Remove drawCursorImage() from the OpenVG composition helperRhys Weatherley2009-10-302-37/+33
| | | | | | | The drawCursorPixmap() function is more efficient and can render the QImage form of the QPixmap directly if necessary. Reviewed-by: trustme