aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickpixmapcache.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused variableThiago Macieira2016-03-101-1/+0
| | | | | | | | Found by ICC. Change-Id: I0c94a5c2846b48c8aea7ffff14352fd8573cbf66 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* QQuickPixmapCache: Use readImage's (more useful) error message.Robin Burchell2016-02-121-2/+0
| | | | | | | | | | | | | readImage already assigns to errorString if something goes wrong, so there's no need to overwrite it with a less useful error message (which doesn't tell us what actually went wrong). Before: Invalid image data: test.qml After: Error decoding: test.qml: Unsupported image format Change-Id: I7df3d24497d001e18453034c6f9f63bb51bd0ecc Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Quick: Sanitize reading environment variables.Friedemann Kleint2015-10-261-1/+1
| | | | | | | | | | | | | | Where possible, use qEnvironmentVariableIsSet()/ qEnvironmentVariableIsEmpty() instead of checking on the return value of qgetenv(). Where the value is required, add a check using one of qEnvironmentVariableIsSet()/Empty(). Move QSGAtlasTexture::qsg_envInt() to qsgrenderer.cpp for reuse as qt_sg_envInt() and add qt_sg_envFloat(). Change-Id: I4c93f16c228d4f537154f389a0fa1427654485f7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-08-211-0/+7
|\ | | | | | | | | | | | | Conflicts: tools/qml/main.cpp Change-Id: I6d521b21be85d91ebb96c28e2c64186f02d94842
| * Fix memory leak when QQuickPixmapReply::Event is delete before being usedAlbert Astals Cid2015-08-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | It can happen that QQuickPixmapReply::postReply is called, and before QQuickPixmapReply::event is called the object gets deleted. That means that the texture factory will never be deleted. To fix that we delete it in the destructor of QQuickPixmapReply::Event and set it to 0 in QQuickPixmapReply::event after assigning to the next data structure that will take care of it Change-Id: Ibea62f5a10a53cca586de7c5f03f00aabfb88b2e Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Fix memory leak when using async image providersAlbert Astals Cid2015-08-191-0/+1
| | | | | | | | | | Change-Id: I08392ab0a3edb1ac162110ebc349ad457800c788 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Do not leak the texture factory for cancelled jobsAlbert Astals Cid2015-07-141-0/+2
| | | | | | | | | | Change-Id: Ie18e019402857acd17203681d45adaf32be54fcc Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix segfault if QQuickImageResponse actually returns an error stringAlbert Astals Cid2015-06-301-1/+1
| | | | | | | | | | Change-Id: Ieda5250157dea96bcd5a86d0617f1d64156242e7 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-041-36/+68
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine_p.h src/quick/items/qquickitemsmodule.cpp src/quick/items/qquicktext.cpp src/quick/util/qquickpixmapcache.cpp tests/auto/quick/qquickwindow/tst_qquickwindow.cpp Change-Id: I90ecaad6a4bfaa4f36149a7463f4d7141f4a516a
| * Optionally apply orientation on imagesAllan Sandfeld Jensen2015-05-191-36/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the option to follow EXIF orientation. This was previuosly automatically applied to TIFF images, but not JPEGs except in Qt 5.4.1. [ChangeLog][Image] An autoTransform property has been added to control whether metadata image transforms such as EXIF orientation are automatically applied. By default it enabled for TIFF images and disabled for JPEG. Change-Id: I8a4cf204985b2a7d158a0e046e52db7cda970d20 Task-number: QTBUG-37946 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Do not stall loading of local images if network is slowAlbert Astals Cid2015-04-091-10/+29
| | | | | | | | | | | | | | | | | | | | Without this patch it can happen that we're loading IMAGEREQUEST_MAX_REQUEST_COUNT http based images, if the next image to load is a local file it wouldn't be processed until one of the http ones finishes, which makes not much sense Change-Id: I515306005192a20722f0c4588a1db1241348407c Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
| * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-311-3/+5
| |\ | | | | | | | | | Change-Id: I54e66e992f5e5d441b8b5394e7a03ec5352e7bf3
| | * Always remove reply from replies when processing cancelledAlbert Astals Cid2015-03-301-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we if we leave the entry in replies later QQuickPixmapReader::networkRequestDone will give a potentially already deleted pointer in replies.take(reply) which will then crash when trying to post something to it Change-Id: I157a58e3ebe0a3fd6422742843eafbbdc58a7801 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | | Add QQuickAsyncImageProviderAlbert Astals Cid2015-03-261-96/+175
|/ / | | | | | | | | | | | | It allows for providers to implement threading on their side Change-Id: I34042b213ce7697a3e39470387357d733e15723c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Update copyright headersJani Heikkinen2015-02-121-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. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* | Introduce QSG_TRANSIENT_IMAGES.Gunnar Sletta2015-02-031-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature enables the same feature that we already have in the 'nonpreservedtexture' in the scene graph playground. This change also cleans up some leftover logic from the early Qt 5.2 days when we had to manually extract the image from the default texture factory rather than going through QQuickWindow::createTexture(). This cleanup is required for the logic to work. Change-Id: I7cdf15d981ba8af94f8d51781fc01e2b834b77c6 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-091-13/+40
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/context2d/qquickcanvasitem.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp src/quick/scenegraph/coreapi/qsgrenderer.cpp src/quick/scenegraph/qsgadaptationlayer.cpp src/quick/scenegraph/qsgrenderloop.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp src/quick/scenegraph/qsgwindowsrenderloop.cpp src/quick/scenegraph/util/qsgatlastexture.cpp src/quick/scenegraph/util/qsgtexture.cpp src/quick/util/qquickprofiler_p.h Change-Id: Ie274c3baf72a8a0711c87d67238d68e2b2887429
| * Remove alpha channel from images that doesn't actually have alpha.Gunnar Sletta2014-10-091-0/+25
| | | | | | | | | | | | | | | | | | We did this for QPixmap since forever, and it has a huge impact on rendering performance, so there is no reason why we shouldn't spend that extra bit of time. Change-Id: Ibd2e6d585525a5b5a975b8d7498c21dec00647c5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Select specific features to be recorded when profiling QMLUlf Hermann2014-09-111-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | Some features, like the memory profiler, create huge amounts of data. Often enough, we're not actually interested in all the data available from the profiler and collecting it all can lead to excessive memory consumption. This change enables us to optionally turn various aspects of QML profiling off. Task-number: QTBUG-41118 Change-Id: I7bb223414e24eb903124ffa6e0896af6ce974e49 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | QQuickPixmapStore: Don't start expiration timer when application quitsOleg Shparber2014-10-021-1/+3
|/ | | | | | | | | | This change removes a warning printed during application closing stage about a timer started not from QThread. Change-Id: I93ca4da7066bd5e0784509676bc59969a8e2ad48 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Optimize the way AnimatedImage display its contentLouis du Verdier2014-06-051-0/+19
| | | | | | | | | | | | Since QtQuick2, the AnimatedImage component is less efficient than it was with QtQuick1, using more CPU and RAM. This commit makes it upload when required each animation frame as a cached texture (using QQuickPixmapCache) to speed up the component. Task-number: QTBUG-38921 Change-Id: I7ab0b5f47ecec6cb3cdded0dd219d6acc1bc4148 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-06-041-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | The merge conflict is about the removal of "d1" from the register set on ARM, but that was already done in dev in commit ddb33ee9ba9e1344caa9be5dbf4b534c3ede692e The change in src/quick/scenegraph/coreapi/qsgrenderer.cpp with commit 2414f1675eab163b22dcc4e8ded80ed04d06369b was reverted to what it was before, per Laszlo's advice. Conflicts: src/qml/jit/qv4isel_masm.cpp Change-Id: I7bce546c5cdee01e37853a476d82279d4e72948b
| * Fix potential null pointer dereferencingFrederik Gladhorn2014-05-301-1/+1
| | | | | | | | | | | | | | | | | | These were found by http://www.viva64.com/en/b/025 most issues are rather cosmetic. Change-Id: I7cc12610aae6a43d26bedb9b480863c0695ddfa3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Say hello to QQuickItem::grabToImage().Gunnar Sletta2014-05-011-0/+6
| | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick][Item] Added functions QQuickItem::grabToImage() and Item::grabToImage() to allow grabbing of items into system-memory images. Change-Id: I76cd73bb62f7440569c6fce63d63528559845721 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Make profiling of pixmap cache events more consistentUlf Hermann2014-04-221-6/+14
|/ | | | | | | | | | Previously canceled replies weren't reported, the cache count was reported before it was updated, and the request or implicit sizes were reported instead of the size actually stored in memory. Task-number: QTBUG-37890 Change-Id: I9d9d9f6b9bfa75c7d56b778fc8174bda4e842d72 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Move QtQuick profiling to own profiler adapterUlf Hermann2014-02-151-11/+11
| | | | | | | | The QtQuick parts of the QML profiler service thus become a proper global profiler which can be independently enabled and disabled. Change-Id: Ifad03801cab2be66a264fc46fdebdae582fcc99b Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* fix whitespaceOswald Buddenhagen2014-01-221-22/+22
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Further pack messages for QQmlProfilerServiceUlf Hermann2014-01-221-12/+10
| | | | | | | | | | | Allow multiple detailTypes in each packet and extend the profiling code to make use of that. Note that this changes the usual order of pixmapSizeKnown and PixmapLoadingFinished events. As far as I can see this doesn't affect the QML profiler frontend and the order of these events isn't specified anywhere. Change-Id: Id39ad98594ccf35add4415e08daf9e92ab561237 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Unify calls to profiler service event methods.Ulf Hermann2014-01-221-16/+16
| | | | | | | | | | | | Don't needlessly duplicate information about the profiler being available and allow inlining. Use macros to check availability of the profiler in calling code and generally simplify the code. Task-number: QTBUG-35315 Change-Id: I0a9daec4a95f74b9db795ef2918a01fb772ea107 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-12-121-11/+0
|\ | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlcompiler.cpp Change-Id: I802731139d47c5b733dd805f7bf432d67d7331e1
| * Revert "Load "@2x" images on high-dpi "retina" systems."Morten Johan Sørvig2013-12-031-11/+0
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 707bbe5dea9d7398b205124a54422f2fafb6f151. By itself this is completely broken and the image will display at twice the size. We need to add code to handle the @2x image but revert for now to get sane behavior. Change-Id: Iccdb26e9d19930b5d0ef4b6c7f596c5766f77a8a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | Correctly profile the size of loaded pixmapsUlf Hermann2013-12-091-6/+2
| | | | | | | | | | | | | | | | | | | | Only set the sizes when they're known, prefer request size to implicit size (as the request size is what ends up in the cache), and don't set the size twice. Task-number: QTBUG-35337 Change-Id: Ie516a1cae2d9050f61362ee99cf8a6a9dd8ea3bb Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Profile a pixmap start event also when loading is asynchronous.Ulf Hermann2013-12-061-0/+3
|/ | | | | | | | | | | If those events aren't profiled we get unmatched events for finished loading and errors. Task-number: QTBUG-35337 Change-Id: I132638edf5625566e37ee06453484f80b2adb74a Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QmlProfiler: Pixmap CacheChristiaan Janssen2013-04-301-2/+22
| | | | | Change-Id: Ibc237bb162c24030438b89d54fa8802ee66b080a Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Fix QString usage in createPixmapDataSync().Friedemann Kleint2013-03-121-2/+2
| | | | | | | Warning introduced by 707bbe5dea9d7398b205124a54422f2fafb6f151 . Change-Id: I20f0da00ea519cc2ec82a1d13f1887c099a3947c Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Load "@2x" images on high-dpi "retina" systems.Morten Johan Sørvig2013-03-051-0/+11
| | | | | | | | | | | | | | Check for the existence of a "@2x" file when loading an image from a local file url. For example, Image { source = "foo.png" } will load "foo@2x.png" if that file exists. Change-Id: I37688d035bc9eb412d54be0eb758dd52ebfa5d90 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Do not print out leaked pixmaps by defaultGunnar Sletta2013-03-031-1/+12
| | | | | Change-Id: Id112def9710efa943ffc5350a25d40d4c4f463a1 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Do pixel conversion on the pixmap decoder thread when possibleGunnar Sletta2013-02-121-0/+11
| | | | | Change-Id: Id991bee5c0a8b260fc1ca4395402970c6a722b5d Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Prevent possible leak with texture providers.Michael Brasser2013-01-251-0/+2
| | | | | | | | If the job has been cancelled, ensure we clean up the texture factory that was created. Change-Id: I0a6e4a23732e6041084ddc483d701a25befd91c9 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Support requestPixmap if platform has ThreadedPixmaps featureAlbert Astals Cid2012-11-231-1/+17
| | | | | | | | | As discussed with Samuel enable the use of requestPixmap in a thread for async requests if the platform support ThreadedPixmaps Task-number: 28138 Change-Id: I106cf0123430115464b0a75071c7e6129a98d22b Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Pixmap loader adds images to unreferenced list when cache: falseMartin Jones2012-07-271-2/+10
| | | | | | | | | | | | | | Don't add uncached images to the unreferenced list, since they cannot be reused later as they are not in the cache. Additionally, we currently search for images in the cache, even if we set cache: false. Setting cache false should not put images in the cache and should not use images that are in the cache. Task-number: QTBUG-26676 Change-Id: Ib7eb42199ae6ae6154b696c83ad1dd959e0f208f Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* QQuickCanvas renamesAlan Alpert2012-07-171-1/+1
| | | | | | | | | | | | | | | | QQuickCanvas is now called QQuickWindow QQuickCanvas::rootItem is now QQuickWindow::contentItem QQuickItem::canvas is now QQuickItem::window QQuickItem::ItemChangeData::canvas is also renamed window QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow The functions related to the color property have dropped the clear from their names. The first three changes have interim compatibility measures in place to ease the transition. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix crash in QQuickPixmapData::release()Chris Adams2012-06-211-0/+4
| | | | | | | | | | | | | | | | | Previously, if the reader was deleted (eg, via engine destruction) the reply might be deleted without letting the associated QQuickPixmapData know about it. If that data was later released, it would attempt to write to previously freed memory. This commit ensures that the data's reply ptr is set to zero when the reply is deleted by the reader dtor. It also adds a comment to the reply dtor to explain why it is important. A unit test for this issue already exists: tst_qquickpixmapcache::lockingCrash() run under valgrind. Change-Id: Icd94528e1336db1c00b118b3f6d1222eef402c46 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Avoid string-based lookup of signalsKent Hansen2012-06-011-7/+6
| | | | | Change-Id: I5b83b5d07b6a5d2de86d0f37471cf59baa7b0e43 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Remove unused data member in QQuickPixmapCacheMartin Jones2012-05-301-3/+2
| | | | | Change-Id: Ia66d2fac821c133d00d9dfcaf2b497f212ffc832 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Fix scaling of svgz images.Andrew den Exter2012-05-291-5/+1
| | | | | | | | | Force scaling of svgz images to source size as is done for svg. This also removes a work around for QTBUG-9053 which has now been resolved. Task-number: QTBUG-9053 Change-Id: I3aa898f74960ceb2e515bdb3aa44aa5a1a7a64d2 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>