Commit Graph

25 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
a23522073c Update PAINTING_ANALYSIS 2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
9c49e72f7e Small updates to painting analysis document 2023-09-10 20:24:39 +02:00
Jean-Marc Lasgouttes
2f8ea7ba05 One less thing to do in PAINTING_ANALYSIS 2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
9bdc0dab31 Honor Update::SinglePar properly
The SinglePar update flags has been a no-op for a long time without
naybody noticing. This means that the current paragraph was
always rebroken and redrawn, even when only moving the cursor around.

Now we only do that when Update::SinglePar has been specified. This
means that there may be cases where update will not be correct
anymore, because this flag has not been specified. These places will
have to be found and fixed.

Update PAINTING_ANALYSIS.
2019-02-20 14:41:22 +01:00
Jean-Marc Lasgouttes
9e2da4a3ea Remove row crc computation
This computation did not make sense anymore since we began to put the
contents in the Row object. The fact that it worked was a coincidence.

Instead, we set rows as changed() on creation and reset that once they
have been drawn. This will allow in the future for a finer definition
of what to redraw or not.

Also update the PAINTING_ANALYSIS document
2017-11-11 13:24:08 +01:00
Jean-Marc Lasgouttes
8d8988de47 Allow multiple calls to processUpdateFlags before redraw
The goal of this commit is to ensure that a processUpdateFlags call
that requires no redraw will not override a previous one that did
require a redraw.

To this end, the semantics of the flag argument is now different: its
value is now OR'ed with a private update_flags_ variable. This
variable is only reset after the buffer view has actually been
redrawn.

A new Update::ForceRedraw flag has been added. It requires a full
redraw but no metrics computation. It is not used in the main code
(yet), but avoids to compute metrics repeatedly in consecutive
processUpdateFlags calls.

The process is now as follows:
- if flags is just None, return immediately, there is nothing to do.
- the Force flag is honored (full metrics computation) and replaced
  with ForceDraw.
- the FitCursor flag is honored and removed from the flags.
- the SinglePar update is added if ForceDraw is not in flags and only
  the current par has been modified.

The remaining flags are only then added to the BufferView update
flags, and the update strategy is computed for the next paint event.

Finally the dubious call to updateMacros in updateMetrics has been
removed for performance reasons.
2017-10-24 22:25:29 +02:00
Jean-Marc Lasgouttes
b4294a7b06 Revert "Allow multiple calls to processUpdateFlags before redraw"
The concept is correct, but it seems a bit too disruptive.

This reverts commit c19c54dd5b.
2017-10-17 20:10:11 +02:00
Jean-Marc Lasgouttes
c19c54dd5b Allow multiple calls to processUpdateFlags before redraw
The goal of this commit is to ensure that a processUpdateFlags call
that requires no redraw will not override a previous one that did
require a redraw.

To this end, the semantics of the flag argument is now different: its
value is now OR'ed with a private update_flags_ variable. This
variable is only reset after the buffer view has actually been
redrawn.

A new Update::ForceRedraw flag has been added. It requires a full
redraw but no metrics computation. It is not used in the main code
(yet), but avoids to compute metrics repeatedly in consecutive
processUpdateFlags calls.

Finally the dubious call to updateMacros in updateMetrics has been
removed for performance reasons.
2017-10-16 11:05:52 +02:00
Jean-Marc Lasgouttes
fb655725b7 Remove workaround that is not necessary anymore.
This code was necessary to handle cases where the insets positions
were not yet in cache. This cannot happen anymore thanks to the
nodraw stage.
2017-09-08 16:57:21 +02:00
Jean-Marc Lasgouttes
8edadee145 Update the painting process documentation 2017-09-08 16:57:21 +02:00
Jean-Marc Lasgouttes
57c3a94730 Add RtL information to Row
This allows to somewhat simplify the text and avoid some uses of
Paragraph (in the long term, RowPainter should not have to access
these things).

At the same time do a small cleanup to RowPainter: rename
text_metrics_ to tm_, remove pm_ and width_.
2017-02-02 14:53:01 +01:00
Jean-Marc Lasgouttes
b9c5d6ff4d One item less on todo list 2016-10-25 10:14:35 +02:00
Jean-Marc Lasgouttes
47c0b3cc05 Update PAINTING_ANALYSIS
Remove all the tasks that have been performed.
2016-05-30 14:55:41 +02:00
Jean-Marc Lasgouttes
0311718215 Split TextMetrics::setRowHeight in three parts
The new functions parBottomSpaging and parTopSapcing return below/above each paragraph.

This allows to remove the TopBottomSpace argument and makes the code a
bit clearer.
2016-05-30 14:55:41 +02:00
Jean-Marc Lasgouttes
e39e4cf96b Do not require an extra pit parameter when a row is available
Now that Row has a pit() member, it is possible to use it instead of passing an extra pit_type parameter to a function which already has access to a Row.
2016-05-30 14:55:41 +02:00
Jean-Marc Lasgouttes
4c19c5149d RowPainter const cleanup
Change the various paint* helpers to take a single row element as argument.

Do not update x_ in the various paint* helpers. Constify them. Update x_ in paintText and paintOnlyInsets instead.

Remove an empty call to paintForeignMark in paintInset (the call did nothing since orig_x == x_ at this point).
2016-05-30 14:55:41 +02:00
Jean-Marc Lasgouttes
095c390fe2 Update PAINTING_ANALYSIS and add a new task 2016-05-30 14:55:41 +02:00
Jean-Marc Lasgouttes
656b7f5ab7 Set vertical margins in redoParagraph, not setRowHeight
It is actually easier to set the 20 pixels margin in redoParagraph, since it is not necessary to take newlines in account when deciding what is the real last row of the paragraph.

Moreover this solves the following bug (present in 2.1.x too): when the document ends with a newling, the bottom margin disappears.

Update PAINTING_ANALYSIS with new tasks.
2016-05-30 14:55:41 +02:00
Jean-Marc Lasgouttes
598f7e4a45 Cleanup Painter text() API
* remove optional arguments to the helpers that use a FontInfo
* add a textwidth argument to the text() methods that are used by rowpainter.

Now textwidth is only computed if a null value was passed to the
text() method. This means that in the use case of rowpainter, no
textwidth needs to be computed.
2016-05-30 14:55:41 +02:00
Jean-Marc Lasgouttes
78eaf8333b Update PAINTING_ANALYSIS
Some things were wrong, and some new ideas are added (some are done in
this branch already).
2016-05-30 14:55:41 +02:00
Jean-Marc Lasgouttes
26eb5092fb Get rid of ParagraphMetrics::insetDimension
We already have a CoordCache of insets dimensions. It is not necessary
to store the same information in two places.

Give a name to CoordCache tables types to improve code readability.

Remove ParagraphMetrics::singleWidth, which is not used anymore.
2015-10-19 13:17:16 +02:00
Jean-Marc Lasgouttes
d377e765a2 More updates to painting analysis 2015-10-04 22:28:36 +02:00
Jean-Marc Lasgouttes
c4da9b9e37 Update file from Abdel's comments and some of my own thinking 2015-10-04 00:03:46 +02:00
Jean-Marc Lasgouttes
7ef19902ea Small typos in PAINTING_ANALYSIS 2015-10-03 23:49:05 +02:00
Jean-Marc Lasgouttes
86d42bc5eb Add a file that describe the current state of painting
This is a work in progress intended to start collective work towards improving the performance of our painting process.

The intent is to make it a living document that is updated as code evolves.
2015-10-02 15:30:16 +02:00