summaryrefslogtreecommitdiff
path: root/vcl/source/animate
AgeCommit message (Collapse)Author
2022-11-13vcl: extract functions AllRenderersPaused() and PruneMarkedRenderers()Chris Sherlock
Change-Id: I0fc55e829e22b81a076f2b66d78bb2b90abdfc41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136413 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-11-13vcl: small optimization determining if any renderers are activeChris Sherlock
Currently we look at every renderer to see if it is paused. However, you can think of this differently - instead of using a universal quantifier we can actually use an existential quantifier - if even one renderer is not paused, then we can say that not every renderer is paused - thus no global pause. Hence switch to any_of(), which stops the loop at the first instance of a non-paused renderer. Change-Id: I3b35bc41e86432374e4bc5fae0a2927ec8cc2309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136412 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-10-28vcl: extract function Animation::RenderNextFrameInAllRenderers()Chris Sherlock
Change-Id: Iaccf12b251ffe06e24813c48ba3a169d0eaaa61c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76416 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-10-17vcl: extract variable and rename Animation::mnPos to mnFrameIndexChris Sherlock
Change-Id: I889a33718da0984bd9230a9b93fe90403272888b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76415 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-10-17vcl: extract Animation function PopulateRenderers()Chris Sherlock
Change-Id: I6e490d13ee23faf4536c930264f71354382a08d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76410 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-10-14vcl: followup 'vcl: extract function CreateAnimationDataItems'Chris Sherlock
Change-Id: I25d2057477dae952e2ded966cf2f7feedf6d90f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141341 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-10-12vcl: extract function CreateAnimationDataItemsChris Sherlock
Change-Id: Ifc245b570d82d2fcbcd2cbb83cbd43664b228bf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76409 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-10-09vcl: pAnimView to pRenderer (clarify variable name)Chris Sherlock
Change-Id: I909aa5f3b2dd1c62d4fb1f8eb3ea0f5a2e4d7ed4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136434 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Jenkins
2022-09-16vcl: AnimationBitmap -> AnimationFrameChris Sherlock
The emphasis is not quite right. An animation is made up a sequence of *frames*, not bitmaps. A frame includes such things as position, size, timeout till the next frame *as well as* a bitmap. Note: had to regenerate a bunch of precompiled headers Change-Id: Ib1959452653857555f41e01ac0151d08c41a3b1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76460 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-19vcl: rename AnimationData fields to more sane namesChris Sherlock
Change-Id: I5b3ae32b562f300fb33ba8daf5ef438268725a3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76431 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-10vcl: AnimationRenderer::getOutPos() -> GetOriginPosition()Chris Sherlock
Change-Id: I23275aa9915ea47cb91a8511b219869a4d62b96a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137352 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-28vcl: Animation - cleanup pause functions and fieldsChris Sherlock
Change-Id: I8a338a92823bd4e4c1f8123d52711d0925357ee6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76430 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-19vcl: AInfo -> AnimationDataChris Sherlock
Change-Id: I4a4f8e2e346010edd1fde004eb9f14b67fc8487a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76407 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-11vcl: change drawToPos() to drawToIndex()Chris Sherlock
Change-Id: Iaf102e529cdfd3d758e4e6976f6a99330d8fc64b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76405 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-06-30vcl: clarify variable in Animation::Animation() loopChris Sherlock
Change-Id: Ia7e211298896c40b92cf13c81302d30ddb661cb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76404 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-06-21vcl: rename mnExtraData to mnRendererIdChris Sherlock
The name "extra data" doesn't really describe what this field does. What it actually does it to specify what animation renderer should be used. Change-Id: I1e705ba89d09ceb41a8649c8947225c7b6816e7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76403 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-06-21vcl: rename ImplAnimView to AnimationRendererChris Sherlock
An ImplAnimView is actually just a way of rendering an animation to an OutputDevice (RenderContext). Each instance has a unique ID (called mnExraData, which is quite misleading). ImplAnimView doesn't really mean much so hence the rename to make this a bit more clear. In the process, also rename local variables pView to pRenderer in Animation functions. Change-Id: Ib70f41052c5266acd7f2460001ce5be75b74d5a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76402 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-06-15vcl: change maList in Animation to maFramesChris Sherlock
Change-Id: I2358434ffa3aff8bda16576bf8849eed52a3edd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76401 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-12-24Recheck include/[s-x]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: Iaebddd648c52c175da17d2a55a1e8de82c213f4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127330 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-11-24Rename o3tl::underlyingEnumValue to o3tl::to_underlying to match C++23Mike Kaganski
Change-Id: I1597a8e77199445bf377dbe54adc3134bb04fd51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125748 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-28gives names to all the Idles and TasksNoel Grandin
enforce it by making the constructor parameter non-default. Change-Id: I321543e4dcf15ea0a43ad8cce91d2f8dc22df6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122766 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-19ImplPlayWithRenderer never checks its OutputDevice against nullptrCaolán McNamara
just pass a reference instead and spread that around to some similar cases Change-Id: Ifb2dee8c7bf02a9f01982b928c90666cbbdd84fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115759 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-27use more string_view in tools/streamNoel Grandin
Change-Id: I2a957cd72d71fea717734488cdb3670e0bcdd6f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-26drop mask from BitmapExNoel Grandin
So that we have fewer cases to deal with when we transition to 32-bit bitmaps. (*) rename maMask to maAlphaMask, since now it is only being used for alpha duties. (*) drop mbAlpha and mbTransparent to simplify state management, the only thing we need to check for alpha is if maAlphaMask is non-empty. Change-Id: I06252e38e950e846a94b4c2ba8ea763be17801fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111679 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-28drop operator bool and operator! from Bitmap and BitmapExNoel
IRC chat: <quikee[m]> noelgrandin: doesn't adding operator bool to Bitmap has the same problem as Graphic and the reason why you dropped that commit 7334034ae93b49fc93b5859a3c047a319d138282 "drop Graphic::operator bool" <noelgrandin> quikee[m], hmmm, good point <noelgrandin> maybe I should just drop both operator bool and operator! in favor of IsEmpty <quikee[m]> noelgrandin: I don't remember what the problem is I just remembered we dropped it Graphic :) sure, dropping everything for IsEmpty is probably the best Change-Id: Ieae289cda64f0b8d8fdecd5ea9e6f2bb874ff4cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113163 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-19use tools::Long in vclNoel
Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-06loplugin:const* make some params and methods constNoel
Change-Id: If7fbb25037343e18081a8ee7064840d75e9a45a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104010 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-04loplugin:flatten in vclNoel Grandin
Change-Id: I271cc67ecf34acbf0edbda960e33315fb6a1f9dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100041 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-22rework of painting and removal of ImplAnimView using the STLAdrien Ollier
Change-Id: I9bcfd3e034097c0a3ba17a566201d708cec2b016 Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87167 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-01-21rework ImplAnimView cleanup using STL algorithmsAdrien Ollier
Change-Id: Ie8c857f992d27bb0d70968256eea5d8f2491405e Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87030 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-01-20rewrite of Animation::Start using the STLAdrien Ollier
Change-Id: Ieca520db4e3ea754dd8574809e366db11c451c2d Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87031 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-09-29Move Rectangle,Point,Size serialization to GenericTypeSerializerTomaž Vajngerl
Change-Id: Iae489fc31b13b836e1df5327ba2fa07e0325907a Reviewed-on: https://gerrit.libreoffice.org/79793 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-07-02tdf#42949 Fix IWYU warnings in vcl/source/[a-e]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I386e913f9002eed164c26137a0e184993d010b86 Reviewed-on: https://gerrit.libreoffice.org/74090 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-09replaces one macro by a constant in the C++ styleAdrien Ollier
Change-Id: I4b4fc85024d64f94197bd0fd25ed8ba0ada004ba Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/71807 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-05-07inverts the tests for performance optimizationAdrien Ollier
Change-Id: Ib65ec7fd957ab19c703d31da9eb74390126d2d04 Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/71881 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-05-05using an algorithm of the STLAdrien Ollier
makes the function shorter Change-Id: I22118d9b86e5497cb9b566efe9151f2da646cb16 Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/71806 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-05using STL and lambda expressions is betterAdrien Ollier
Change-Id: I0224dccb130ead02da46f2376b3df5ec889f8e8c Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/71812 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-03rewritting in a more conventional wayAdrien Ollier
- mnPos is modified only if mbLoopTerminated is true - using new and delete operators is less efficient than building an object on the stack - skipping a line makes instructions clearer Change-Id: I9bec0cf02a581c1e0033880fcad83f17e83ea3f2 Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/71652 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-05-03makes implementation of Animation::operator =(const Animation&) conciseAdrien Ollier
Using the logical AND, we can evaluate all the expressions from left to right into a single and condensed expression. Change-Id: I973061dcd34322c29565a478bf9b7ba757965231 Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/71651 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-28prefix member variables of AnimationBitmapTomaž Vajngerl
Change-Id: Ic84773399c95d61f843e4388fe01d00cd4facc5a Reviewed-on: https://gerrit.libreoffice.org/71425 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-28move Animation, AnimationBitmap out from clang-format blacklistTomaž Vajngerl
Change-Id: I95fd2d4e164bf04c4457b3e20401270227e21a8f Reviewed-on: https://gerrit.libreoffice.org/71424 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-28Separate AnimationBitmap from Animation.{hxx,cxx} sourceTomaž Vajngerl
Change-Id: I982a108b2241c049b595a13d6f39d24ef0266074 Reviewed-on: https://gerrit.libreoffice.org/71423 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-28rename animate.hxx to animate/Animation.hxx, more changes followTomaž Vajngerl
This is the first step of refactoring Animation where it is needed to separate AnimationBitmap(s) from the Animation class, which is also responsible for displaying of animation. General idea is to make Graphic work only with AnimationBitmaps, which can be freely be swapped out and in, make copies - all transparantly from the actually displaying them and possibly it will also remove the need to copy the animation objects. Change-Id: If5d55ac1a5b26c3880d4f7602be57742b086f9da Reviewed-on: https://gerrit.libreoffice.org/71406 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>