summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Moved 'hasAlpha' property from GL2 engine to GL paint device.Kim Motoyoshi Kalland2010-02-121-0/+5
| | | | | | Got rid of an ugly switch statement. Reviewed-by: Tom
* Fix y-inverted pixmaps properly.Gunnar Sletta2010-01-221-9/+5
| | | | | | | | | | | | There is a lot of code depending on that pixmaps are flipped upside down in the gl graphicssystem, so toggling this requires extensive testing. Since we're anyway questioning the relevance of this feature (compared to raster + GL viewport) its simply not worth the effort to fix it properly right now. Revert "Fixed y-inverted pixmaps on N900." This reverts commit 57473d5d2a7bd6ae3117f61ff29264a1b790bb01.
* Fixed y-inverted pixmaps on N900.Gunnar Sletta2010-01-191-4/+8
| | | | | | | | | | | The QGLPixmapData used default bind options, which means that the pixmap is always flipped up-side-down and rendered with flipping. The opaque pixmaps were uploaded unflipped which caused the bug. Ideally we do not want pixmap flipping so change the default in gl pixmaps and tag it accordingly. Reviewed-by: Samuel
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* Align GL_RGB lines on a 4-byte boundary when uploading pixmap texturesRhys Weatherley2009-12-181-13/+2
| | | | | | | Previous code was aligning lines on a 3-byte boundary. Task-number: QTBUG-6902 Reviewed-by: Julian de Bhal
* Make sure a context is current when loading compressed textures.Rhys Weatherley2009-12-081-0/+2
| | | | Reviewed-by: trustme
* Compressed texture binding for QtOpenGL: ETC1 and PVRTCRhys Weatherley2009-12-061-0/+57
| | | | | | | | | | | | | | | | The QGLContext::bindTexture(QString) function has been augmented with support for ETC1, PVRTC2, and PVRTC4 compressed textures, in addition to the existing DDS support. The QGLPixmapData class has also been modified to recognize compressed texture formats in fromFile() and fromData(). This change also fixes a bug in bindTexture() that prevented the same compressed texture file from being bound in multiple contexts. There is now a separate file cache for each context group. Task-number: QT-2547 Reviewed-by: Trond
* Fixed OpenGL graphicssystem issues for OpenGL ES 2.0 platforms.Samuel Rødal2009-12-041-8/+30
| | | | | | | The format and internal_format parameters to glTexImage2D need to always match on OpenGL ES 2.0. Reviewed-by: Tom Cooksey
* API review: Rename functions numColors(), setNumColors() and numBytes()Marius Storm-Olsen2009-11-061-1/+1
| | | | | | | | | | QPaintDevice and QImage used the functions numColors(), setNumColors(), and numBytes(). However, this is not consistent with the rest of the Qt API which uses *Count() and set*Count(). Removed all usage of these functions inside Qt and test-cases. Reviewed-by: Andreas Aardal Hanssen
* Added strict size parameter to QGLFramebufferObject pool.Samuel Rødal2009-11-021-3/+16
| | | | | | | The strict size parameter can be used when it's critical that we get the exact size we ask for. Reviewed-by: Gunnar Sletta
* Made internal FBOs snap to power-of-two when not wasting too much space.Samuel Rødal2009-10-291-2/+15
| | | | | | This improves performance on certain OpenGL ES 2.0 platforms. Reviewed-by: Gunnar Sletta
* Optimized QPixmap::fill for GL backend when pixmap is used as is.Samuel Rødal2009-10-151-6/+16
| | | | | | | | | When QGLPixmapData is bound after a fill(), without being painted on in the mean-time, it's cheaper to directly generate a source image than to go through convertToGLFormat(), since all the pixels in the image will have the same value. Reviewed-by: Trond
* Fixed tst_QPixmap test failures with GL pixmap backend.Samuel Rødal2009-10-151-0/+4
| | | | | | Fixes test failures in fill() and setGetMask(). Reviewed-by: Trond
* Added QPixmapData::createCompatiblePixmapData() used by QPixmap::copy().Samuel Rødal2009-10-141-0/+5
| | | | | | QPixmap::copy() now returns a pixmap with the same pixmap backend. Reviewed-by: Gunnar Sletta
* Fixing some GCC warningsJoão Abecasis2009-10-071-1/+1
| | | | Reviewed-by: Markus Goetz
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-021-1/+1
|\
| * QGLContext::areSharing() to check for GL share relationshipsRhys Weatherley2009-10-011-1/+1
| | | | | | | | Reviewed-by: Samuel
* | Explicitely check for alpha pixels before creating an alpha GL pixnmapGunnar Sletta2009-10-021-6/+15
|/ | | | Reviewed-by: Samuel
* Fixed crash with QPixmap::fill() when pixmap is painted to using opengl1Gunnar Sletta2009-09-251-9/+17
| | | | Reviewed-by: Samuel
* Fixed bug in GL pixmap backend (causing missing rendering in lance).Samuel Rødal2009-09-181-1/+5
| | | | | | | Since copyBackFromRenderFbo() manually changes the framebuffer object binding, we also need to update the context's current_fbo member. Reviewed-by: Kim
* Fix glMatrixMode() arguments for desktop OpenGLRhys Weatherley2009-09-151-2/+2
| | | | | | | The defines are GL_MODELVIEW/GL_PROJECTION, not GL_MODELVIEW_MATRIX/etc. The _MATRIX defines are for fetching the matrix, not setting it. Reviewed-by: trustme
* Compilation fix for OpenGL/ES 2.0Rhys Weatherley2009-09-151-0/+2
| | | | | | Matrix functions do not exist under OpenGL/ES 2.0. Reviewed-by: trustme
* Increased performance of blurpicker example with GL 2 engine.Samuel Rødal2009-09-151-8/+8
| | | | | | | Slightly increase threshold for when to shrink an FBO, and reduce the number of calls to glBindFramebuffer. Reviewed-by: Tom
* Fixed rendering errors in blurpicker with -graphicssystem openglSamuel Rødal2009-09-151-1/+15
| | | | | | | | | | | | | | | | 1) Need to transfer to brush drawing mode when switching active engine, to make sure we reset the vertex / texture coordinate pointers for image drawing. 2) QGLPixmapGLPaintDevice::beginPaint() was changed to use QGLContext::drawTexture() for blitting the old texture contents to the render FBO, which means that we also need to set up viewport, modelview, and projection matrices, and ensure that clipping / stencil testing is disabled. 3) Make sure stencil testing is disabled when clearing the FBO. Reviewed-by: Tom
* Re-order begin() so everything needing a current context has oneTom Cooksey2009-09-101-6/+2
| | | | | | | | | | | | It should be up to QGLPaintDevice::beginPaint() to make the correct context current, so everything needing a current context needs to be moved after that call. This patch also modifies QGLPixmapData to use QGLContext::drawTexture rather than the GL2 PE's drawTexture, which shouldn't be called inside beginPaint as the paint engine hasn't been fully initialised yet. Reviewed-by: Eskil
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Make QGLPixmapData work with the new QGLPaintDevice APITom Cooksey2009-09-081-36/+80
| | | | | | | | | | This patch changes the ordering of QGL2PaintEngine::begin a bit because QGLPixmapData needs to use the paint engine's drawTexture method within beginPaint(). Also, this initialises needsSync to true and removes the setState call. So now all the state initialisation is done in ensureActive rather than begin.
* Add operator== and != to QGLFramebufferObjectFormatRhys Weatherley2009-09-081-6/+1
| | | | Reviewed-by: Sarah Smith
* Slightly improved QGLFramebufferObjectFormat API.Samuel Rødal2009-09-041-2/+2
| | | | | | | 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
* 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
* | Move QGLShareContextScope to qgl_p.h so other things can use it.Rhys Weatherley2009-08-311-37/+0
| | | | | | | | Reviewed-by: trustme
* | 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
* | Removed warnings / debug output in the GL 2 engine / pixmap filter code.Samuel Rødal2009-08-251-2/+0
| | | | | | | | 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
* | | Fixed various valgrind-reported issues in GL 2 engine.Samuel Rødal2009-07-291-4/+5
| | |
* | | Merge commit 'qt-graphics-team/pixmapfilters-redux' into kinetic-graphicseffectSamuel Rødal2009-07-281-41/+93
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Refactored the GL QPixmap backend to use an FBO pool class.Samuel Rødal2009-07-021-41/+93
| | | | | | | | | | | | | | | The FBO pool will be useful in other places as well, plus it makes it easier to deal with graphics memory management issues.
* | | Use texture_from_pixmap on X11 & avoid copiesTom Cooksey2009-07-221-20/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Fixed compile with -qtnamespace and MSVC.Rohan McGovern2009-07-221-1/+2
|/ / | | | | | | | | When an extern function is declared in the scope of another function, MSVC sometimes ignores the enclosing namespace {}.
* | Fixed some regressions in the OpenGL pixmap backend.Samuel Rødal2009-06-291-1/+8
| | | | | | | | | | | | | | | | Make sure a QPixmap gets an alpha channel when filled with a non-opaque color, and fix issues where shader manager did not active correct shader program. Reviewed-by: Tom
* | Speed up QPixmap::width(), height(), isNull() and depth().Andreas Aardal Hanssen2009-06-171-28/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change moves the w, h, d variables to QPixmapData and introduces is_null to keep track of nullness. This is possible only because QPixmapData is internal API; otherwise we'd have to be smarter. The optimization makes the QPixmap::width() function take 7 instructions, down from 34 before. For the calculator demo in the declarative ui branch this reduces a block of 750000 instructions (out of 30000000) to around 100000-150000 instructions. Tested on Windows, Linux, Mac. Raster, X11 and OpenGL paint engines. Have not tested the DirectFB engine. Reviewed-by: Trond
* | Prevented infinite recursion in GL graphics system.Samuel Rødal2009-06-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | If creating a QGLWidget triggers the creation of a QPixmap then we might end up in an infinite recursion due to QPixmap trying to access qt_gl_share_widget(). This can happen via setWindowIcon for example. Adding an initializing flag to QGLGlobalShareWidget and preventing QGLFramebufferObject::hasOpenGLFramebufferObjects() and ::hasOpenGLFramebufferBlit() from creating a QGLWidget every time they are called with no active GL context. Reviewed-by: Trond
* | Merge license header changes from 4.5Volker Hilsheimer2009-06-161-2/+2
|\ \ | |/
| * Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | | | | | Reviewed-by: Trust Me
| * Long live Qt 4.5!Lars Knoll2009-03-231-0/+313
|
* Re-enabled GL pixmap backend and window surface to work without GL2.Samuel Rødal2009-06-151-1/+2
| | | | | | | GL window surface and GL pixmap backend should work with old GL engine as well, though not supported to the same degree. Reviewed-by: Trond