VSE: speedup timeline drawing, and improve waveform display #115311

Merged
Aras Pranckevicius merged 17 commits from aras_p/blender:vse-draw-opt into main 2023-11-29 20:25:30 +01:00
1 changed files with 13 additions and 0 deletions
Showing only changes of commit 5f4c5c7369 - Show all commits

View File

@ -15,16 +15,27 @@ struct GPUIndexBuf;
struct GPUBatch;
struct ColorVertex;
/**
* Flat-colored 2D geometry draw batching utility.
*
* Internally uses #GPU_SHADER_3D_FLAT_COLOR to draw single-colored rectangles, quads
* or lines. After adding a number of primitives with #add_quad, #add_wire_quad, #add_line,
* draw them using #draw. Note that #draw can be called behind the scenes if number of primitives
* is larger than the internal batch buffer size.
*/
class SeqQuadsBatch {
public:
SeqQuadsBatch();
~SeqQuadsBatch();
/** Draw all the previously added primitives. */
void draw();
/** Add an axis-aligned quad. */
void add_quad(float x1, float y1, float x2, float y2, const uchar color[4])
{
add_quad(x1, y1, x1, y2, x2, y1, x2, y2, color);
}
/** Add a quad. */
void add_quad(float x1,
float y1,
float x2,
@ -34,7 +45,9 @@ class SeqQuadsBatch {
float x4,
float y4,
const uchar color[4]);
/** Add four lines of an axis-aligned quad edges. */
void add_wire_quad(float x1, float y1, float x2, float y2, const uchar color[4]);
/** Add a line. */
void add_line(float x1, float y1, float x2, float y2, const uchar color[4]);
private: