summaryrefslogtreecommitdiffstats
path: root/src/openvg/qpaintengine_vg.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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-151-4/+4
| | | | | | | | | | | | | 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
* 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
* 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
* 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
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-071-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-061-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Avoid deep QImage copies in the OpenVG paint engineRhys Weatherley2010-01-041-8/+11
| | | | | | | | | | 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-151-4/+12
| | | | | | | | | | | | | 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
* 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
* Make QVGCompositionHelper::blitWindow() more genericRhys Weatherley2009-11-251-5/+2
| | | | | | | | | | 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-221-0/+28
| | | | | Task-number: QT-2026 Reviewed-by: Jason Barron
* 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
* Protect the OpenVG engine from null QPixmapData objectsRhys Weatherley2009-11-021-0/+10
| | | | Reviewed-by: Sarah Smith
* Remove drawCursorImage() from the OpenVG composition helperRhys Weatherley2009-10-301-36/+33
| | | | | | | The drawCursorPixmap() function is more efficient and can render the QImage form of the QPixmap directly if necessary. Reviewed-by: trustme
* Fix OpenVG window composition when opacity != 1Rhys Weatherley2009-10-271-20/+16
| | | | | Task-number: QT-2322 Reviewed-by: Sarah Smith
* Use vgClear() to clear the background during screen compositing.Rhys Weatherley2009-10-271-18/+46
| | | | | | | | This fixes an "off by 1" bug in screen compositing with OpenVG that left lines all over the background when windows were moved. Task-number: QT-2322 Reviewed-by: Sarah Smith
* Optimize QVGPixmapDropShadowFilter by removing colorize stepRhys Weatherley2009-10-191-0/+18
| | | | | | | | | | | | | Previously, the drop shadow was colorizing the incoming image and then blurring the colorized version. This change first blurs the image to an alpha-only VGImage and then uses that VGImage as a stencil to draw the drop shadow color. This way, there is only 1 filter step and a draw instead of 2 filter steps and a draw. The result is to make the performance of the drop shadow filter almost identical to the blur filter. Reviewed-by: trustme
* Implement the strength parameter for OpenVG colorize filtersRhys Weatherley2009-10-161-3/+0
| | | | | Task-number: QT-2016 Reviewed-by: trustme
* Improve scissor clipping in the OpenVG engineRhys Weatherley2009-10-131-0/+4
| | | | | | | | If the scissor is being used to clip instead of the mask, use the bounding rectangle of the clip path if it cannot be handled as a simple rectangle. Reviewed-by: trustme
* Implement qDrawPixmaps for the OpenVG paint engine.Rhys Weatherley2009-10-131-0/+115
| | | | | | | Best performance will be acheived with OpaqueHint and drawing the full pixmap rather than sub-regions. Reviewed-by: trustme
* Make QPF's implementation of alphaMapForGlyph() consistent.Rhys Weatherley2009-09-291-14/+0
| | | | | | | | | | | | | | The QPF implementation of alphaMapForGlyph() was returning color values of RGBA = (a, a, a, 255) instead of (0, 0, 0, a), which was inconsistent with all the other font engines. This inconsistency caused some QPF-specific workarounds in the OpenGL and OpenVG paint engines. This change removes the workarounds and makes QPF generate the right colors from the start. Paint engines that ignore the color table or which don't use the alphaMapForGlyph() function (e.g. raster) are not affected. Reviewed-by: Paul
* Fix cubic paths in OpenVGRhys Weatherley2009-09-231-3/+3
| | | | | | | | | | The multitouch/dials example was displaying rendering artifacts on the dials in the default style. This was due to incorrect VGPath construction when sizeof(qreal) == sizeof(VGfloat). It was adding two VG_CUBIC_TO_ABS elements per cubic instead of one. Task-number: QT-2035 Reviewed-by: Sarah Smith
* Calculate scissor correctly in OpenVG engineRhys Weatherley2009-09-211-1/+1
| | | | Reviewed-by: trustme
* Accelerate drawRoundedRect() for the OpenVG paint engineRhys Weatherley2009-09-201-0/+98
| | | | | | | | Previously rounded rectangles were converted into a QVectorPath and then a VGPath. This change creates the VGPath directly without an intermediate step and was made possible by change dd3e4308. Reviewed-by: trustme
* Colorize filter for OpenVG doesn't currently support strength()Rhys Weatherley2009-09-181-0/+3
| | | | Reviewed-by: trustme
* Reduce overhead of paint engine-specific pixmap filtersRhys Weatherley2009-09-161-11/+27
| | | | | | | | | | | | | | | | | | | Engine-specific pixmap filters were being created, used, and destroyed every time draw() was called on QPixmapColorizeFilter, QPixmapBlurFilter, and so on. This had a heavy performance penalty and made it difficult for the GL paint engine to cache shaders from one request to the next. A generic filter can request an engine-specific filter that matches its parameters. The engine can either create a new one or return a previously allocated filter object. Ownership of engine-specific pixmap filter objects is moved to the paint engine itself. Reviewed-by: Andrew den Exter Reviewed-by: Michael Brasser Reviewed-by: Michael Goddard Reviewed-by: Sarah Smith
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Improved QPainter API for allowing native painting in GL / VG.Samuel Rødal2009-08-261-32/+31
| | | | | | | | Previously we were using QPaintEngine::syncState() which is not ideal naming-wise, since it actually prepares for native painting instead of syncing the painter's state to native state. Reviewed-by: Trond
* Don't dereference VGImage's that come from QVGPixmapDataRhys Weatherley2009-08-251-1/+9
| | | | | | | | | | TexturePattern brushes were sometimes turning all black with OpenVG. This was due to the vgDestroyImage() destroying the cached VGImage in the QVGPixmapData. We only need to use vgDestroyImage() if the QPixmap is not backed up by a QVGPixmapData (bitmaps and pixmaps from other paint engines). Reviewed-by: Sarah Smith
* Implement the blur pixmap filter for OpenVG using vgGaussianBlur()Rhys Weatherley2009-08-251-0/+2
| | | | Reviewed-by: Sarah Smith
* Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | Reviewed-by: Trust Me
* OpenVG: short-cut clipping for QPainterPath's that are just rectsRhys Weatherley2009-07-021-0/+50
| | | | | | | | | If the QPainterPath contains a structure that looks like a simple rectangle, then use the faster clip(QRect) function instead of a full VGPath-based render call. Task-number: QT-64 Reviewed-by: trustme
* OpenVG: override QPaintEngineEx::clip(QRect) and handle specially.Rhys Weatherley2009-07-021-2/+128
| | | | | | | | This change should improve performance of single-rectangle clip regions by avoiding the overhead of creating and intersecting QRegion objects. Task-number: QT-64 Reviewed-by: trustme
* OpenVG: use the correct clip region to detect single-rect clipsRhys Weatherley2009-07-011-2/+2
| | | | | | | | | | "Special case: if the intersection of the system clip and the region is a single rectangle, then use the scissor for clipping." It was doing the intersection but then didn't use the intersection to test for the single-rectangle case. Task-number: QT-64 Reviewed-by: trustme
* OpenVG compile fix - use const_cast instead of static_castRhys Weatherley2009-07-011-4/+4
| | | | Reviewed-by: trustme
* Integrate the OpenVG graphics system into Qt 4.6Rhys Weatherley2009-06-221-0/+3231
This change also moves the EGL support classes from QtOpenGL to QtGui so they can be shared between OpenGL and OpenVG.