use best GPU matrix function for the job

Follow-up to 204e067111 which coverted manipulators' legacy GL matrix calls to new ones.

part of T49450
This commit is contained in:
Mike Erwin
2017-04-07 13:24:00 -04:00
parent f0ce39ab16
commit 1a156f7103
3 changed files with 9 additions and 9 deletions

View File

@@ -76,11 +76,11 @@ static void arrow2d_draw_geom(ArrowManipulator2D *arrow, const float origin[2])
const float draw_line_ofs = (arrow->manipulator.line_width * 0.5f) / arrow->manipulator.scale;
gpuPushMatrix();
gpuTranslate3f(UNPACK2(origin), 0.0f);
gpuScale3f(arrow->manipulator.scale, arrow->manipulator.scale, 0.0f);
gpuRotate3f(RAD2DEGF(arrow->angle), 0.0f, 0.0f, 1.0f);
gpuTranslate2fv(origin);
gpuScaleUniform(arrow->manipulator.scale);
gpuRotate2D(RAD2DEGF(arrow->angle));
/* local offset */
gpuTranslate3f(arrow->manipulator.offset[0] + draw_line_ofs, arrow->manipulator.offset[1], 0.0f);
gpuTranslate2f(arrow->manipulator.offset[0] + draw_line_ofs, arrow->manipulator.offset[1]);
/* TODO get rid of immediate mode */
glBegin(GL_LINES);

View File

@@ -190,12 +190,12 @@ static void manipulator_rect_transform_draw(const bContext *UNUSED(C), wmManipul
r.ymax = half_h;
gpuPushMatrix();
gpuTranslate3f(manipulator->origin[0] + manipulator->offset[0],
manipulator->origin[1] + manipulator->offset[1], 0.0f);
gpuTranslate2f(manipulator->origin[0] + manipulator->offset[0],
manipulator->origin[1] + manipulator->offset[1]);
if (cage->style & MANIPULATOR_RECT_TRANSFORM_STYLE_SCALE_UNIFORM)
gpuScale3f(cage->scale[0], cage->scale[0], 1.0);
gpuScaleUniform(cage->scale[0]);
else
gpuScale3f(cage->scale[0], cage->scale[1], 1.0);
gpuScale2fv(cage->scale);
if (w > h)
aspx = h / w;

View File

@@ -149,7 +149,7 @@ static void manipulator_primitive_draw_intern(
gpuMultMatrix3D(mat);
glEnable(GL_BLEND);
gpuTranslate3f(UNPACK3(prim->manipulator.offset));
gpuTranslate3fv(prim->manipulator.offset);
manipulator_primitive_draw_geom(col_inner, col_outer, prim->style);
glDisable(GL_BLEND);