]> git.lyx.org Git - features.git/commit
Allow multiple calls to processUpdateFlags before redraw
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 11 Oct 2017 16:00:48 +0000 (18:00 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 15 Feb 2018 11:29:25 +0000 (12:29 +0100)
commit4ecbff00192fb097432bc2d0604c6c8d97aa883a
treecac3f901aca983df2c756f677d727690c3867c37
parent2b1b33189dc4113d2744cb9a68e691fbca4b884a
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.

(cherry picked from commit 8d8988de475bf2055f253823e53fd5627be5de78)
development/PAINTING_ANALYSIS
src/BufferView.cpp
src/BufferView.h
src/TextMetrics.cpp
src/update_flags.h