Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-04-15 01:42:58 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-04-15 01:42:58 +0400
commitc9a10b99ff2f25b6807cf43c3bfa827ba185e625 (patch)
treecfac9bc40c5b1f2a039933882d18dfd7c4f6513a /source/blender/editors/screen/area.c
parent77a78658eaf8903d359b23867ae00cf492d39f75 (diff)
Cycles: optimization for 3D viewport border render with heavy scenes, the OpenGL
render of objects could slow things down when redrawing the view each time a new sample is displayed. Now it does a partial redraw of the viewport with only the render border area, skipping OpenGL object drawing while the render is refining.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r--source/blender/editors/screen/area.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index eb52c06d08f..555e123be97 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1856,11 +1856,12 @@ int ED_area_headersize(void)
return (int)(1.3f * UI_UNIT_Y);
}
-void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha)
+void ED_region_info_draw(ARegion *ar, const char *text, int block, float fill_color[4])
{
const int header_height = UI_UNIT_Y;
uiStyle *style = UI_GetStyleDraw();
int fontid = style->widget.uifont_id;
+ GLint scissor[4];
rcti rect;
/* background box */
@@ -1873,9 +1874,14 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha)
rect.ymax = BLI_rcti_size_y(&ar->winrct);
+ /* setup scissor */
+ glGetIntegerv(GL_SCISSOR_BOX, scissor);
+ glScissor(ar->winrct.xmin + rect.xmin, ar->winrct.ymin + rect.ymin,
+ BLI_rcti_size_x(&rect), BLI_rcti_size_y(&rect));
+
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glColor4f(0.0f, 0.0f, 0.0f, alpha);
+ glColor4fv(fill_color);
glRecti(rect.xmin, rect.ymin, rect.xmax + 1, rect.ymax + 1);
glDisable(GL_BLEND);
@@ -1888,6 +1894,9 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha)
BLF_draw(fontid, text, BLF_DRAW_STR_DUMMY_MAX);
BLF_disable(fontid, BLF_CLIPPING);
+
+ /* restore scissor as it was before */
+ glScissor(scissor[0], scissor[1], scissor[2], scissor[3]);
}
void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy)