Commit Graph

10 Commits

Author SHA1 Message Date
Aras Pranckevicius a705259b4b Cleanup: move imbuf .h files to .hh 2024-01-19 20:29:38 +01:00
Campbell Barton f957a6da22 Cleanup: compiler warnings (unused functions & variable) 2023-07-15 15:45:03 +10:00
Hans Goudey 087612c042 Cleanup: Reduce use and scope of templates in vertex paint
Many high-level functions with unrelated code were templated based on
the color attribute domain and type. In the end, those were just a few
branches though, similar to other branches. So to reduce binary bloat
and clarify code, move tempates to the point where separate types are
actually needed. Also move constant code out of loops, and use generic
arrays and spans to store some caches. The binary ended up 53 KB
smaller for me, which isn't much but it's in the right direction.

Performance wise nothing really changes. The vast majority of time in
vertex paint is spent on unrelated things like calculating normals or
uploading GPU buffers anyway.

The one ugly part I didn't account for when I started is the casting
between the "ColorGeometry" and "ColorPaint" types. I'm not sure that
this is correct, but it's just a more explicit version of what was
there already.

Pull Request: https://projects.blender.org/blender/blender/pulls/109941
2023-07-11 15:52:28 +02:00
Sergey Sharybin c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00
Evan Wilson 72505da862 Fix T102216: Change `min_ff` to `max_ff` in the return of `BlendType max`
BlendType max incorrectly returns the minimum in BLI_color_mix.hh
This differential fixes it to return the maximum.

Maniphest Tasks: T102216

Ref D16364
2022-11-04 19:18:54 +11:00
Bastien Montagne c6e3242e18 Cleanup: Use `switch` and `BLI_assert_unreachable()` more.
Replace some `if/else if` chains by proper `switch` statement.

Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-17 16:06:54 +02:00
Campbell Barton bba757ef81 Cleanup: various minor changes
- Add missing doxy-section for Apply Parent Inverse Operator
- Use identity for None comparison in Python.
- Remove newline from operator doc-strings.
- Use '*' prefix multi-line C comment blocks.
- Separate filenames from doc-strings.
- Remove break after return.
2022-04-24 13:41:03 +10:00
Campbell Barton 2547c3c70c Cleanup: spelling in comments 2022-04-22 10:11:48 +10:00
Jacques Lucke 7a943428de Cleanup: fix various warnings after recent commit 2022-04-21 09:36:39 +02:00
Joseph Eagar 575ade22d4 Commit D14179: Revamp Vertex Paint With C++
- Verrtex paint mode has been refactored into C++ templates.
  It now works with both byte and float colors and point
  & corner attribute domains.
- There is a new API for mixing colors (also based
  on C++ templates).  Unlike the existing APIs byte
  and float colors are interpolated identically.
  Interpolation does happen in a squared rgb space,
  this may be changed in the future.
- Vertex paint now uses the sculpt undo system.

Reviewed By: Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D14179
Ref D14179
2022-04-20 22:14:03 -07:00