Cleanup: Duplicated function

wmOrtho2_region_pixelspace and wmOrtho2_region_ui were doing exact same thing since rBSa86482f81cf3.
This commit is contained in:
Julian Eisel
2016-02-29 15:20:09 +01:00
parent 94349ab308
commit 49ba9740b8
7 changed files with 7 additions and 19 deletions

View File

@@ -1383,7 +1383,7 @@ void UI_block_draw(const bContext *C, uiBlock *block)
glPushMatrix(); glPushMatrix();
glLoadIdentity(); glLoadIdentity();
wmOrtho2_region_ui(ar); wmOrtho2_region_pixelspace(ar);
/* back */ /* back */
if (block->flag & UI_BLOCK_RADIAL) if (block->flag & UI_BLOCK_RADIAL)

View File

@@ -242,7 +242,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
if (multisample_enabled) if (multisample_enabled)
glDisable(GL_MULTISAMPLE); glDisable(GL_MULTISAMPLE);
wmOrtho2_region_ui(ar); wmOrtho2_region_pixelspace(ar);
/* draw background */ /* draw background */
ui_draw_tooltip_background(UI_style_get(), NULL, &bbox); ui_draw_tooltip_background(UI_style_get(), NULL, &bbox);
@@ -1085,7 +1085,7 @@ static void ui_searchbox_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
uiSearchboxData *data = ar->regiondata; uiSearchboxData *data = ar->regiondata;
/* pixel space */ /* pixel space */
wmOrtho2_region_ui(ar); wmOrtho2_region_pixelspace(ar);
if (data->noback == false) if (data->noback == false)
ui_draw_search_back(NULL, NULL, &data->bbox); /* style not used yet */ ui_draw_search_back(NULL, NULL, &data->bbox); /* style not used yet */

View File

@@ -2394,7 +2394,7 @@ void UI_view2d_text_cache_draw(ARegion *ar)
/* investigate using BLF_ascender() */ /* investigate using BLF_ascender() */
const float default_height = g_v2d_strings ? BLF_height_default("28", 3) : 0.0f; const float default_height = g_v2d_strings ? BLF_height_default("28", 3) : 0.0f;
wmOrtho2_region_ui(ar); wmOrtho2_region_pixelspace(ar);
for (v2s = g_v2d_strings; v2s; v2s = v2s->next) { for (v2s = g_v2d_strings; v2s; v2s = v2s->next) {
int xofs = 0, yofs; int xofs = 0, yofs;

View File

@@ -502,7 +502,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
/* note; this sets state, so we can use wmOrtho and friends */ /* note; this sets state, so we can use wmOrtho and friends */
wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct, scissor_pad); wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct, scissor_pad);
wmOrtho2_region_ui(ar); wmOrtho2_region_pixelspace(ar);
UI_SetTheme(sa ? sa->spacetype : 0, at->regionid); UI_SetTheme(sa ? sa->spacetype : 0, at->regionid);

View File

@@ -893,7 +893,7 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, bool depth_write, flo
glPushMatrix(); glPushMatrix();
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glPushMatrix(); glPushMatrix();
wmOrtho2_region_ui(ar); wmOrtho2_region_pixelspace(ar);
glLoadIdentity(); glLoadIdentity();
if (depth_write) { if (depth_write) {

View File

@@ -409,7 +409,6 @@ void wmOrtho (float x1, float x2, float y1, float y2, float n, float f);
void wmOrtho2 (float x1, float x2, float y1, float y2); void wmOrtho2 (float x1, float x2, float y1, float y2);
/* use for conventions (avoid hard-coded offsets all over) */ /* use for conventions (avoid hard-coded offsets all over) */
void wmOrtho2_region_pixelspace(const struct ARegion *ar); void wmOrtho2_region_pixelspace(const struct ARegion *ar);
void wmOrtho2_region_ui(const struct ARegion *ar);
void wmOrtho2_pixelspace(const float x, const float y); void wmOrtho2_pixelspace(const float x, const float y);
/* utilities */ /* utilities */

View File

@@ -367,7 +367,7 @@ static void wmOrtho2_offset(const float x, const float y, const float ofs)
/** /**
* default pixel alignment. * default pixel alignment.
*/ */
void wmOrtho2_region_pixelspace(const struct ARegion *ar) void wmOrtho2_region_pixelspace(const ARegion *ar)
{ {
wmOrtho2_offset(ar->winx, ar->winy, -0.01f); wmOrtho2_offset(ar->winx, ar->winy, -0.01f);
} }
@@ -377,17 +377,6 @@ void wmOrtho2_pixelspace(const float x, const float y)
wmOrtho2_offset(x, y, -GLA_PIXEL_OFS); wmOrtho2_offset(x, y, -GLA_PIXEL_OFS);
} }
/**
* use for drawing uiBlock, any UI elements and text.
* \note prevents blurry text with multi-sample (FSAA), see T41749
*/
void wmOrtho2_region_ui(const ARegion *ar)
{
/* note, intentionally no '+ 1',
* as with wmOrtho2_region_pixelspace */
wmOrtho2_offset(ar->winx, ar->winy, -0.01f);
}
/* *************************** Framebuffer color depth, for selection codes ********************** */ /* *************************** Framebuffer color depth, for selection codes ********************** */
#ifdef __APPLE__ #ifdef __APPLE__