summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
Commit message (Collapse)AuthorAgeFilesLines
* Early exit from QRegion::intersects() if there is only one rect.Andreas Aardal Hanssen2009-06-161-0/+2
| | | | | | | | | | Don't waste cycles with constructing a vector with rectangles if there is only one rectangle in the source region. Same as 36ff1b507bf2d509019ae8ddd638922b09755c6b, but for QRegion::intersects(QRect). Reviewed-by: bnilsen
* Early exit from QRegion::intersects() if there is only one rect.Andreas Aardal Hanssen2009-06-161-0/+2
| | | | | | | | Don't waste cycles with constructing two vectors with rectangles if there is only one rectangle in each of the two regions. Reviewed-by: Lars Reviewed-by: bnilsen
* implement equality operator in a more sane wayLars Knoll2009-06-154-5/+56
| | | | | | | | | | | | Using qFuzzyCompare for checking whether two transformations are equal doesn't give us too much and is inconsistent with our other matrix classes. Using simple floating point equality is a lot faster as well. Added qFuzzyCompare overloads for QMatrix and QTransform to still allow for fuzzy comparisons. Reviewed-By: Samuel Rødal
* Fixed compile of QtGui with MSVC.Rohan McGovern2009-06-121-1/+1
| | | | | MSVC requires the same linkage specifiers to be provided at both the declaration and definition.
* Fixed bitmap drawing in GL 2 engine when not using GL pixmap backend.Samuel Rødal2009-06-121-1/+3
| | | | | | | | | QPixmap shouldn't return true in hasAlphaChannel() for bitmaps, instead the paint engine should check whether the pixmap is a bitmap or not. In addition, QBrush::isOpaque() returned true for bitmap brushes, which is wrong according to the documentation. Reviewed-by: Trond
* QTransform::shear cut-off.Bjørn Erik Nilsen2009-06-121-0/+3
| | | | | | Do nothing if both sh and sv is 0. Reviewed-by: Samuel
* Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBjørn Erik Nilsen2009-06-122-5/+13
|\
| * Fixed incorrect rendering of bitmap/pattern brushes in GL 2 engine.Samuel Rødal2009-06-121-1/+1
| | | | | | | | | | | | | | | | | | The pen color should be used when drawPixmap is called with a bitmap, and the brush color should be used for texture patterns that are bitmaps. Task-number: 245802 Reviewed-by: Trond
| * doc: Fixed several qdoc warnings.Martin Smith2009-06-121-4/+12
| |
* | Merge commit 'origin/4.5'Bjørn Erik Nilsen2009-06-122-10/+11
|\ \ | |/ |/| | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp src/gui/graphicsview/qgraphicsitem.cpp tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp tools/linguist/shared/cpp.cpp translations/linguist_ja.qm translations/qt_ru.qm
| * Fixed the pen dash patterns for Mac.Trond Kjernåsen2009-06-111-10/+10
| | | | | | | | | | | | | | | | The predefined dash patterns for Mac have always been off, compared to the ones in the raster engine and the GL engine. Task-number: 255292 Reviewed-by: Kim
| * Initialize xform_scale in constructorAnders Bakken2009-06-091-0/+1
| | | | | | | | | | | | | | | | Though this variable always will be initialized in QX11PaintEngine::begin() valgrind complains about conditional jump or move depends on uninitialised value(s). Reviewed-by: Donald <qt-info@nokia.com>
* | doc: Fixed several qdoc warnings.Martin Smith2009-06-121-5/+32
| |
* | Fixed bug where QTransform::type() failed to compute the correct type.Samuel Rødal2009-06-121-5/+10
| | | | | | | | | | | | | | Since QTransform::type() now uses a switch based on m_dirty, we can't treat m_dirty as a bit mask anymore. Reviewed-by: Ariya
* | Fixed clipping bugs in GL 2 paint engine.Samuel Rødal2009-06-121-6/+2
| | | | | | | | | | | | | | | | Similar to what was done in f86dcade8716a0aee841ba05740887598633de17, we shouldn't multiply by the redirectionMatrix in replayClipOperations() as the clip info matrices already contain the redirectionMatrix. Reviewed-by: bnilsen
* | Fixed clipping bug due to applying redirection offset twice.Samuel Rødal2009-06-121-1/+1
| | | | | | | | | | | | | | | | After change f0a4a37a5182660580fd361110d3fd51463221d8 the clip info stack already contains the redirection offset, so we don't need to apply it again. Reviewed-by: bnilsen
* | Removed qApp and replaced with QApplication:: for static member callsThierry Bastian2009-06-111-2/+2
| |
* | Fixed clipping bugs due to not accounting for the redirection offset.Samuel Rødal2009-06-111-20/+9
| | | | | | | | | | | | | | | | Also, updateInvMatrix() can be greatly simplified as updateMatrix() is always called whenever anything related to the state matrix changes, so we can assume that it's up-to-date. Reviewed-by: bnilsen
* | doc: Fixed several qdoc warnings.Martin Smith2009-06-111-1/+1
| |
* | doc: Fixed several qdoc warnings.Martin Smith2009-06-111-2/+2
| |
* | Compile on the Mac.Bjørn Erik Nilsen2009-06-111-2/+2
| | | | | | | | Broke after this commit: 32f32ee3e752a6cc03505ddaa48d2849eaedc2a6
* | Fixed memory leak in raster paint engine.Samuel Rødal2009-06-101-1/+3
| | | | | | | | | | | | | | Unlike the span array, the clip line array is only free'd in the destructor, so if it's already allocated we shouldn't allocate it again. Reviewed-by: Denis Dzyubenko
* | Make QVectorPath::controlPointRect() return a QRectF.Samuel Rødal2009-06-104-16/+13
| | | | | | | | | | | | This makes debugging etc much easier, plus most of the places controlPointRect() was called the caller had to convert the rect to a QRectF manually.
* | QPainter::worldTransform() does not return identity matrix.Bjørn Erik Nilsen2009-06-103-31/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPainter::worldTransform() does not return identity matrix when created on a redirected widget. It should always be identity by default, and should only change as a result of QPainter::setWorldTransform. The reason it didn't return identity for redirected widgets, was that we translated the shared painter's world matrix directly. Since we cannot modify the world matrix directly, we have to store the shared painter's current world transform in a separate matrix (redirectedMatrix), reset the world transform to identity, and later combine the redirectedMatrix with world transforms set on the painter. Note that redirection_offset was in negative coordinates before, and that redirectionMatrix now is in positive coordinates, hence opposite signs around. Auto-test included. Reviewed-by: lars Reviewed-by: Samuel
* | Revert "greatly speed up QTransform::mapRect() for projective transforms"Andreas Aardal Hanssen2009-06-101-2/+10
| | | | | | | | | | | | | | | | | | This reverts commit 72e083c98c3adb07bb1578fb7f28f121fc3f34ac. This test broke the tst_QTransform::projectivePathMapping autotest. Lars is looking into it; for now we take the patch out. Reviewed-by: Lars
* | Merge commit 'qt-mainline/master' into master-recursivepaintAndreas Aardal Hanssen2009-06-106-19/+103
|\ \
| * | add some api docs to clarify what collate doesThomas Zander2009-06-101-0/+3
| | |
| * | Fixed clipping bug in raster paint engine causing rendering artifacts.Samuel Rødal2009-06-101-2/+2
| | | | | | | | | | | | | | | | | | | | | The artifacts were visible in the mainwindow demo when dragging the top toolbar separator left and right. We need to check that rect clipping is actually activated before we compare the new clip rect with the old, otherwise the clip type and clip bound flags won't get updated.
| * | small changes in private headersThierry Bastian2009-06-091-1/+1
| | |
| * | Improved clipping in GL2 paint engine.Samuel Rødal2009-06-093-16/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the stencil method to draw clip paths and regions to the Z-buffer instead of using glClear / glScissor. Using different depth values for the various clip parts also makes restore() very cheap when only IntersectClip is used. As an additional bonus this patch gives antialiased clip in the GL 2 paint engine. Task-number: 254658 Reviewed-by: Trond
* | | Revert "implement equality operator in a more sane way"Andreas Aardal Hanssen2009-06-101-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 07dca7a30d4bd1efd8032915700420cca3fd60fa. Move the equality operator code back in (qFuzzyCompare) to avoid breaking many autotests. The change should go back in later on, possibly supplemented by a qFuzzyCompare(QTransform) function. But until we can figure out how to not break everything this patch has to wait. Reviewed-by: Lars
* | | implement equality operator in a more sane wayLars Knoll2009-06-091-5/+9
| | | | | | | | | | | | | | | | | | | | | Using qFuzzyCompare for checking whether two transformations are equal doesn't give us too much and is inconsistent with our other matrix classes. Using simple floating point equality is a lot faster as well.
* | | greatly speed up QTransform::mapRect() for projective transformsLars Knoll2009-06-091-10/+2
|/ / | | | | | | | | | | | | | | | | The code so far was converting the rect to a painterpath, mapping that one and then taking the bounding rect. It is actually sufficient to simply map the four corners of the rectangle and take the bounding rect of these four points even in the projective case. Reviewed-by: Andreas
* | Merge commit 'origin/4.5'Oswald Buddenhagen2009-06-081-1/+1
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/3rdparty/phonon/qt7/mediaobject.mm src/3rdparty/phonon/qt7/quicktimevideoplayer.mm src/gui/text/qfontengine_win.cpp tools/linguist/shared/cpp.cpp
| * Fixed an issue with graphicssystem raster on 8 and 16 bit X servers.Trond Kjernåsen2009-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | We didn't actually check the depth of the target window before calling the qt_x11_drawImage() fu, that will only work with depths >= 24. Task-number: 255311 Reviewed-by: Samuel BT: yes
* | Fix QT_NO_DATASTREAM macro checks and improve readabilityRitt Konstantin2009-06-086-5/+9
| | | | | | | | | | | | | | | | Some checks where in the wrong locations, and some endifs where hard to read. Merge-request: 611 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
* | Add a callback so Qt updates its color stuff when the profile changes.Norwegian Rock Cat2009-06-051-0/+2
| | | | | | | | | | | | | | | | | | We've had a problem with a stale cache for color profiles this should make things work well. We get the callback for each display whether it needs it or not, but honesly I would rather that we update this a few times too many when people change their display profile than not at all. FWIW, this code is inspired from Apple's Tech Note TN2035.
* | All of Qt's own code compiles with -pedantic now (but pcre and webkit don't ↵David Faure2009-06-044-8/+8
| | | | | | | | | | | | | | seem fixable easily) Merge-request: 594 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | Merge commit 'origin/4.5'Olivier Goffart2009-06-042-9/+12
|\ \ | |/
| * Fixed raster bug causing fully clipped images to be partially blended.Samuel Rødal2009-06-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | The blend functions assume the width / height of the images being blended to be greater than 0. A width of 0 caused the first iteration of a duff's device memcpy (QT_MEMCPY_USHORT) to be executed, thus blending 8 pixels instead of none. BT: yes Task-number: 255014 Reviewed-by: Trond
| * Fixed a byte ordering issue when using the raster graphicssystem.Trond Kjernåsen2009-06-021-7/+10
| | | | | | | | | | | | | | | | The R and B channels were swapped on little endian machines with BGR layout. Task-number: 254934 Reviewed-by: Samuel
* | Implemented QGLTextureGlyphCache to avoid wasting glyph cache memory.Samuel Rødal2009-06-032-29/+43
| | | | | | | | | | | | | | | | | | Now there's only a copy of the texture glyph cache in graphics memory, avoiding the system memory copy that we used earlier. In addition the texture will use the GL_ALPHA texture format when possible, making it consume less graphics memory as well. Reviewed-by: Tom
* | Merge branch '4.5'Denis Dzyubenko2009-06-021-12/+3
|\ \ | |/
| * Use a QVarLengthArray instead of some hacky self-made containerHarald Fernengel2009-06-021-12/+3
| | | | | | | | | | | | | | This won't leak on error case, and will work with arbitrary sizes. Also changed from int to short as instructed by Samuel. Reviewed-by: Samuel <qt-info@nokia.com>
* | Fixed bug in QClipData::fixup().Samuel Rødal2009-06-021-2/+0
| | | | | | | | | | | | | | The bounding rect computed in fixup() is one pixel too wide, causing potential memory corruption by painting outside device boundaries. Reviewed-by: Trond
* | Made GL2 engine default for QGLWidget, and added GL2 sync() functionSamuel Rødal2009-05-292-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | To allow mixing QPainter and raw OpenGL commands we need to have some way for the user to say that's he's about to use raw OpenGL so that we are free to do buffering optimizations in the paint engines and use either GL1 or GL2 paint engine. As there's already a syncState() function in QPaintEngine we've reused this and added QPaintEngineEx::sync() which takes care of syncing/flushing the paint engine. Reviewed-by: Trond
* | Further optimized fast scaling of ARGB8565 images onto RGB16 images.Michael Brasser2009-05-282-5/+11
| | | | | | | | | | | | This improves performance on embedded. Reviewed-by: Samuel
* | improved string operations all over the placeThierry Bastian2009-05-285-9/+9
| | | | | | | | | | used character operations whenever possible better usage of QLatin1String
* | Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qtSimon Hausmann2009-05-274-10/+18
|\ \ | |/ | | | | | | Conflicts: tests/auto/qtreeview/tst_qtreeview.cpp
| * BT: Fixed GL textdrawing in the Boxes demo.Trond Kjernaasen2009-05-261-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Reworked the 85f98acaa3a38079071bea711e43c9a86edec1f6 fix, since it broke glyph positioning in the GL engine under Windows. Instead of changing the glyph cache margin, which impacts where the glyph is positioned, we just make the image the glyph is drawn into 4 pixels bigger in width/heigth. The margin in QImageTextureGlyphCache needs to be reworked.. Task-number: 254450 Reviewed-by: Eskil