[GSOC] Removing avmedia dependency in drawinglayer
Thorsten Behrens
thb at documentfoundation.org
Wed Jun 27 03:28:27 PDT 2012
Rafael Dominguez wrote:
> > Oops my bad, heres the patch attached
>
Hi Rafael,
nice improvement - two nits though:
> @@ -65,6 +67,8 @@ namespace drawinglayer
> /// discrete border (in 'pixels')
> sal_uInt32 mnDiscreteBorder;
>
> + const Graphic *mpSnapshot;
> +
>
Parent classes of MediaPrimitive2D derive from boost::noncopyable -
that means you don't have to worry about having to modify mpSnapshot,
which in turn means it could be const Graphic& instead.
But it's even easier, since Graphic has copy-on-write behaviour -
you can simply hold a Graphic by value in your primitive, it only
contains a cheap ptr to an impl class, that gets, if necessary,
copied & duplicated if you modify one of the many shared copies.
(many bulky objects in LibO have that behaviour, including bitmaps,
polygons, and metafiles (sorta))
Cheers,
-- Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120627/6742424a/attachment.pgp>
More information about the LibreOffice
mailing list