summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qcosmeticstroker.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Raster painting: Correct the coordinate rounding in drawPoints()Eirik Aavitsland2023-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When using the cosmetic stroker (i.e. plain pens with effective line width of 1), drawing points with fractional coordinates >= 0.5 would fill the wrong pixel. This is a long-standing bug where the drawPoints() code in the cosmetic stroker code was missed during the painting coordinate system shift for Qt 5.0. Prior to that, coordinates were interpreted as the upper left corner of a pixel, so rounding fractional coordinates to the closest integer would be the correct way to determine the pixel to be filled. From Qt 5 onwards however, coordinates instead designate the center point of the primitive to be stroked. In order to determine which pixel is most covered by the unit square centered in the given coordinates, fractional coordinates must be rounded downwards (floored). This fix makes the behavior consistent between the cosmetic and non-cosmetic stroker, so that drawPoints() with e.g. penwidths 1 and 1.01 in practice fills the same pixels. Pick-to: 6.6 Fixes: QTBUG-119306 Change-Id: I39cb7ad55229553dda098e6fbc9ee449b1fd9664 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Draw extended RGB solid colorsAllan Sandfeld Jensen2022-01-121-1/+1
| | | | | | | Pass extended RGB colors through the paint engine. Change-Id: I2e212cd4c76aaa65439746352c0da2b9db4a506d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Filter cosmetic lines using transformed, not world coordinatesEirik Aavitsland2021-02-101-4/+4
| | | | | | | | | Lines smaller than 1e-12 would not be drawn even when scaled up. Pick-to: 6.1 6.0 5.15 Fixes: QTBUG-75630 Change-Id: I8f261876c325b60f61e95ca2e5fde2cb227d4cba Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Avoid C-style casts when possibleHou Lei2021-02-071-16/+16
| | | | | | | Other affected rows have also been fixed. Change-Id: I1d2c28eb37a9d259d3132156163d4135894c18c3 Reviewed-by: David Faure <david.faure@kdab.com>
* Cosmetic stroker: avoid overflows for non-finite coordinatesEirik Aavitsland2020-12-011-0/+2
| | | | | | | | | | | | | | int overflows are usually avoided by clipping the qreal coordinates to the device rect. However the clip function did not handle inf or nan coordinates, so such values would be passed on. Fix by treating any line with such coordinates a fully clipped away, i.e. rejecting it, since it cannot be meaningfully stroked anyway. Fixes oss-fuzz issue 25330. Pick-to: 6.0 5.15 5.12 Change-Id: I4646172fc7a7e0a3a5f5cf03ce10ff0fb56b0d03 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* Avoid integer overflow and division by zeroAllan Sandfeld Jensen2020-11-231-3/+3
| | | | | | | | | | | | Restrain patterns to sensible lengths and values. [ChangeLog][QCosmeticStroker] Pen patterns are restrained to a maximum length and values of 1024, fixing oss-fuzz issue 25310. Pick-to: 5.12 5.15 6.0 6.0.0 Change-Id: If062f8336ff5ad113258391b0d70b8ac6f42c4b3 Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove Qt4Compatible paintingAllan Sandfeld Jensen2020-11-121-11/+9
| | | | | Change-Id: Ie54206ca9b509875568f2158e229fca9cb1860a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Allow painting above INT16_MAX on 64-bit architecturesAllan Sandfeld Jensen2020-11-091-15/+25
| | | | | | | | | | | The logic in qgrayraster was ready for it except for an intermediate format. qrasterizer.cpp and qcosmeticstroker.cpp uses a dot-16 fixed point format, and had to be changed to handle higher coordinates on 64-bit architectures. Fixes: QTBUG-84428 Change-Id: I85ab7a04e38bd0dbcefa9f16c16ccc84785a33cf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid heap-buffer-overflowRobert Loehning2020-10-121-1/+1
| | | | | | | | | [ChangeLog][QCosmeticStroker] Avoid a heap-buffer-overflow found by oss- fuzz as issue 25243. Pick-to: 5.12 5.15 Change-Id: I36112f183241679e172ad1ee531e1b929d6f3815 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Revert "Reimplement non-antialiased cosmetic pen"Allan Sandfeld Jensen2020-10-011-98/+193
| | | | | | | | | This reverts commit 81008ef4b91eac3f8ddcdad0aaf48b51135c4010. Reason for revert: Doesn't handle line-caps correctly. Change-Id: I0c77dbef6671fec326ec27f492ea3214054829ab Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Reimplement non-antialiased cosmetic penAllan Sandfeld Jensen2020-09-291-193/+98
| | | | | | | | | Simplify rounding to get rid of hacks to make lines meet up again. This also results in better looking drawing results in general. Task-number: QTBUG-25896 Change-Id: I48f08f0e7bd7ff869d6767f7bac2a18c2d280615 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Multiply instead of shiftingRobert Loehning2020-07-231-1/+1
| | | | | | | | | The shift operator is undefined for negative values. Fixes: oss-fuzz-23735 Pick-to: 5.15 5.12 Change-Id: Ib4bad0bf2135f9ddc95f6d7de64d935a02b4791e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use QList instead of QVector in gui implementationJarek Kobus2020-07-071-1/+1
| | | | | | | Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-271-0/+1
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/plugins/platforms/xcb/qxcbscreen.cpp src/widgets/accessible/qaccessiblewidget.cpp Change-Id: Ib3138e61ba7981610940509a7ff02ba2dd281bf0
| * Fix QPainter::drawLines() with cosmetic penEirik Aavitsland2019-12-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | Even though each line in the array passed to drawLines() should be rendered as an independent line, some state was kept in the cosmetic stroker from one line to the next. This could result in visible rendering errors. Fixes: QTBUG-80834 Change-Id: Ief7bf78eab83ae34459802bff5a57d6beec4a5e5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-3/+3
|/ | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Cleanup gradient blendingAllan Sandfeld Jensen2018-11-161-1/+1
| | | | | | | | | Moving it to a separate routine like blendTexture, so DrawHelper only has solid color routines, and generalizing the vertical gradient optimization. Change-Id: I54bd59eba7e95247b9a365a3738d02c4f8cc2631 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devGabriel de Dietrich2017-07-131-13/+43
|\ | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
| * Fix polygon stroking with cosmetic penAllan Sandfeld Jensen2017-07-051-13/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a number of issues that caused polygons to not always be drawn fully connected. Ensures the original lastPixel is set when drawing closed polygons, ensure we don't round away from the original starting point, and add handling of edges that need to be rounded half a pixel sideways to line up with endpoints. Task-number: QTBUG-27053 Change-Id: Ib51ee5623a629996af51a0967096383f04e91e2f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Allow QImage with more than 2GByte of image dataAllan Sandfeld Jensen2017-07-081-1/+1
|/ | | | | | | | | | | | Changes internal data-size and pointer calculations to qssize_t. Adds new sizeInBytes() accessor to read byte size, and marks the old one deprecated. Task-number: QTBUG-50912 Change-Id: Idf0c2010542b0ec1c9abef8afd02d6db07f43e6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-211-13/+13
|\ | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qgtkstyle_p.cpp tests/auto/corelib/io/qtextstream/test/test.pro tests/auto/corelib/plugin/plugin.pro Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
| * QCosmeticStroker: fix several UBs involving << with a negative LHSMarc Mutz2016-03-151-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Left-shifts of negative values are undefined in C++. In particular, they don't behave arithmetically. Reported by UBSan: qcosmeticstroker.cpp: 72:15: runtime error: left shift of negative value -14/-19/-32/-33/-34/-37/-38/-63/-64/-192/-384/-1280 qcosmeticstroker.cpp:444:20: runtime error: left shift of negative value -64 qcosmeticstroker.cpp:451:26: runtime error: left shift of negative value -1 qcosmeticstroker.cpp:483:26: runtime error: left shift of negative value -1 qcosmeticstroker.cpp:762:20: runtime error: left shift of negative value -64 qcosmeticstroker.cpp:774:26: runtime error: left shift of negative value -1 qcosmeticstroker.cpp:813:47: runtime error: left shift of negative value -1 qcosmeticstroker.cpp:839:20: runtime error: left shift of negative value -64 qcosmeticstroker.cpp:851:26: runtime error: left shift of negative value -1 qcosmeticstroker.cpp:889:47: runtime error: left shift of negative value -1 qcosmeticstroker.cpp:932:27: runtime error: left shift of negative value -64 qcosmeticstroker.cpp:995:27: runtime error: left shift of negative value -3/-64 Fix by using ordinary multiplication instead, because negative left-hand-side values don't look like they are an error. Change-Id: Icbebd41f6ddd3dca4abd385585fc0f82064fe8b6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-111-5/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define and undef in src/corelib/tools/qsimd_p.h. This change is also squashed with "Fall back to c++11 standard compiler flag for host builds" which is done by Peter Seiderer. Conflicts: mkspecs/features/default_post.prf src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch src/3rdparty/sqlite/sqlite3.c src/corelib/tools/qsimd_p.h src/gui/kernel/qevent.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/bearer/blackberry/blackberry.pro src/plugins/platforms/cocoa/qcocoasystemsettings.mm src/plugins/platformthemes/gtk2/gtk2.pro src/plugins/styles/bb10style/bb10style.pro src/sql/drivers/sqlite2/qsql_sqlite2.cpp tools/configure/configureapp.cpp Task-number: QTBUG-51644 Done-with: Peter Seiderer <ps.report@gmx.net> Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
| * QCosmeticStroker: fix out-of-bounds access in drawPixel()Marc Mutz2016-03-091-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by UBSan: src/gui/painting/qcosmeticstroker.cpp:150:55: runtime error: index -1 out of bounds for type 'QT_FT_Span_ [255]' src/gui/painting/qcosmeticstroker.cpp:150:99: runtime error: index -1 out of bounds for type 'QT_FT_Span_ [255]' src/gui/painting/qcosmeticstroker.cpp:151:55: runtime error: index -1 out of bounds for type 'QT_FT_Span_ [255]' That code path makes no sense if no span has been populated yet, so skip the whole block if current_span == 0. Change-Id: I832b989e89c118dc48ab5add3a28bb44c1936a76 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QCosmeticStroker: fix misleading use of & on bool operandsAnton Kudryavtsev2015-12-101-2/+2
|/ | | | | Change-Id: I0e885391b220c30fc1482446d1dc9a2be035d45a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| * Another fix of cosmetic QPainter::drawPolyline()Eirik Aavitsland2015-09-011-1/+2
| | | | | | | | | | | | | | | | | | | | At the edge of the view, a line segment could end up as not producing any pixels even if not clipped by the floating-point clip routine. Make sure the starting point for the next line is still updated correctly for any significant segment lengths. Change-Id: I381a4efb81ce6006f3da4c67abf279aea79e4663 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Solid and gradients in high color accuracyAllan Sandfeld Jensen2015-04-101-1/+2
|/ | | | | | | | | | | | | This patch updates the internal color precisions of solids and gradients to 16bit per color. This makes it possible to render at higher precision on non-premultiplied ARGB32, the RGB30 formats and any other hi-color formats if more are added. [ChangeLog][QtGui][Painting] Internal precision of solids and gradients is now up to 16bit per color. Change-Id: Ieae5468bd6de1f56adfa4cb9fa966faf2ed824fd Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-311-12/+8
|\ | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| * Fix rasterization errors in aliased cosmetic drawPolyLineEirik Aavitsland2015-03-191-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a cosmetic polyline contained a 1-pixel segment, the next segment would be drawn with wrong starting point. The original fix for QTBUG-26156 had some unwanted side effects (QTBUG-31579 and now QTBUG-42398). It tried to skip start-point update if stroke() did not actually draw anything (because the segment was too small). However, to determine that, it tested for a change in lastPixel. But that was not failsafe; in some cases (1-pixel segment), lastPixel could be unchanged even though the segment had been drawn. With this change, we instead test directly whether stroke() skipped the segment or not. Task-number: QTBUG-42398 Change-Id: Id751db69a18cd1af4f45070db9d5698aa532d22a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Improve rounding in QCosmeticStrokerAllan Sandfeld Jensen2015-03-121-4/+8
| | | | | | | | | | | | | | | | | | | | | | Fixes the drawn position of end points in drawLine. Based on a patch by Jørgen Lind, and modified so that it caused no test regressions. Task-number: QTBUG-38144 Change-Id: I24aa28480cc6ae09abf91d80378970565a29b254 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* | Remove unnecessary math.h and limits.h includesAllan Sandfeld Jensen2015-02-041-1/+0
|/ | | | | Change-Id: I28c898f869ed3f03b08ff55f2972a38667c755ad Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Fix QPainter::drawPolyline() painting errors with cosmetic penaavit2014-08-141-4/+4
| | | | | | Task-number: QTBUG-31579 Change-Id: I8fd2c03ff9a22e4963bfcbcfe196ae4c61b9e10f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Ensure lastPixel.y is also initalized to -1 when necessaryAndy Shaw2013-10-081-0/+3
| | | | | | | Task-number: QTBUG-31579 Change-Id: Ia4916ac0d384ea523bbfad0dafbc90044da7ec3e Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix drawing of 0-width polylines from outside the devicerect.Gunnar Sletta2013-06-101-16/+26
| | | | | | | | | | | | | | This was broken by a previous fix which aimed to fix gaps in polylines with tiny line segments. The result was that we skipped updating the origin point when stroke() didn't produce pixels which accidentally included the case of the line being completely outside the deviceRect. I fixed this by returning the value of clipLine in drawLine to the caller so we could still update the origin for this case. Task-number: QTBUG-31579 Change-Id: Iac29436f042da7658bbeaf9370351dc6f2c95065 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'gerrit/release' into stableSamuel Rødal2013-03-211-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/features/qt_module_headers.prf mkspecs/features/qt_tool.prf src/angle/angle.pro src/tools/bootstrap/bootstrap.pro tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: Ide5759fe419a50f1c944211a48f7c66f662684e0
| * Fixed artifacts when drawing same line with different clips.Samuel Rødal2013-03-141-6/+6
| | | | | | | | | | | | | | | | | | | | Expanding on the change fixing QTBUG-24762 with the realization that any line needs to be drawn in a consistent way regardless of system or painter clip, not just dashed lines. Task-number: QTBUG-25036 Change-Id: Ief7ef19cc92c52e7d792500a581a072ba032767e Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Fixed QPainter::drawPolyline() not drawing solid lines.Samuel Rødal2013-03-151-1/+16
|/ | | | | | | | | If a line segment isn't filled we keep using the same point of origin. Task-number: QTBUG-26156 Change-Id: I20af8410a7039b69848f201ab62fd3c01b95531b Reviewed-by: Titta Heikkala <titta.heikkala@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fixed dashes being rendered differently depending on system clip.Samuel Rødal2013-03-071-4/+7
| | | | | | | | | | | We need to clip lines to the unclipped device rect in the case of dashing, since otherwise the dashes will be shifted and rendered differently when partial repaints are done. Task-number: QTBUG-24762 Change-Id: I3599b54baa552acc20bf8cc2e12f846b45f6019e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make QPen default to 1-width non-cosmetic.Samuel Rødal2012-10-221-1/+1
| | | | | | | | | | | Use the Qt4CompatiblePainting render hint when painting with QPainter to treat default constructed QPens as cosmetic still. The NonCosmeticDefaultPen render hint gets documented as obsolete, since it was in any case not respected by the raster nor OpenGL paint engine. Change-Id: I04d910e9700baf7f13a8aac07a3633014bb9283e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fixed inconsistent QPainter fill rules for aliased painting.Samuel Rødal2012-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | Qt 5 is the time to get rid of all the old inconsistencies in the raster paint engine caused by trying to preserve the old X11 based coordinate system where (0, 0) is in the center of the top-left pixel instead of the upper left corner of said pixel. However, this was only adhered for line drawing and path / rect filling, and not for image or pixmap drawing and not at all when doing antialiased painting. By defining the antialiased coordinate system as being the right one and letting the aliased fill rules follow from that we finally end up with some consistent behavior that doesn't lead to surprises and workarounds in application code. It is still possible for applications to get the old behavior by setting the QPainter::Qt4CompatiblePainting render hint. This should make porting easier for the few cases where an application relies on the aliased fill rules we used to have in Qt 4. Task-number: QTBUG-27500 Change-Id: If86b95e77d838ec83033d64af86632b9a73c74a9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fixed cosmetic line drawing where begin and end points are equal.Samuel Rødal2012-10-111-0/+5
| | | | | | | | | This case has typically required specific work-arounds in other rendering paths as well. Task-number: QTBUG-25153 Change-Id: I217e710a30222792ebca3bf297e438d944c32992 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fixed inconsistent rounding of square cap pens.Samuel Rødal2012-09-201-10/+10
| | | | | | | | | | | A horizontal line should round up at the same time as a vertical line with square cap, when rendering at subpixel coordinates. Thus, the special casing in the cosmetic stroker of offsetting by half a pixel should be for flat caps instead of for square caps. Task-number: QTBUG-26013 Change-Id: Ic09249337f814c7de95a17976ec9e651561a744b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>