summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
Commit message (Collapse)AuthorAgeFilesLines
* Q*GlyphCache: de-inline dtor and export vtableMarc Mutz2015-05-262-1/+13
| | | | | | | | | | | | | | | | | | | The destructor is the first virtual method. By not defining it out-of-line, we provoke multiple copies of vtables, not all of which can be merged by the linker. If the linker fails, RTTI such as dynamic_cast and catch-blocks involving the type will not work. Additionally, QFontEngineGlyphCache was not exported, and therefore also not its vtable, making it impossible for users outside of QtGui to get a unique RTTI for the class. Change-Id: Ib265945934216bb609629431eb4c71996d4fd39d Reported-by: Volker Krause <volker.krause@kdab.com> Task-number: QTBUG-45582 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-274-41/+36
|\ | | | | | | | | | | | | | | Conflicts: src/tools/qdoc/tree.cpp tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: Iaa78f601a63191fa643aabf853520f913f2f0fdc
| * Short-cut SSE4 unpremultiplyAllan Sandfeld Jensen2015-04-251-2/+4
| | | | | | | | | | | | | | | | Even with SSE4 optimized unpremultiply it is still significantly faster to skip the calculation on alpha values 0 and 255. Change-Id: Iafe658fea8eacf35a857f292952b0c1ee056139c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Revert "Remove separate SSE4 unpremultiply function"Allan Sandfeld Jensen2015-04-234-41/+34
| | | | | | | | | | | | | | | | | | | | | | Could causedSSE4 instructions to be used on non SSE4 machines in cases when qUnpremultiplywas not inlined. This reverts commit 964ccc58534aac436529007000d1c38d76c88834. Change-Id: Ic676ade8f75129e8d37c4d96cbfb2bdb5b794919 Task-number: QTBUG-45741 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Mark QRGba64 as Q_PRIMITIVE_TYPEMarc Mutz2015-04-271-0/+2
| | | | | | | | | | Change-Id: I1ab25a7b880b47f616ae152400c1e2116688ec4c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Don't use anonymous types declared in an anonymous unionLiang Qi2015-04-221-6/+8
| | | | | | | | | | | | | | At least clang is unhappy with them when -Wnested-anon-types is enabled. Change-Id: Ia9869fecb836b27be69f7b9715fd614f384bb912 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-2212-3070/+1176
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
| * Remove separate SSE4 unpremultiply functionAllan Sandfeld Jensen2015-04-164-34/+41
| | | | | | | | | | | | | | | | | | | | | | Merges the SSE4 specific unpremultiply with the normal version, and adds a SSE2 fallback. There was no reason to split the two since compile time options will ensure the right version is inlined. Also adds short-cut for 0 and 255 values. Change-Id: Ie5aa262f6964219fd3062d4a498f697cf79a4595 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Optimize non-native bilinear transformsAllan Sandfeld Jensen2015-04-161-12/+33
| | | | | | | | | | | | | | | | Reading directly from an array instead of calling a function pointer is much faster. Change-Id: I833b33448bad064d6f38d2f9ff44138d90206822 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Cleanup and optimization of qimage smoothscaleAllan Sandfeld Jensen2015-04-156-726/+762
| | | | | | | | | | | | | | | | | | Cleaning up smoothscale code. Upscaling is improved using existing optimized interpolation methods, and downscale is given SSE4.1 optimized versions. Change-Id: I7cdc256c26850948aef7dae26fda1622be6b8179 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Support gradients natively in the PDF generatorLars Knoll2015-04-092-233/+270
| | | | | | | | | | | | | | | | | | | | | | Add native support for linear and radial gradients to our PDF generator. This fixes a couple of issues with both the quality of the generated PDFs as well as sizes of the files. Task-number: QTBUG-42758 Change-Id: Ib905457e11e4dc52443c76b3761bca8d1fbe9bfc Reviewed-by: Stephen Chu <stephen@ju-ju.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| * Remove table of mostly null pointersAllan Sandfeld Jensen2015-04-081-2066/+70
| | | | | | | | | | | | | | | | | | The patch moves the initialization of the format to format blend tables to runtime, so we only have to explicitly set the values that are not null. This removes most of the lines in qblendfunctions.cpp. Change-Id: Ie017f380ff11cfb764a631cfea7626786731b5fb Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Add qHash(QMatrix) and qHash(QTransform)Marc Mutz2015-04-214-1/+51
| | | | | | | | | | | | | | | | | | | | | | QMatrix and QTransform can be compared for equality, so qHash should be overloaded, too. [ChangeLog][QtCore][QMatrix] Added qHash(QMatrix). [ChangeLog][QtCore][QTransform] Added qHash(QTransform). Change-Id: I1ce925ebe258c9d7e35b68e5ac5c3373f1460c58 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Remove <qhash.h> where it's not usedMarc Mutz2015-04-202-2/+0
| | | | | | | | | | | | | | | | To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5) in public headers. Change-Id: I6117e8a6b11200d2f1a0a94a0e87d5c27538218e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Move composition out of qdrawhelper.cAllan Sandfeld Jensen2015-04-165-2364/+2236
| | | | | | | | | | | | | | | | | | Also changes the way the SSE2 composition modes are inserted into the table, so it is handled like all the other tables and doesn't require duplicating most of the table. Change-Id: I8de383caece0367bc7466d7a1b145aa820c3bd6a Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Implement radial and conical gradients for rgb64 renderingAllan Sandfeld Jensen2015-04-154-101/+120
| | | | | | | | | | | | | | | | | | | | Adds the last two missing source types to rgb64 rendering. Conical and radial gradients. At the same time linear gradients are moved to a template form to increase code sharing. Change-Id: I30fdd0837b0da03e3447683856ebbe4d7f48df6c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Extend high color rendering to image renderingAllan Sandfeld Jensen2015-04-143-73/+1068
| | | | | | | | | | | | | | | | | | | | | | | | A previous commit added 16-bit per color-channel precision to solids and linear gradients. This patch extends that to include texture data. To support that pixellayouts now have a method to convert to RGBA64. Change-Id: I661ae91bd7038085787003608a0af4add057e478 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Add support for more composition modes in rgb64 renderingAllan Sandfeld Jensen2015-04-132-4/+287
| | | | | | | | | | Change-Id: I3bacecbabdf2d7b2de1acd86ab9383e69924a390 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix RGB30 painting testsAllan Sandfeld Jensen2015-04-131-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests were failing because the color was not read correctly from a QImage. To make it possibly to read more accurate colors a pixel accessor returing QColor has been added. Some tests also had the wrong order of arguments, confusing dest and src formats. This has been corrected, so they test what they claim to test. A test for RGB30 linear gradients is also added. Change-Id: Ic623ae1b8e0bf7383056b641c6e8230a1d7dd0dd Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Solid and gradients in high color accuracyAllan Sandfeld Jensen2015-04-1011-186/+925
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.5' into devLiang Qi2015-04-081-11/+0
|\| | | | | | | Change-Id: I04f9f2749f68c0cb5a427b8d84e43b44bb143e4d
| * [QFontEngineFT] Guarantee correct metrics for alphamap and its bounding boxKonstantin Ritt2015-04-071-11/+0
| | | | | | | | | | | | | | | | ...for both cached and non-cached modes, by disabling hinting for transformed glyphs in loadGlyphFor(). Change-Id: I13766a653ebd72cbed0f5c38ca3536d042aed762 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-062-84/+67
|\| | | | | | | Change-Id: If9fd98525b6b4ca07e5e006fc98bf372a73b8a21
| * Optimize fetching pixel values for SSE2 bilinear samplingAllan Sandfeld Jensen2015-04-041-72/+59
| | | | | | | | | | | | | | | | | | | | | | Most of the CPU time was spending in fetching pixel values instead of calculating the bilinear sample. The access to vectors unions turns out to be very slow, and should be avoided. This patch removes the uses of vector,int array union in the bilinear sampling for SSE2. Change-Id: Ie765a80963c4899db59a583ea9a59d15e05f2b13 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * 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>
* | | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-019-9/+20
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/testlib/qtestblacklist.cpp src/widgets/accessible/qaccessiblewidgets.cpp Change-Id: If032adb9296428f62384ed835dbf41ee7a0b886c
| * | Use QDebugStateSaver to restore space setting in stream operators.Friedemann Kleint2015-03-308-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | Returning dbg.space() breaks formatting on streams that already have nospace() set. Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e Reviewed-by: David Faure <david.faure@kdab.com>
| * | Don't remove mnemonics and parentheses under non-Mac system.Debao Zhang2015-03-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | SHA: 8e3aacf61bcfe036acdba8fac4d07d68ff0f5ab3 is a mac only patch, but some code introduced by which is not wrapped with Q_OS_MAC. So add the missing Q_OS_MAC here. Change-Id: I748d46b977740e6116dab5659ad1e47d23262a0f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-03-1616-148/+257
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbnativeinterface.h Change-Id: I31b38ba439b9341d51a01c0fd54bea33f7410076
| * | 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>
| * | QtGui: Fix const correctness in old style castsThiago Macieira2015-03-1212-72/+74
| | | | | | | | | | | | | | | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c946844bc31eb8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| * | Micro optimization to QPainterPrivate::drawGlyphsKonstantin Ritt2015-03-112-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | Re-use font engine obtained in the first place Change-Id: Icdc2ad404ba9b2aadf2732e95c43a47aa957a6fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | Add AVX2 autovectorized versions of premultiplyAllan Sandfeld Jensen2015-03-105-65/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following up on using GCC's autovectorizing for faster SSE4.1 premultiply, this patch adds specialized autovectorized versions of premultiply for AVX2, giving another almost doubling in speed. To make the speed up for AVX2 and also SSE4_1 available to non-GCC compilers, the target-specific methods have been moved to separate files. Change-Id: I97ce05be67f4adeeb9a096eef80fd5fb662099f3 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | Fix C++14 compilation in QRgba64Olivier Goffart2015-03-161-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | QRgba64 has Q_DECL_RELAXED_CONSTEXPR that builds a QRgba64, but it has no constructor that can be used in a constexpr. Change-Id: Ia032b65151243d071440c05479e8f2549c8b9503 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | | Introduce QRgba64 structure for 64bit RGBA valuesAllan Sandfeld Jensen2015-03-105-5/+519
|/ / | | | | | | | | | | | | | | This structure is meant to replace QRgb where higher precision is needed. Change-Id: I49d441e2133371a8b91c2e6af0c137bcc5fcb9ed Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Remove non-templated pixellayout methodsAllan Sandfeld Jensen2015-03-041-182/+38
| | | | | | | | | | | | | | | | | | | | | | Removes the non-templated pixellayout methods that were used for non-c++11 builds, and instead initialize with the templated ones verbatim. These versions are faster, and using only those removes duplicate code. Change-Id: I91a7d9122d2601ad282287a2f5ed6b88877d52fb Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Oswald Buddenhagen2015-03-041-2/+2
|\| | | | | | | Change-Id: I556be99cc7ad3fc6f7177542b7444269616a7478
| * Painting: Avoid endless loop for certain bezier curvesEirik Aavitsland2015-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | If the coordinates were too close (at the limit of the number accuracy), the splitting algorithm in QBezier::shifted() would never finish. Ref. testcase in bugreport. Task-number: QTBUG-44674 Change-Id: I2a575cdc6284504ef5e3eb2b749857576fe433c3 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Remove some uses of the private Q_PI constantAllan Sandfeld Jensen2015-02-265-10/+8
| | | | | | | | | | | | | | | | | | The patch removes several uses of the private Q_PI constant and removes the qmath_p.h from the includes. A few places are optimized to multiply with reciprocals instead of dividing by Q_PI. Change-Id: I097af6a929e0609d6935563064e81c856005f4bc Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Remove unused private definitions and functionAllan Sandfeld Jensen2015-02-261-7/+0
| | | | | | | | | | | | | | | | Remove two definitions and one function not used anywhere in the Qt source code. Change-Id: I275e7c7a2d52dd4ac90cc9e6c782cbdfc14791f3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Minor optimization in SSE4 unpremultiplyAllan Sandfeld Jensen2015-02-261-2/+1
| | | | | | | | | | | | | | Use a more direct conversion to desired unpacked format. Change-Id: I47e4a31c580f294c4e717850c4a420e16214e0a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove PREMUL and INV_PREMUL macrosAllan Sandfeld Jensen2015-02-251-5/+0
| | | | | | | | | | | | | | | | These macros have been deprecated since 5.3 and have always been private. Change-Id: I8c80b059a4c026c037f55279a3dfc0dca58c5d5c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix underline for centered textEskil Abrahamsen Blomfeldt2015-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The position of the text itself is always floored, since the glyph contains the subpixel antialiasing. Since no antialiasing is applied to the underline, its position also has to be floored, otherwise it will sometimes appear one pixel to the right of the text it's underlining. [ChangeLog][Text] Fixed position of underline on centered text when the text layout's width is an even number. Task-number: QTBUG-39286 Change-Id: Ib1704ac5b09289f5b3f5a6580443f234d6d868fc Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-243-12/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * Fix crash in QPainter::drawGlyphRun() when painter is not activeOlivier Blin2015-02-241-0/+5
| | | | | | | | | | Change-Id: I24f52cf1db300b8a6d0a4cb19fc6c74c41e00dbc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| * Fix regression in opacity handling of pdf path strokePeter Niekamp2015-02-111-3/+8
| | | | | | | | | | | | | | | | | | | | | | Specifically when rendering svg to a pdf, when painter opacity is set, path strokes were transformed incorrectly due to missed setting of dirtyTransform flag. Task-number: QTBUG-38675 Change-Id: I861353822ccddd394910b8612687a244d195a41e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Qt 5 to-do in qpainterengineex_p.hSamuel Gaist2015-02-071-9/+0
| | | | | | | | | | | | | | | | This patch apply the recommended cleanup in qpainterengineex_p.h Task-number: QTBUG-25069 Change-Id: Ice2c3298c88ba6a7141642470aeeefa782af7f3a Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | | | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Use C++ <cmath> instead of <math.h>Allan Sandfeld Jensen2015-02-163-21/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Including math.h can pollute the default namespace, and break some compilers if cmath versions of the method are declared as using. Switching to C++ math functions also greatly simplifies handling of float qreal as C++ automatically chooses the right method. [ChangeLog][QtCore][QtMath] qmath.h no longer includes math.h, so any sources depending on that indirect inclusion may fail to build. Change-Id: I4d0e331dafba354ec05dc5052e61ef4ff8d387fe Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>