summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglpixmapfilter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update licenseheader text in source filesJyri Tahtela2011-05-131-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Fix static build on Windows with MinGW.Mark Brand2011-01-171-3/+3
| | | | | | | | | | | | | | | | | Q_DECL_IMPORT is still __declspec(dllimport), which is unsuitable for static code. Commit edbc656b changed Q_DECL_IMPORT_IMPORT to Q_CORE_EXPORT when declaring QtCore functions in svg. Now we change Q_DECL_IMPORT to Q_GUI_EXPORT when declaring QtGui functions into opengl and openvg. Also removed the redundant keyword "extern" from the function declarations. Merge-request: 2540 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: mariusSO
* Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | Reviewed-by: Trust Me
* Functions that are externally defined to QtOpenGL needs to be imported.Jani Hautakangas2010-10-211-3/+3
| | | | | | This is needed for RVCT4 Reviewed-by: Jason Barron
* Fixed QGLPixmapDropShadowFilter on Nvidia hardware.Trond Kjernaasen2010-05-111-4/+5
| | | | | | | | There seems to be a driver bug that causes glTexSubImage2D() to not align data correctly when uploading a GL_ALPHA texture. Task-number: related to QTBUG-10510 Reviewed-by: Samuel
* Add a pixmap modification hook to blur pixmap filter cacheTom Cooksey2010-02-081-0/+1
| | | | | | | We probably want to kick out filtered pixmaps from the cache when the source pixmap is modified as well as just destroyed. Reviewed-By: Samuel
* Fix GL texture leaks when pixmaps are deletedTom Cooksey2010-01-291-11/+11
| | | | | | | | | | | | | | This fixes quite a lot of issues: * QtOpenGL only registered qpixmap destruction hooks on X11 and those only cleanup the EGL/GLX surface, not the texture object. * The QPixmap destruction hooks were only being called from the QPixmap destructor. However, this means when a QPixmap is assigned to another QPixmap, the hooks don't get called. Task-number: QTBUG-7647 Reviewed-By: Samuel Reviewed-By: Trond
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* Got rid of unused variable compiler warning.Samuel Rødal2009-12-151-2/+0
|
* Optimized blur / drop shadow effects for the GL 2 paint engine.Samuel Rødal2009-12-141-581/+173
| | | | | | | | | Do the blur in half the resolution in software and then upload the result as a texture and smooth-scale it on the GPU. This leads to stable and decent performance regardless of the blur radius, and simplifies the implementation quite a bit. Reviewed-by: Bjørn Erik Nilsen
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-11-131-23/+23
|\ | | | | | | | | Conflicts: dist/changes-4.6.0
| * Improvements to graphics effects API after review round.Samuel Rødal2009-11-101-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | * Get rid of QGraphicsEffectSource from the public API, instead add convenience functions in QGraphicsEffect. This way we commit to less API, and are free to introduce a customizable QGraphicsEffectSource in a future release. * Move PixmapPadMode into QGraphicsEffect and tweak the names of the enum values. * Make QGraphicsBlurEffect::BlurHint into a bit flag, for extensibility. Reviewed-by: Bjørn Erik Nilsen
* | Fixed drop shadows for opengl graphics systemGunnar Sletta2009-11-101-1/+1
|/ | | | Reviewed-by: Samuel
* Compile on Mac OS XEskil Abrahamsen Blomfeldt2009-11-041-1/+1
| | | | | | | On Mac, there are compat overloads to e.g. setInternalTextureFormat() so we need to specify which function to call to avoid ambiguity. Reviewed-by: Samuel
* Fixed some compiler warnings.Samuel Rødal2009-11-031-23/+1
| | | | Reviewed-by: Trond
* Optimized animated blur radii in the GL 2 paint engine.Samuel Rødal2009-11-021-12/+367
| | | | | | | | | We add an internal cache which keeps four half-scaled versions of the source pixmap at different blur radii, then we simply interpolate between the two pixmaps around the desired blur radius, or between the base source pixmap and the first blurred version. Reviewed-by: Gunnar Sletta
* Moved Qt::RenderHint back into QGraphicsBlurEffect and added a hint.Samuel Rødal2009-11-021-14/+14
| | | | | | | | Added AnimationHint, which didn't make too much sense in a generic enum, so Qt::RenderHint was moved back into QGraphicsBlurEffect as QGraphicsBlurEffect::BlurHint. Reviewed-by: Gunnar Sletta
* Got rid of redundant texture parameter settings in GL pixmap filters.Samuel Rødal2009-10-291-16/+0
| | | | | | The texture parameters are set in drawTexture anyways. Reviewed-by: Gunnar Sletta
* Added some optimizations to the blur and drop shadow GL filters.Samuel Rødal2009-10-291-170/+266
| | | | | | | | | | | | | | | | | | | | * Use ExpandToTransparentBorderPadMode since we can use GL_CLAMP_TO_EDGE to clamp to the texture. * Shrink the bounding rects reported by the blur and drop shadow filters (expanding by 2 * radius isn't needed). * Use a single-pass blur for radii <= 3 to avoid the overhead of rendering to an FBO. * Made the fast blur setting generate filters for only a predefined set of radii, and then use the actual blur radius to spread the sample points outwards. * Optimized the generated program to rely less on temporary variables, as those seemed to not be handled very well by certain GLSL compilers. Reviewed-by: Gunnar Sletta
* Made blur and drop shadow APIs use qreal instead of int for blur radius.Samuel Rødal2009-10-271-2/+2
| | | | | | | There's no reason to lock ourselves to int in the API when some of the backend could handle floating point blur radii. Reviewed-by: Bjørn Erik Nilsen
* Implement the drop shadow filter for OpenGLRhys Weatherley2009-10-051-3/+164
| | | | | Task-number: QTBUG-4583 Reviewed-by: trustme
* Add Qt::RenderHint to control rendering operations.Bjørn Erik Nilsen2009-09-301-9/+9
| | | | | | | | | | | We need a way to control various rendering operations. For example, whether quality is more important than performance, or the other way around. This change also replaces occurences of QPixmapFilter/QGraphicsEffect::BlurHint (introduced in 1a431e850893b6b162c833f4f148f090e2427dda) with Qt::RenderHint. Reviewed-by: Samuel
* Convert OpenGL convolution filter to OpenGL2 paint engineRhys Weatherley2009-09-301-120/+59
| | | | | | | The convolution filter was still using the old-style OpenGL1 method for interfacing to the paint engine. Reviewed-by: trustme
* ifdef out convolution filter for OpenGL/ES 2.0Rhys Weatherley2009-09-281-2/+14
| | | | | | | | Convolution filter is not compatible with OpenGL/ES 2.0 in its current form, and we probably don't need it now that we have a special-purpose blur filter. Reviewed-by: trustme
* Added BlurType to blur graphics effect API.Samuel Rødal2009-09-241-10/+10
| | | | | | | | This lets the user control whether to use a fast dynamic blur when animating the radius of the blur for example, or to use a static high quality blur for one-time or constant radius blurring. Reviewed-by: Gunnar Sletta
* Made fast blur in GL 2 engine be radius independent.Samuel Rødal2009-09-241-140/+96
| | | | | | | | | | | This is useful when animating the blur radius, as you don't want to suffer the hit of compiling / linking a new shader program for each radius the first time the animation is played. Also use the fast blur when the radius is 5 or below, as the quality difference is insignificant. Reviewed-by: Rhys Weatherley
* Reduce overhead of paint engine-specific pixmap filtersRhys Weatherley2009-09-161-8/+13
| | | | | | | | | | | | | | | | | | | 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
* Only regenerate pixmap filter source if the parameters have changed.Rhys Weatherley2009-09-151-2/+31
| | | | Reviewed-by: trustme
* Remove unnecessary definitions in GL pixmap filter code.Rhys Weatherley2009-09-151-5/+0
| | | | | | The code does not use QGLShader directly any more. Reviewed-by: trustme
* Removed GL1 pixmap filters and ported colorize filter to GL2 engine.Samuel Rødal2009-09-151-45/+22
| | | | | | | | The GL1 engine will use the raster fall back for pixmap filters. We anyhow use GLSL for the filters, which requires OpenGL 2 support, and in that case the GL2 engine is the default. Reviewed-by: Gunnar Sletta
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Slightly improved QGLFramebufferObjectFormat API.Samuel Rødal2009-09-041-1/+1
| | | | | | | Renaming setInternalFormat() to setInternalTextureFormat() (and similarly for the accessor) makes the API a bit more explicit. Reviewed-by: Trond
* Fixed issues with using GLenum in public API on mac.Samuel Rødal2009-09-031-1/+1
| | | | | | | | | | The type of GLenum was changed between 10.4 and 10.5, so to support compiling on one and deploying on the other we need this hack. Also get rid of the complex QGLFramebufferObjectFormat constructor in favor of a simple default constructor and setters, which is more Qt-ish anyway, and avoids ambiguities on mac. Reviewed-by: Trond
* Fixed rendering bug in blurpicker example with -graphicssystem openglSamuel Rødal2009-08-311-28/+25
| | | | | | | | | | | Made the GL blur filter code slightly less hacky by not reusing the same paint engine for rendering both to the offscreen FBO and to the actual target device. This should make the code less reliant on paint engine implementation details and thus more robust with regards to changes in the paint engine. Task-number: 260402 Reviewed-by: Trond
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-08-271-2/+1
|\ \ | | | | | | | | | | | | | | | Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
| * | Improved QPainter API for allowing native painting in GL / VG.Samuel Rødal2009-08-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Added missing precision specifiers to custom shader effect.Samuel Rødal2009-08-261-1/+1
| | | | | | | | | | | | | | | | | | The precision specifiers need to be there on OpenGL ES 2.0. Reviewed-by: Tom
* | | New variant of QGLContext::bindTexture that does not require mipmap generationGunnar Sletta2009-08-271-1/+1
|/ / | | | | | | | | | | | | and y-axis inversion and overall less conversion, making significantly faster for plain usecases Reviewed-by: Trond
* | Fixed documentation and use of incorrect entry point for custom shaders.Samuel Rødal2009-08-251-1/+1
| | | | | | | | | | | | | | The entry point has been changed to be customShader, taking source image and texture coordinates as parameters. Reviewed-by: Tom
* | Merge commit 'qt/master' into kinetic-graphicseffectBjørn Erik Nilsen2009-08-171-1/+1
|\ \
| * | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | | | | | Reviewed-by: Trust Me
* | | Merge commit 'qt-graphics-team/pixmapfilters-redux' into kinetic-graphicseffectSamuel Rødal2009-07-281-2/+275
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/opengl/gl2paintengineex/qglengineshadermanager.cpp src/opengl/gl2paintengineex/qglengineshadermanager_p.h src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h Merge custom shader / GL blur pixmap filter implementation from graphics team repo with implementation from kinetic graphics-team repo.
| * | Further optimized the GL blur filter by caching the QGLShader.Samuel Rødal2009-07-021-3/+9
| | |
| * | Fixed GL blur filter to handle painter translates and larger FBO sizes.Samuel Rødal2009-07-021-1/+17
| | |
| * | Made GL blur filter use the new FBO pool for improved performance.Samuel Rødal2009-07-021-12/+16
| | |
| * | Added QPixmapBlurFilter with GL implementation.Samuel Rødal2009-06-301-1/+255
| | | | | | | | | | | | | | | No raster engine based fallback so far... Also, performance is lacking since the QGLShaderProgram isn't cached.
* | | Use texture_from_pixmap on X11 & avoid copiesTom Cooksey2009-07-221-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch tries to use texture_from_pixmap extentions on glX to properly bind an X Pixmap to a texture in QGLContextPrivate::bindTexture(QPixmap,). Because GL & X have different coordinate systems, the pixmap will be inverted about the y-axis. The extension does however allow a GLX_Y_INVERTED_EXT attribute to be set which will bind the pixmap the correct way up. If the underlying driver doesn't support this, texture_from_pixmap can't be used for QGLContext::bindTexture, because that function expects the resulting texture to be the right way up. However, it can still be used internally by the paint engine for drawPixmap operations. For these cases, if the pixmap is inverted, the paint engine can simply invert the texture coords to compensate. This is why this patch also moves QGLTexture into qgl_p.h. QGLContextPrivate::bindTexture(QPixmap,) now returns a QGLTexture which the paint engine can inspect to see if it needs to invert the texture coords. Finally, it seems on some (probably all) drivers, deleting an X pixmap which has been bound to a texture before calling glFinish/swapBuffers renders garbage. Presumably this is because X deletes the pixmap behind the driver's back before it's had a chance to use it. To fix this, we reference all QPixmaps which have been bound to stop them being deleted and only deref them after we swap the buffer, when they can be safely deleted. Reviewed-By: Kim