Cleanup: GPUState: remove float variant of GPU_scissor_get
This commit is contained in:
@@ -748,7 +748,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(region),
|
||||
# if 0
|
||||
/* prevent drawing outside widget area */
|
||||
int scissor[4];
|
||||
GPU_scissor_get_i(scissor);
|
||||
GPU_scissor_get(scissor);
|
||||
GPU_scissor(rect->xmin, rect->ymin, w, h);
|
||||
# endif
|
||||
|
||||
@@ -830,11 +830,8 @@ void UI_draw_safe_areas(uint pos,
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_scope_end(const rctf *rect, GLint *scissor)
|
||||
static void draw_scope_end(const rctf *rect)
|
||||
{
|
||||
/* Restore scissor test. */
|
||||
GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
|
||||
|
||||
GPU_blend_set_func_separate(
|
||||
GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
@@ -942,7 +939,7 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(region),
|
||||
|
||||
/* need scissor test, histogram can draw outside of boundary */
|
||||
int scissor[4];
|
||||
GPU_scissor_get_i(scissor);
|
||||
GPU_scissor_get(scissor);
|
||||
GPU_scissor((rect.xmin - 1),
|
||||
(rect.ymin - 1),
|
||||
(rect.xmax + 1) - (rect.xmin - 1),
|
||||
@@ -999,8 +996,11 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(region),
|
||||
|
||||
immUnbindProgram();
|
||||
|
||||
/* Restore scissor test. */
|
||||
GPU_scissor(UNPACK4(scissor));
|
||||
|
||||
/* outline */
|
||||
draw_scope_end(&rect, scissor);
|
||||
draw_scope_end(&rect);
|
||||
}
|
||||
|
||||
#undef HISTOGRAM_TOT_GRID_LINES
|
||||
@@ -1082,7 +1082,7 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(region),
|
||||
true, rect.xmin - 1, rect.ymin - 1, rect.xmax + 1, rect.ymax + 1, 3.0f, color);
|
||||
|
||||
/* need scissor test, waveform can draw outside of boundary */
|
||||
GPU_scissor_get_i(scissor);
|
||||
GPU_scissor_get(scissor);
|
||||
GPU_scissor((rect.xmin - 1),
|
||||
(rect.ymin - 1),
|
||||
(rect.xmax + 1) - (rect.xmin - 1),
|
||||
@@ -1257,8 +1257,11 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(region),
|
||||
|
||||
immUnbindProgram();
|
||||
|
||||
/* Restore scissor test. */
|
||||
GPU_scissor(UNPACK4(scissor));
|
||||
|
||||
/* outline */
|
||||
draw_scope_end(&rect, scissor);
|
||||
draw_scope_end(&rect);
|
||||
|
||||
GPU_blend(false);
|
||||
}
|
||||
@@ -1413,7 +1416,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(region),
|
||||
|
||||
/* need scissor test, hvectorscope can draw outside of boundary */
|
||||
int scissor[4];
|
||||
GPU_scissor_get_i(scissor);
|
||||
GPU_scissor_get(scissor);
|
||||
GPU_scissor((rect.xmin - 1),
|
||||
(rect.ymin - 1),
|
||||
(rect.xmax + 1) - (rect.xmin - 1),
|
||||
@@ -1481,8 +1484,10 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(region),
|
||||
|
||||
immUnbindProgram();
|
||||
|
||||
/* Restore scissor test. */
|
||||
GPU_scissor(UNPACK4(scissor));
|
||||
/* outline */
|
||||
draw_scope_end(&rect, scissor);
|
||||
draw_scope_end(&rect);
|
||||
|
||||
GPU_blend(false);
|
||||
}
|
||||
@@ -1917,7 +1922,7 @@ void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol,
|
||||
|
||||
/* need scissor test, curve can draw outside of boundary */
|
||||
int scissor[4];
|
||||
GPU_scissor_get_i(scissor);
|
||||
GPU_scissor_get(scissor);
|
||||
rcti scissor_new = {
|
||||
.xmin = rect->xmin,
|
||||
.ymin = rect->ymin,
|
||||
@@ -2194,7 +2199,7 @@ void ui_draw_but_CURVEPROFILE(ARegion *region,
|
||||
|
||||
/* Test needed because path can draw outside of boundary. */
|
||||
int scissor[4];
|
||||
GPU_scissor_get_i(scissor);
|
||||
GPU_scissor_get(scissor);
|
||||
rcti scissor_new = {
|
||||
.xmin = rect->xmin,
|
||||
.ymin = rect->ymin,
|
||||
@@ -2468,7 +2473,7 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region),
|
||||
|
||||
/* need scissor test, preview image can draw outside of boundary */
|
||||
int scissor[4];
|
||||
GPU_scissor_get_i(scissor);
|
||||
GPU_scissor_get(scissor);
|
||||
GPU_scissor((rect.xmin - 1),
|
||||
(rect.ymin - 1),
|
||||
(rect.xmax + 1) - (rect.xmin - 1),
|
||||
@@ -2593,8 +2598,10 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region),
|
||||
true, rect.xmin - 1, rect.ymin, rect.xmax + 1, rect.ymax + 1, 3.0f, color);
|
||||
}
|
||||
|
||||
/* Restore scissor test. */
|
||||
GPU_scissor(UNPACK4(scissor));
|
||||
/* outline */
|
||||
draw_scope_end(&rect, scissor);
|
||||
draw_scope_end(&rect);
|
||||
|
||||
GPU_blend(false);
|
||||
}
|
||||
|
||||
@@ -3270,7 +3270,7 @@ void ED_region_info_draw_multiline(ARegion *region,
|
||||
rect.ymin = rect.ymax - header_height * num_lines;
|
||||
|
||||
/* setup scissor */
|
||||
GPU_scissor_get_i(scissor);
|
||||
GPU_scissor_get(scissor);
|
||||
GPU_scissor(rect.xmin, rect.ymin, BLI_rcti_size_x(&rect) + 1, BLI_rcti_size_y(&rect) + 1);
|
||||
|
||||
GPU_blend(true);
|
||||
|
||||
@@ -3508,12 +3508,12 @@ static void outliner_draw_tree(bContext *C,
|
||||
outliner_draw_highlights(region, space_outliner, startx, &starty);
|
||||
|
||||
/* set scissor so tree elements or lines can't overlap restriction icons */
|
||||
float scissor[4] = {0};
|
||||
int scissor[4] = {0};
|
||||
if (restrict_column_width > 0.0f) {
|
||||
int mask_x = BLI_rcti_size_x(®ion->v2d.mask) - (int)restrict_column_width + 1;
|
||||
CLAMP_MIN(mask_x, 0);
|
||||
|
||||
GPU_scissor_get_f(scissor);
|
||||
GPU_scissor_get(scissor);
|
||||
GPU_scissor(0, 0, mask_x, region->winy);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,8 +75,7 @@ void GPU_point_size(float size);
|
||||
void GPU_polygon_smooth(bool enable);
|
||||
void GPU_program_point_size(bool enable);
|
||||
void GPU_scissor(int x, int y, int width, int height);
|
||||
void GPU_scissor_get_f(float coords[4]);
|
||||
void GPU_scissor_get_i(int coords[4]);
|
||||
void GPU_scissor_get(int coords[4]);
|
||||
void GPU_viewport(int x, int y, int width, int height);
|
||||
void GPU_viewport_size_get_f(float coords[4]);
|
||||
void GPU_viewport_size_get_i(int coords[4]);
|
||||
|
||||
@@ -188,12 +188,7 @@ void GPU_viewport(int x, int y, int width, int height)
|
||||
glViewport(x, y, width, height);
|
||||
}
|
||||
|
||||
void GPU_scissor_get_f(float coords[4])
|
||||
{
|
||||
glGetFloatv(GL_SCISSOR_BOX, coords);
|
||||
}
|
||||
|
||||
void GPU_scissor_get_i(int coords[4])
|
||||
void GPU_scissor_get(int coords[4])
|
||||
{
|
||||
glGetIntegerv(GL_SCISSOR_BOX, coords);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user