Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
D4236 by @sobakasu w/ edits.
|
|
Part of D4236 by @sobakasu
|
|
|
|
Allows users to select a font for text strips in the video sequence editor.
Related: 3610f1fc43d0 Sequencer: refactor clipboard copy to no longer increase user count.
Reviewed by: Brecht
Differential Revision: https://developer.blender.org/D3621
|
|
Needed for clang formatting to workaround bug/limit, see: T53211
|
|
Also (mostly in comments): behaviour -> behavior (we use American English).
|
|
Also contains some code typo fixes (mostly, adtaptative -> adaptive,
former is nearly innexistant in English, let's stick to simple valid
words ;) ).
|
|
Reviewers: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D3802
|
|
`to_strlen` just benefits from using pre-computed kerning table for
ascii chars (gives about 30% speed improvements).
`to_rstrlen` was re-written and heavily simplified, basically using same
logic as `to_strlen`, and `BLI_str_find_prev_char_utf8()` to loop
backward in the string, instead of looping forwards the whole string,
storing each gliph's width in temp array, and looping backward on that
temp array to find final string matching expected width. Gives about 70%
speed improvements!
And both functions can now share their core logic.
|
|
|
|
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.
|
|
|
|
This does not include all the struct and type renaming. Only files were
renamed.
gwn_batch.c/h was fusioned with GPU_batch.c/h
gwn_immediate.c/h was fusioned with GPU_immediate.c/h
gwn_imm_util.c/h was fusioned with GPU_immediate_util.c/h
|
|
Thanks to @sergey for review
|
|
- Texture creation now requires explicit data type.
- GPU_texture_add_mipmap enable explicit mipmap upload.
- GPU_texture_get_mipmap_size can be used to get the size of a mipmap level
of an existing GPUTexture
- GPU_texture_read let you read back data from a gpu texture.
|
|
|
|
BLF' blf_font_width_to_strlen() could easily generate strings with up to
nearly two pixels length over requested limit!
Note that the fiddling between floats and ints values make things really
confusing here... :/
There is still a few limit cases where, even though computed str length
is now always below reauested limit, we still get first letter
disappearing, no idea why currently.
|
|
Caused some gpus to have issues with the font shadows.
thanks @fclem for helping tracking this one down.
|
|
|
|
and types.
In an effort to centralize all opengl calls in the codebase, this patch replaces
the raw opengl calls in bf_blenfont with GPUTexture so it's no longer depended
on opengl headers.
reviewer: Brecht
Differential Revision: https://developer.blender.org/D3483
|
|
|
|
Remove from blender/nodes, collada, blenfont & render.
|
|
|
|
Strip unindented comment blocks - mainly headers to avoid conflicts.
|
|
Fix T54838 : Text display glitch w/ fonts at different sizes.
This was cause by the cache not being flushed when changing font texture.
|
|
|
|
|
|
This could have caused overflow issue.
|
|
This was due to uninitialized texture space.
|
|
|
|
|
|
Previous code was assuming that the glyph texture would remain bound to
GL_TEXTURE0 until the cache would be drawn. This is not always the case,
so better save the texture and rebind it before drawing.
|
|
Reduce the number of sampled required for blurring by using filtered
texture samples.
This changes the result a bit but it is not noticable.
|
|
This port the Blurring of blf fonts to the final drawing shader.
We add a bit of extra padding to each glyph so that jittering the texture
coord does not sample the neighbor glyphs.
|
|
Flush the text cache so that we have proper scissor test and ordering.
|
|
Overall 10% more performance on general UI drawing time.
This commit can introduce ordering problem on some elements.
In this case you need to flush the widget cache to ensure the element that
is going to be drawn is drawn on top of any widget base.
To flush the cache use UI_widgetbase_draw_cache_flush.
This is already done for BLF and Icons.
|
|
- Undo that changes modes currently asserts,
since undo is now screen data.
Most likely we will change how object mode and workspaces work
since it's not practical/maintainable at the moment.
- Removed view_layer from particle settings
(wasn't needed and complicated undo).
|
|
"this is not the commit you're looking for"
|
|
This was breaking the first drawcall after a simple/non-simple shader
switch.
|
|
Using FT_Set_Char_Size is slow. Calling it only when needed is more clever.
|
|
This adds less than a megabyte of mem usage.
FT_Get_Kerning was the 2nd hotspot when profilling. This commit completly
remove this cost.
One concern though: I don't know if the kerning data is constant for every
sizes but it seems to be the case. I tested different fonts at different
dpi scalling and saw no differences.
|
|
- use x/y/width/height/max as a suffix.
- replace 'num' prefix /w 'len' suffix.
|