Page MenuHome

Fix T87337: Text strip draws white outline
ClosedPublic

Authored by Richard Antalik (ISS) on Apr 21 2021, 7:28 AM.

Details

Summary

Math for drawing font over byte buffer was incorrect. Effect can be seen
when target buffer is fully black and transparent - this results in font
color being effectively premultiplied, which causes problems when image
is composited further.

Use blend_color_mix_byte() and blend_color_mix_float() for blending.

Diff Detail

Repository
rB Blender
Branch
T87337 (branched from master)
Build Status
Buildable 14138
Build 14138: arc lint + arc unit

Event Timeline

Richard Antalik (ISS) requested review of this revision.Apr 21 2021, 7:28 AM
Richard Antalik (ISS) created this revision.

Is always nice to use utility function instead of inlining the math!

source/blender/blenfont/intern/blf_font.c
679

I would use unit_float_to_uchar_clamp() here to make sure no integer overflow happens.

This revision is now accepted and ready to land.Apr 21 2021, 11:42 AM
Richard Antalik (ISS) marked an inline comment as done.
  • Use unit_float_to_uchar_clamp to prevent overflow.

The patch is accepted btw ;)

This revision was automatically updated to reflect the committed changes.