summaryrefslogtreecommitdiffstats
path: root/src/openvg
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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
* Make it possible to set the OpenVG swap intervalRhys Weatherley2009-10-301-0/+7
| | | | | | | | The QT_VG_SWAP_INTERVAL environment variable can be used to specify a value for eglSwapInterval(). Task-number: QT-2409 Reviewed-by: trustme
* Remove QVGEGLWindowSurfaceQImage from QtOpenVGRhys Weatherley2009-10-283-80/+2
| | | | | | | | Rendering into a QImage as a window backing store isn't very efficient and isn't needed by any of our current platforms. If a specific graphics system needs it in the future, it can implement it directly. 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-193-52/+25
| | | | | | | | | | | | | 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
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-196-55/+166
|\
| * Implement the strength parameter for OpenVG colorize filtersRhys Weatherley2009-10-163-54/+40
| | | | | | | | | | Task-number: QT-2016 Reviewed-by: trustme
| * qt_paint_device_metric() for fetching metricsRhys Weatherley2009-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | Custom window surfaces, graphics systems, and Qt/Embedded screen drivers often need to access QPaintDevice::metric(), but it is protected. Hence the growing number of friends in QWidget and QImage. The qt_paint_device_metric() function provides a more future-proof approach that doesn't require lots of friends. Reviewed-by: Gunnar
| * 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
| * Explicitly request the alpha mask in the EGL configurationRhys Weatherley2009-10-131-0/+4
| | | | | | | | | | | | | | | | The EGL implementation used in S60/NGA for OpenVG does not return a configuration with alpha masking unless it is explicitly requested. Reviewed-by: Julian de Bhal
| * Implement qDrawPixmaps for the OpenVG paint engine.Rhys Weatherley2009-10-132-0/+117
| | | | | | | | | | | | | | Best performance will be acheived with OpaqueHint and drawing the full pixmap rather than sub-regions. Reviewed-by: trustme
* | Added QPixmapData::createCompatiblePixmapData() used by QPixmap::copy().Samuel Rødal2009-10-142-0/+7
|/ | | | | | QPixmap::copy() now returns a pixmap with the same pixmap backend. Reviewed-by: Gunnar Sletta
* Make it possible to implement engine-specific drop shadow filtersRhys Weatherley2009-10-052-30/+17
| | | | | | | | | | | | It wasn't possible for the paint engine to override the drop shadow filter because QPixmapDropShadowFilter::draw() was not asking for an engine-specific filter object. Also, change the OpenVG filter to use vgGaussianBlur() instead of vgConvolve(), and draw the original image on top of the shadow. Task-number: QTBUG-4583 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
* Remove the storage of the EGLSurface from QEglContextRhys Weatherley2009-09-251-7/+5
| | | | Reviewed-by: Sarah Smith
* Push the "lazy doneCurrent" logic down from QtOpenVG into QEglRhys Weatherley2009-09-243-108/+29
| | | | | | | | | | | | | | QtOpenVG was doing a lot of housekeeping to avoid having to switch EGL contexts if the same surface was used over and over. This housekeeping really belongs in the QEgl layer so that QtOpenGL could potentially use it as well. This change also adds some overrides for makeCurrent(), swapBuffers(), and destroySurface() that take an EGLSurface directly. This is the first step in separating EGL surface management from context management. Reviewed-by: Sarah Smith
* 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
* Avoid calling ensureContext() in setGeometry.Jason Barron2009-09-231-1/+0
| | | | | | | | | We can delay calling ensureContext() since it will happen when painting begins anyway. There is a chance that we can get to this function when a window is being hidden and if this is the first thing that happens in the application, there is no need to call ensureContext() yet. Reviewed-by: Rhys Weatherley
* Modify functions for native pixmap data conversion on Symbian.Jason Barron2009-09-232-129/+141
| | | | | | | | | | | | | We need a way to support converion to and from multiple native pixmap types from multiple pixmap backends. Instead of adding more virtual functions to QPixmapData, make the existing one more generic but pass an opaque pointer and a type and do some internal casting. Currently this function is Symbian only, but could easily be extended to work on other platforms. Reviewed-by: Aleksandar Babic Reviewed-by: Jani Hautakangas
* Calculate scissor correctly in OpenVG engineRhys Weatherley2009-09-211-1/+1
| | | | Reviewed-by: trustme
* Accelerate drawRoundedRect() for the OpenVG paint engineRhys Weatherley2009-09-202-0/+100
| | | | | | | | 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
* Adding support for symbian graphics resources.Aleksandar Sasha Babic2009-09-182-1/+191
| | | | | | | | | | | | | | This enables us to convert from and to new Symbian type of graphics resource, namely SgImage. This only supported with the OpenVG graphics system. On other graphics systems this will return null QPixmap. Conflicts: src/corelib/global/qglobal.h src/gui/image/qpixmap.h src/gui/image/qpixmap_s60.cpp Reviewed-by: Jason Barron
* 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-162-12/+28
| | | | | | | | | | | | | | | | | | | 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
* Fix crash in QVGSharedContext shutdownRhys Weatherley2009-09-161-0/+4
| | | | | | | | The reference count was reducing down to zero during paint engine cleanup when we weren't ready to destroy the context. Artificially increase it to prevent the early context destroy. Reviewed-by: Sarah Smith
* Update license headers again.Jason McDonald2009-09-0913-52/+52
| | | | Reviewed-by: Trust Me
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-3111-143/+143
| | | | Reviewed-by: Trust Me
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-312-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
* Destroy EGL window surface when direct VG surface is deletedRhys Weatherley2009-08-301-0/+6
| | | | | | | OpenVG window surfaces were leaking because the QVGEGLWindowSurfaceDirect destructor was previously not cleaning up the EGLSurface object. Reviewed-by: trustme
* Improved QPainter API for allowing native painting in GL / VG.Samuel Rødal2009-08-262-33/+33
| | | | | | | | 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-253-0/+74
| | | | Reviewed-by: Sarah Smith
* Fix compilation of qpaintengine_vg.cpp.. again.Jason Barron2009-08-201-1/+1
| | | | | | | After the latest round of changes to Q_DECLARE_PRIVATE to use templates, we no longer need to call data() because Q_D() will expand to d_func() which will always return a pointer to the actual object instead of the scoped pointer.
* Merge commit 'qt/master'Jason Barron2009-08-181-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/examples.qdoc doc/src/plugins-howto.qdoc doc/src/topics.qdoc examples/phonon/musicplayer/mainwindow.cpp src/3rdparty/freetype/src/base/ftobjs.c src/corelib/global/qglobal.h src/corelib/tools/qalgorithms.h src/corelib/tools/qshareddata.cpp src/corelib/tools/qsharedpointer.cpp src/corelib/tools/tools.pri src/corelib/xml/qxmlstream.h src/gui/painting/painting.pri src/gui/widgets/qdatetimeedit.cpp tests/auto/qdesktopservices/qdesktopservices.pro tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp tests/auto/qtextcodec/test/test.pro
| * Use LIBS_PRIVATE on Mac and X11.Thiago Macieira2009-08-171-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the Mac, it means "-framework ApplicationServices -framework Carbon -framework AppKit" are no longer part of the default LIBS in Qt applications. This required a lot of fixes where we used Mac-specific code in Qt. On X11, it was very straightforward, because we apparently use very little of X11 outside QtGui. I haven't changed the Windows-specific LIBS paths, because I don't know how Windows behaves. Windows has DLLs, but it links to static "import" libraries. So is it static linking or dynamic linking? Reviewed-By: Marius Storm-Olsen