diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-06-03 13:58:40 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-06-10 14:42:57 +0100 |
commit | 702b58945b51e738cdcc3d383ca38881f9f1338d (patch) | |
tree | 9c1958b8c44ee5bbc7803765e498d2208b906556 /drawinglayer/source/primitive2d/animatedprimitive2d.cxx | |
parent | b523e20a8fb8c9c26e7ffdc1b3f5fd06c440985c (diff) |
tdf#99519 Added more intelligent handling of animated GIFs
Isolated to a single Primitive2D class based on the AnimatedSwitch-
Primitive2D which does the specializing in one place. Buffers small
GIFs completely, handles 1st frame always buffered, huge GIFs get
animated by just playing he next frame.
To reach more with the current approach we would have to re-implement
AnimatedGIF import, replay it internally on a sys-specific Surface
and blit the current content (with alpha) to our display
Reviewed-on: https://gerrit.libreoffice.org/26103
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 285744fef87f4ca0278834b97d7f618bdba5f4c0)
Change-Id: I46c3325fa7936df73bea9a9284a0421f1475a34b
Diffstat (limited to 'drawinglayer/source/primitive2d/animatedprimitive2d.cxx')
-rw-r--r-- | drawinglayer/source/primitive2d/animatedprimitive2d.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx index 03712fbee3d0..d832a43581b6 100644 --- a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx @@ -31,6 +31,15 @@ namespace drawinglayer { namespace primitive2d { + void AnimatedSwitchPrimitive2D::setAnimationEntry(const animation::AnimationEntry& rNew) + { + // delete cloned animation description + delete mpAnimationEntry; + + // clone given animation description + mpAnimationEntry = rNew.clone(); + } + AnimatedSwitchPrimitive2D::AnimatedSwitchPrimitive2D( const animation::AnimationEntry& rAnimationEntry, const Primitive2DContainer& rChildren, |