History log of /haiku/src/libs/icon/transformer/PathTransformer.h
Revision Date Author Comments
# 0822ec27 17-Oct-2023 PulkoMandy <pulkomandy@pulkomandy.tk>

libicon: Fix dangling references to VertexSource in PathTransformer

PathTransformer keeps a reference to the VertexSource used (which can be
either another PathTransformer, or the base path for a shape). When a
shape is cloned, this should be retargetted to the new object in the
clone.

However, references are not settable, and so, what would happen instead
is the original (non-cloned) vertex source was reinitialized (through
the default implementation of the assignment operator) using data from
the clone, and the clone would still point to it. Then, if the original
object is deleted, the clone would point to freed memory.

To avoid this problem, replace the reference with a pointer (which can
be set to point elsewhere, as the code intended to do). To make sure
this does not happen again, make the VertexSource copy constructor and
assignment operator private, and deleted when the compiler supports
that.

Fixes #18577

Change-Id: I8870d9471c5064e922a84eff8447cbda783b13e6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7052
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Zardshard <0azrune6@zard.anonaddy.com>


# c6c2c042 08-Aug-2023 Zardshard <0azrune6@zard.anonaddy.com>

Icon-O-Matic: Add perspective transformations

As part of adding perspective transformations, agg_trans_perspective.h
was patched to fix a multiple definitions error. This change has been
submitted for review to the "upstream" repositories at [1], [2],
and [3].

Also includes various other improvements such as VertexSource being
split into its own file, code style improvements, and documentation
improvements.

[1] https://sourceforge.net/p/agg/patches/6/
[2] https://github.com/ghaerr/agg-2.6/pull/9
[3] https://github.com/aggeom/agg-2.6/pull/7

Change-Id: I4bffd2f87354bde10155e23145a232a925be6ff3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6801
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>