diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-15 18:37:05 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-15 18:37:05 +0400 |
commit | e1229b2978c37a043f3932657ac5cfa156093866 (patch) | |
tree | 9b11c52390302485cf1b5be799d693e4fce03f22 /source/blender/editors/sculpt_paint/paint_intern.h | |
parent | 71775dc2a49d8ec20d31544f2fccf69729a8cd39 (diff) |
Attempt to fix #35057 and #35372: slow texture painting performance.
After the paint refactoring for 2.67, the OpenGL texture was getting updated for
every stroke point, rather than once for every redraw. With a small brush radius
and low spacing the number of stroke points can be quite large, which might have
a big performance impact depending on the graphics card / drivers.
Also for 2D image paint, avoid redrawing the button panels and properties editor
during painting.
There is another possible cause for slowdowns with 3D texture painting which was
not fixed. Projection painting is creating and destroying threads for every stroke
point. Depending on the CPU/OS there might be a lot of overhead in doing that if
the brush size is small.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_intern.h')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_intern.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index a4230439737..81c33338b5c 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -60,11 +60,13 @@ enum PaintMode; typedef int (*StrokeGetLocation)(struct bContext *C, float location[3], const float mouse[2]); typedef int (*StrokeTestStart)(struct bContext *C, struct wmOperator *op, const float mouse[2]); typedef void (*StrokeUpdateStep)(struct bContext *C, struct PaintStroke *stroke, struct PointerRNA *itemptr); +typedef void (*StrokeRedraw)(const struct bContext *C, struct PaintStroke *stroke, bool final); typedef void (*StrokeDone)(const struct bContext *C, struct PaintStroke *stroke); struct PaintStroke *paint_stroke_new(struct bContext *C, StrokeGetLocation get_location, StrokeTestStart test_start, - StrokeUpdateStep update_step, StrokeDone done, int event_type); + StrokeUpdateStep update_step, StrokeRedraw redraw, + StrokeDone done, int event_type); void paint_stroke_data_free(struct wmOperator *op); bool paint_space_stroke_enabled(struct Brush *br, enum PaintMode mode); @@ -139,11 +141,12 @@ void imapaint_dirty_region(struct Image *ima, struct ImBuf *ibuf, int x, int y, void imapaint_region_tiles(struct ImBuf *ibuf, int x, int y, int w, int h, int *tx, int *ty, int *tw, int *th); int get_imapaint_zoom(struct bContext *C, float *zoomx, float *zoomy); void *paint_2d_new_stroke(struct bContext *, struct wmOperator *); -void paint_2d_redraw(const bContext *C, void *ps, int final); +void paint_2d_redraw(const bContext *C, void *ps, bool final); void paint_2d_stroke_done(void *ps); -int paint_2d_stroke(void *ps, const float prev_mval[2], const float mval[2], int eraser); +void paint_2d_stroke(void *ps, const float prev_mval[2], const float mval[2], int eraser); void *paint_proj_new_stroke(struct bContext *C, struct Object *ob, const float mouse[2], int mode); -int paint_proj_stroke(struct bContext *C, void *ps, const float prevmval_i[2], const float mval_i[2]); +void paint_proj_stroke(struct bContext *C, void *ps, const float prevmval_i[2], const float mval_i[2]); +void paint_proj_redraw(const bContext *C, void *pps, bool final); void paint_proj_stroke_done(void *ps); void paint_brush_init_tex(struct Brush *brush); void paint_brush_exit_tex(struct Brush *brush); |