Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(260)

Issue 555610043: Use composition for embedding PangoMatrix in Transform (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years ago by hanwenn
Modified:
4 years ago
Reviewers:
dak, hahnjo
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Use composition for embedding PangoMatrix in Transform PangoMatrix is a struct, so there is no value in using inheritance. Use composition instead, so we don't have to use multiple inheritance.

Patch Set 1 #

Total comments: 1

Patch Set 2 : jonas #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -37 lines) Patch
M lily/include/transform.hh View 2 chunks +27 lines, -25 lines 0 comments Download
M lily/transform.cc View 2 chunks +12 lines, -12 lines 0 comments Download

Messages

Total messages: 3
hahnjo
https://codereview.appspot.com/555610043/diff/557670044/lily/stencil-integral.cc File lily/stencil-integral.cc (right): https://codereview.appspot.com/555610043/diff/557670044/lily/stencil-integral.cc#newcode471 lily/stencil-integral.cc:471: unrelated change
4 years ago (2020-04-13 16:16:17 UTC) #1
hanwenn
jonas
4 years ago (2020-04-13 16:19:23 UTC) #2
dak
4 years ago (2020-04-13 17:25:23 UTC) #3
"PangoMatrix is a struct, so there is no value in using inheritance" is a
non-sequitur.  A struct just is a class with public members.

The motivation for choosing inheritance here was that this allows passing
Transform directly into Pango for operations.  This advantage is not realised in
our current code base, and doing so does not appear like the best long-term plan
since a good long-term plan would likely rather involve using the transform
matrices of Cairo since it would make a lot more sense to route the bulk of
graphics operations through Cairo than maintaining our own limited and
maintenance-intensive set of backends and/or relying on Ghostscript as
comparatively computationally expensive intermediary.

So while I don't see any objective of value achieved here (the objective of not
using multiple inheritance went out the window long ago since it is needed, for
example, for determining initialisation order for GC-marked objects), I don't
see anything adversely impacted, either.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b