summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
Commit message (Collapse)AuthorAgeFilesLines
* qpa: Document a requirement of the backing store implementationHolger Hans Peter Freyther2012-03-061-0/+3
| | | | | | | | Docuent the requirement that the alpha channels need to be properly initialized by the implementation. Change-Id: I03db81b44b43ea75feb1b983fb0725c65a3bd9f4 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-028-262/+262
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Export QPaintEnginePrivate from QtGuiBradley T. Hughes2012-03-021-1/+1
| | | | | | | | This allows the QCoreGraphicsPaintEngine to use QPaintEnginePrivate members (e.g. pdev and drawBoxTextItem()). Change-Id: I5bed3cb007ae469816afce619edd55f155b04fa9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QFixed: make constexprMarc Mutz2012-02-261-68/+68
| | | | | | | | Make most QFixed{,Size,Point} members constexpr. See f3141c58badbd2da9eb42021e9704742c3e52a9b for rationale. Change-Id: I0b44f59bb768e1f79c57e1c9a0dc67afb515e03f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QFixed{,Size}: reformulate some functions in a constexpr-friendly wayMarc Mutz2012-02-261-23/+24
| | | | | | | | | | | | | | | | | | The main change is the addition of a new constructor that passes its argument into 'val' verbatim. In order to disambiguate it from the existing QFixed(int) constructor, it takes a second 'int' argument. This is too ugly for public API, so it's private, and only used by static QFixed fromFixed(int), which is the existing named constructor with the same semantics. The rest of the changes simply reformulate their operations in terms of fromFixed(). This makes them ready to be constexpr'ed. Change-Id: I2a3813d62bd4124064755de6b00526a60fc82c1d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove use of Q_BROKEN_DEBUG_STREAM.Stephen Kelly2012-02-224-30/+0
| | | | | | | | No supported compiler defines it, and it was not used consistently so it didn't work anyway. Change-Id: Icc9e911e22daaedaee3d9316c15d19be26cd2e72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QPlatformIntegration/QPlatformTheme from QGuiAppPrivate.Friedemann Kleint2012-02-201-0/+1
| | | | | | | Forward-declare instead. Change-Id: I3851994e8bc05b389e94e948478339ba33d521c1 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added static keyword to blend_transformed_tiled_argb/rgb565().Kim Motoyoshi Kalland2012-02-141-2/+2
| | | | | Change-Id: I43745c672d5d31ef89901234c04bf2433269462c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Removed unused qStorePixel[] array.Kim Motoyoshi Kalland2012-02-141-12/+0
| | | | | Change-Id: I9c9df19fcf06b127aaebb7ab093221e1b254ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixed CustomDashLine drawing bug.Samuel Rødal2012-02-081-1/+3
| | | | | | | | | | | The bug was caused by attempting to stroke an empty subpath. If there have been no line-to's emitted we should not try to join the start and end of that line segment. Task-number: QTBUG-23248 Change-Id: I38b7e955ed6683f8fc25f9551e93b4f472c022bf Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com> (cherry picked from commit 593947ba70188df3d33efe031fab2fd255faa8b9)
* Fixed source composition with opacity in the raster paint engine.Kim Motoyoshi Kalland2012-02-081-0/+2
| | | | | | | Task-number: QTBUG-24075 Change-Id: I2b9263364bf30fb8c914823e80e7ea4a8af26035 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fixed jagged lines when drawing scaled image with raster engine.Kim Motoyoshi Kalland2012-02-071-2/+3
| | | | | | | Task-number: QTBUG-24055 Change-Id: I97a0bf3711e1b4423e2c76ec907c9e2a57522ff9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Removed image format specific template functions in raster engine.Kim Motoyoshi Kalland2012-02-078-4188/+1633
| | | | | | | | Simplified the raster engine by treating image formats in a more generic way and removed some unused code. Change-Id: Ib3979a1a6e3e6f17c5002248545779ec36fff7c9 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Add distance field generation functions from ScenegraphJiang Jiang2012-02-063-2/+1745
| | | | | | | | Since we may use distance field text rendering in raster, these functions need to be moved from declarative to QtGui. Change-Id: I158bc3bae02b5590ae812f06ad7a78a5914bcb9e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Windows: Fix inclusion of <windows.h>Friedemann Kleint2012-02-011-7/+7
| | | | | | | | | | | | | - Always use <qt_windows.h> as the last file to be included. - Remove it from some headers, use Qt::HANDLE instead of HANDLE. - Clean up #ifdef, use Q_OS_WIN for Windows/Windows CE. - Add NOMINMAX to qt_windows.h to avoid problems with the min/max macros. - Remove <windows.h> from qplatformdefs.h (VS2005) Change-Id: Ic44e2cb3eafce38e1ad645c3bf85745439398e50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Remove many deprecated methodsLars Knoll2012-01-314-20/+0
| | | | | | | | | | Remove methods that have been marked as deprecated before Qt 4.6. Keep others, but inline them where possible and mark them as QT_DEPRECATED_SINCE(5, 0). Change-Id: If881821ae095f054b31cc13464f19e2007c20ed7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Remove Symbian specific code from QtGui.Xizhi Zhu2012-01-313-204/+0
| | | | | Change-Id: I450a78863462936d0b18e211763f274b59497109 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-30102-102/+102
| | | | | | | | | | 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>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-2521-21/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Move glyphMargin() to QFontEngineJiang Jiang2012-01-243-11/+5
| | | | | | | | | | | | | glyphMargin() support for QTextureGlyphCache is implemented in respective font engines, thus this function is platform dependent. Before Qt 5 the code is guarded in macros like #ifdef Q_WS_MAC, now we should move them into QFontEngine and its subclasses. So far only Windows font engines support it. FreeType and Core Text based font engines all ignore it. Change-Id: Ia14016533d8fbfaacf848a7d3bc928f8197318f5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-23102-102/+102
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Mark obsolete methods in qregion as deprecatedLars Knoll2012-01-172-20/+21
| | | | | | | | | Make them inline as well, so they don't create symbols. Change-Id: I779103d6752e75809d16632c8c0eb374cdbd9705 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Update year in Nokia copyright headers.Jason McDonald2012-01-101-1/+1
| | | | | | | | The previous change missed some headers from years prior to 2011, and a few new files were merged after the previous change. Change-Id: Ib7d1a2b7062228c2a5373da64242b2ee1f0981e1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Limit Bezier curve subdivision to maximum 512 line segments.Kim Motoyoshi Kalland2012-01-061-4/+16
| | | | | | | | Avoid running out of time and memory for extreme cases. Task-number: QTBUG-23443 Change-Id: Iac7799097d61295bb7395a2efe48b3e7d9257919 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-05101-101/+101
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix QPainter::drawText with complex brushesSimon Hausmann2012-01-041-1/+1
| | | | | | | | | | | | Commit d52fd497f60a3c4456994f4f10e9451d611c9ea4 introduced a call path to QPaintEngineEx::drawStaticTextItem, which has a bug in using the pen's color instead of the entire brush. This patch replaces the use of the color with the pen's brush(). Task-number: QTBUG-23450 Change-Id: Ieb3bf352c840ff0d3fb4ac678caf7b13f4f9a8f1 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Inline some methods in qgrayraster.Robin Burchell2012-01-021-53/+7
| | | | | | | | | | | | gray_conic_to, gray_cubic_to and gray_line_to were all single line wrappers around their equivilent gray_render counterparts, with an additional lie of error handling that never actually happened. Since this doesn't really do anything except confuse the reader, let's ... not do it :) Change-Id: Id5d86c49174acb92514b628a70bd32d6c6640a5d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* blitter: Base QBlitterPaintEngine on QRasterPaintEngineHolger Hans Peter Freyther2012-01-022-117/+119
| | | | | | | | | | | | | | The original intention was to identify a clipping bug, it turns out that during a ::begin() (and systemChanged) we should forward the QPaintEnginePrivate state to our proxy engine. Instead of using the proxy-pattern subclass rasterengine and specialize the paths we are able to accelerate using the blitter interface. This will avoid similiar problems in the future. I have no performance measurement to show which of the two approaches is faster/slower. Change-Id: I39bff11b32b1fe20284c7e8df60050de5991bb6e Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Group code by functionality in header and cpp fileHolger Hans Peter Freyther2012-01-022-120/+118
| | | | | | | | | | * Group code responsible for tracking the render pipeline state to check if we can easily accelerate it * Code that will call into the QBlittable * Code that will lock the QBlittable before calling into raster Change-Id: I862e242d59805de5094ed363b486afcdbc23ff78 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Fix the 'solid' detection for the brush in case of fillRectHolger Hans Peter Freyther2012-01-021-2/+2
| | | | | | | | | | | A default QPainter will set a QBrush with Qt::NoBrush BrushStyle, the current code detects this as a non solid fill and all calls with fillRect and a color will not go through QBlittable. Check for Solid or NoBrush style. Manually verified that a p.fillRect(rect, Qt::red) goes through the accelerated path now. Change-Id: Ic0d98030e94f5d11abbe61628fbf71d1e08219c2 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Move state updates into new methodsHolger Hans Peter Freyther2012-01-021-45/+86
| | | | | | | | | Create updateCompleteState(QPainterState*) so we don't need to call into the paintengine, move all state methods into the QBlitterPaintEnginePrivate class. Change-Id: If30fdcc3f63755e0443bced7d9d9fb993d4ec2b7 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Move the definition out of the classHolger Hans Peter Freyther2012-01-021-59/+72
| | | | | | | | Cosmetic change to remove four spaces of indention from some of the deeply nested methods. Change-Id: I67fdd0ab722b7c7c67c4da7a0a0bd86459751700 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Kill the isBlitterLocked variable of the QBlitterPaintEngineHolger Hans Peter Freyther2012-01-023-10/+11
| | | | | | | | | | It starts with being initialized wrongly, the call to buffer() will lock the data while we think it is not locked, it can also get out of sync by someone calling buffer() again. Remove the variable and check with the QBlittable if we need to lock the resource into memory. Change-Id: I350375011138d1b4c2c48c100b7b30b8ea2ae460 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Use CapabilitiesToStateMask as a class memberHolger Hans Peter Freyther2012-01-021-31/+29
| | | | | | | | | Move the bit helper functions into CapabilitiesToStateMask as they are only used in this class, allocate the class as part of the QBlitterPaintEnginePrivate, shorten the name as well. Change-Id: If22ddd117a9789cd98edb08f23fd0ffabb17d5a5 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Style changes to the codeHolger Hans Peter Freyther2012-01-021-78/+65
| | | | | | | | Spend some bytes for spaces after comma and keywords. This should now mostly follow the Qt style guidelines. Change-Id: I3298c8d41d40ab5b0153a33d44b1b607a2edca8e Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* raster: Fix typo in a function argumentHolger Hans Peter Freyther2012-01-021-1/+1
| | | | | | | Change-Id: I903e1245667680f43414414bb0b4bfaa6240ea04 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Remove qt_image_id() and qt_image_colortable().Robin Burchell2011-12-201-2/+0
| | | | | | | | Both of these have been unused at least as far back as Qt 4.5 according to git log -p. Change-Id: I381024cb1621fbfdb806a62e1cc55ce13219ef17 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Improved path filling performance in the raster paint engine.Kim Motoyoshi Kalland2011-12-164-55/+93
| | | | | | | | Convert bezier curves to polylines before rasterizing with gray raster. Change-Id: I353debd4338f2a3ce2fa1cfa1bff9dd2e36f05ab Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Improved performance of large text when parts are outside view.Kim Motoyoshi Kalland2011-12-131-6/+81
| | | | | | | | | Avoid generating paths for the parts of the text that are outside the viewport in the raster paint engine. Task-number: QTBUG-22687 Change-Id: I06159bc4c1aa82a07606f4b2f0336cb25dfd56d2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Silence -Woverloaded-virtual warnings in QRasterPaintEngineBradley T. Hughes2011-12-122-13/+13
| | | | | | | | | | | | | | | | | | | | | | The QRasterPaintEngine::updateState() is not a reimplementation of QPaintEngineEx::updateState(const QPaintEngineState &state). Rename the updateState() function to updateRasterState(), and ensureState() to ensureRasterState(). These names were chosen to match the class name QRasterPaintEngineState on which these functions operate. ../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengine_raster_p.h:271:10: warning: 'QRasterPaintEngine::updateState' hides overloaded virtual function [-Woverloaded-virtual] void updateState(); ^ ../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengineex_p.h:202:18: note: hidden overloaded virtual function 'QPaintEngineEx::updateState' declared here virtual void updateState(const QPaintEngineState &state); ^ Change-Id: Ie9ff0230019b383d53757029c6b2194dfc6a2664 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Silence -Woverloaded-virtual warnings in QBlitterPaintEngineBradley T. Hughes2011-12-122-5/+5
| | | | | | | | | | | | | | | | | | | | QPaintEngineEx declares several virtual clip() overloads, but clip() with no argument does not reimplement any of these. Rename it to clipData() (to make the name of the return value more closely). ../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengine_blitter_p.h:104:29: warning: 'QBlitterPaintEngine::clip' hides overloaded virtual function [-Woverloaded-virtual] inline const QClipData *clip(){return raster()->d_func()->clip();} ^ ../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengineex_p.h:157:18: note: hidden overloaded virtual function 'QPaintEngineEx::clip' declared here virtual void clip(const QPainterPath &path, Qt::ClipOperation op); ^ Change-Id: Ifd7c494e2c999d743216cfb4c27a9c3ccf66f2a9 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix typo in APIDocsThomas Zander2011-12-101-1/+1
| | | | | | | | | | The name of an enum was slightly misspelled in the API docs, so lets make sure its now copy-paste friendly. Change-Id: I5da5230ab29743b63bf238a379891c98ac9d5039 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thomas Zander <zander@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Improve Q_CONSTRUCTOR_FUNCTION and Q_DESTRUCTOR_FUNCTION macros.Jędrzej Nowacki2011-12-011-3/+1
| | | | | | | | | | | | | By adding anonymous namespace and static linkage we are reducing visibility of implementation of these macros. This patch also fixes warning about a declared but unused variable which was issued by gcc 4.6 for Q_CONSTRUCTOR_FUNCTION. Change-Id: I2cb70ad4c93f6f77e5518420abcce6fd4cadccfa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* QPainterPath: Fix copy constructor again.Charles Yin2011-11-081-1/+1
| | | | | | | | | | | | The previous fix a05270f435483937e76d18fa6e512dc0394507d1 is not correct, QPainterPathPrivate(other) should be QPainterPathPrivate(), as there is only a default ctor for QPainterPathPrivate and ref is initialized there, use copy ctor just copies the ref value which makes all detach() calls broken. Add an unit test for this as well. Change-Id: I658f0a977664d5ec523af3f8a48c1a866eda6ab0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix subpixel positioning supportJiang Jiang2011-11-083-28/+8
| | | | | | | | | | | | Move subpixelPositionForX from QTextureGlyphCache to QFontEngine, since some font engines like QFontEngineFT may need a custom implementation or tweak it a little bit. In QRasterPaintEngine::drawCachedGlyphs, do not add aliasedCoodinate to x offset as that will break subpixel positioning. Change-Id: Idbcec617509459b80965220ceb07b17737649bbf Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Implement QRegion::isNullJędrzej Nowacki2011-11-082-0/+16
| | | | | | | | The method was missing from QVariant perspective (QVariant::isNull supposed to call isNull not isEmpty). Change-Id: Ic1ac9f662e275ac73908809f2c4ac59679b40b00 Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* QPainterPath: Fix copy constructor.Friedemann Kleint2011-11-071-1/+1
| | | | | | | | | | Re-add base class initialization accidentally removed by e277575987657aa07444eea9bee99769f039d3b0. Fix warning: 'base class 'class QPainterPathPrivate' should be explicitly initialized in the copy constructor. Change-Id: Ie94fa82eeeb3a8ddc69aef447f73ce36da616916 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Improve QtGui start-up time and memory use.Samuel Rødal2011-11-041-55/+86
| | | | | | | | The gamma lookup tables can be allocated and computed on demand, as they're not always needed, depending on the platform and the use case. Change-Id: I2d4c2860746366a0e46edb53bd4ecd2778de2464 Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Revert "Fix use of qMax() with floating point constants"Sergio Ahumada2011-11-011-2/+2
| | | | | | | This reverts commit 4e1b8720c1498edbb7a5bd37f622fdd3feb07850 Change-Id: I5e52a86119b522888b69fa261ebfa9168f885864 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Fix most warnings about assignments of QAtomicInt.Friedemann Kleint2011-10-313-4/+5
| | | | | Change-Id: Ide409d72d2637b68ec2a85aaca4bc783a7e911e7 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>