diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-06 17:54:07 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-06 17:54:07 +0300 |
commit | bd309603c5359443ace5af4e11d0e4bcd17e4ac6 (patch) | |
tree | ba100e31a7018e77a1410942c5cce6a0c0ba1ebb /source/blender/editors/include/BIF_glutil.h | |
parent | dd52bf8fb9b84550948bcc31002d104b6d465d89 (diff) |
Clip invisible parts of image when drawing in 2D textures and GLSL Modes
This commit avoids draw of invisible parts of image in image editor,
making it faster to re-draw the image.
Especially handy when painting on a high-res image when zoomed-in.
Diffstat (limited to 'source/blender/editors/include/BIF_glutil.h')
-rw-r--r-- | source/blender/editors/include/BIF_glutil.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index e45e5f5e7ab..0ac5c17a552 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -143,6 +143,8 @@ void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int row_w, int fo */ void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, int type, int zoomfilter, void *rect); +void glaDrawPixelsTex_clipping(float x, float y, int img_w, int img_h, int format, int type, int zoomfilter, void *rect, + float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y); /** * glaDrawPixelsAuto - Switches between texture or pixel drawing using UserDef. @@ -150,9 +152,13 @@ void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, int ty * needs glaDefine2DArea to be set. */ void glaDrawPixelsAuto(float x, float y, int img_w, int img_h, int format, int type, int zoomfilter, void *rect); +void glaDrawPixelsAuto_clipping(float x, float y, int img_w, int img_h, int format, int type, int zoomfilter, void *rect, + float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y); void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, int type, int zoomfilter, void *rect, float scaleX, float scaleY); +void glaDrawPixelsTexScaled_clipping(float x, float y, int img_w, int img_h, int format, int type, int zoomfilter, void *rect, float scaleX, float scaleY, + float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y); /* 2D Drawing Assistance */ @@ -205,9 +211,21 @@ void bgl_get_mats(bglMats *mats); void glaDrawImBuf_glsl(struct ImBuf *ibuf, float x, float y, int zoomfilter, struct ColorManagedViewSettings *view_settings, struct ColorManagedDisplaySettings *display_settings); +void glaDrawImBuf_glsl_clipping(struct ImBuf *ibuf, float x, float y, int zoomfilter, + struct ColorManagedViewSettings *view_settings, + struct ColorManagedDisplaySettings *display_settings, + float clip_min_x, float clip_min_y, + float clip_max_x, float clip_max_y); + /* Draw imbuf on a screen, preferably using GLSL display transform */ void glaDrawImBuf_glsl_ctx(const struct bContext *C, struct ImBuf *ibuf, float x, float y, int zoomfilter); +void glaDrawImBuf_glsl_ctx_clipping(const struct bContext *C, + struct ImBuf *ibuf, + float x, float y, + int zoomfilter, + float clip_min_x, float clip_min_y, + float clip_max_x, float clip_max_y); void glaDrawBorderCorners(const struct rcti *border, float zoomx, float zoomy); |