Age | Commit message (Collapse) | Author |
|
Ref T92709
|
|
Allow the use of floating-point values for font point sizes, which
allows greater precision and flexibility for text output.
See D8960 for more information, details, and justification.
Differential Revision: https://developer.blender.org/D8960
Reviewed by Campbell Barton
|
|
- Use doxy formatted functions.
- Use doxy sections.
|
|
Cleanup and Simplification of blf_glyph.c
See D13095 for details.
Differential Revision: https://developer.blender.org/D13095
Reviewed by Campbell Barton
|
|
This patch removes the need to lock the thread just to get to some
generic (not glyph-specific) font metrics.
See D12976 for more details.
Differential Revision: https://developer.blender.org/D12976
Reviewed by Campbell Barton
|
|
|
|
Simplification of BLF glyph loading
See D13026 for details.
Differential Revision: https://developer.blender.org/D13026
Reviewed by Campbell Barton
|
|
Optimization of font kerning by only caching kerning values after a
pair is encountered. Also saves unscaled values so they don't have to
be rebuilt between font size changes.
See D12274 for more details and speed comparison.
Differential Revision: https://developer.blender.org/D12274
Reviewed by Campbell Barton
|
|
Simplification of BLF code after removal of kerning modes.
See D12262 for more details.
Differential Revision: https://developer.blender.org/D12262
Reviewed by Campbell Barton
|
|
blf_kerning_cache_new was performing many unnecessary hash lookups,
calling blf_glyph_search 32768 times. Use a lookup table to reduce this
to the number of ASCII characters (128 calls).
|
|
It wasn't obvious this was only for ASCII characters.
|
|
This patch makes some non-functional changes to BLF code. Some size
defines added, comments changed, simplification of macro
BLF_KERNING_VARS.
See D12200 for more details.
Differential Revision: https://developer.blender.org/D12200
Reviewed by Campbell Barton
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
Apparently `textureSize` doesn't work with
`sampler1DArray` on this OS.
Thanks to @dave1853 for finding the source of the
problem.
|
|
|
|
This makes more sense as this module has more to it than just
GL extensions.
|
|
This is to modernize the API:
- Add meaningful name to all textures (except DRW textures).
- Remove unused err_out argument: only used for offscreen python.
- Add mipmap count to creation functions for future changes.
- Clarify the data usage in creation functions.
This is a cleanup commit, there is no functional change.
# Conflicts:
# source/blender/gpu/GPU_texture.h
|
|
Use creation + update function instead.
|
|
Quiet warning/error about int and float multiplication.
Differential Revision: https://developer.blender.org/D7893
Reviewed by Ray Molenkamp
|
|
Adds the ability to print text in bold or italics style, synthesized from a single base UI font.
Differential Revision: https://developer.blender.org/D7893
Reviewed by Brecht Van Lommel
|
|
|
|
These were stored as float but were originally cast from an int
and were often cast back to int.
Also use int pairs for dimensions values.
|
|
|
|
- Move gpuPush/Pop from GPU_draw.h into GPU_state.h
as this is for pushing/popping state.
- Add 'GPU_STANDALONE' define, to bypass use of user-preferences
for theme colors and pixelsize, as well as pbvh init/free functions.
Needed to get GHOST tests working again.
|
|
The glyph can come from a different cache.
|
|
The current code allocates and transfers a lot of memory to the GPU,
but only a small portion of this memory is actually used.
In addition, the code calls many costly gl operations during the
caching process.
This commit significantly reduce the amount of memory by allocating
and transferring a flat array without pads to the GPU.
It also calls as little as possible the gl operations during the cache.
This code also simulate a billinear filter `GL_LINEAR` using a 1D texture.
**Average drawing time:**
|before:|0.00003184 sec
|now:|0.00001943 sec
|fac:|1.6385156675048407
**5 worst times:**
|before:|[0.001075, 0.001433, 0.002143, 0.002915, 0.003242]
|now:|[0.00094, 0.000993, 0.001502, 0.002284, 0.002328]
Differential Revision: https://developer.blender.org/D6886
|
|
Two main reasons for the lag:
- Allocation of memory with transfer to GPU.
- BLF_cache_clear();
The (partial) solution is to avoid memory allocating in some setups
through the `GPU_texture_clear`.
Differential Revision: https://developer.blender.org/D6837
|
|
This reverts commit a21f5ec56245f7f1fbede4aa3c140a582c3a6a1b.
|
|
Two main reasons for the lag:
- Allocation of memory with transfer to GPU.
- BLF_cache_clear();
The memory allocation seems to be unnecessary, so I removed it.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D6837
|
|
Functions that utilize glyph cache should lock and unlock cache by
calling `blf_glyph_cache_acquire()` and `blf_glyph_cache_release()`.
Function `blf_glyph_cache_acquire()` will create glyph cache, if it doesn't exist.
Locking mutex is global and shared by all fonts.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5701
|
|
Some statements were split across multiple lines because of their
trailing comments.
In most cases it's clearer to put the comments above.
|
|
We were missing a null pointer check for invalid fonts.
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
We do not support special color fonts (like colored emoji fonts), so
don't crash when trying to create a preview for unsupported fonts.
Reviewed By: Brecht
Differential Revision: http://developer.blender.org/D4590
|
|
Reviewers: billreynish, brecht
Differential Revision: https://developer.blender.org/D4550
|
|
There are two issues at play here.
First, BLF_width computed a width that was not wide
enough to actually hold the text.
Second, blf_glyph_calc_rect_test computed an incorrect
rect->xmax when the glyph was moved to the left a bit.
We ignore the overlap on the left, but the right side
should still be adjusted accordingly.
|
|
The main problem was that the character `J` has "negative kerning".
It was cut off because it started outside of the clipping rectangle.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D4513
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
|
|
Needed for clang formatting to workaround bug/limit, see: T53211
|
|
Also contains some code typo fixes (mostly, adtaptative -> adaptive,
former is nearly innexistant in English, let's stick to simple valid
words ;) ).
|
|
|
|
This changes the text hinting setting to be an enum with options
Auto / None / Slight / Full. The default is Auto which currently disables
hinting.
The hinting was tested with a new FreeType version, but this is not what
is used on the buildbots an official release environment, and the fonts
look quite bad because of that. Once FreeType has been upgraded we can
change the default.
Even then the results are not ideal, perhaps due to missing subpixel
positioning and linear color blending support in BLF.
|
|
|
|
Now disabling anti-aliasing doesn't impact sequencer, render stamp etc.
|
|
GPU_LINEAR is there for shadow font blurring, the real issue was lack of
rounding for the batch offset.
|
|
Barely any visible difference, except when drawing big custom text
with the Python API.
|