Skip to content
Snippets Groups Projects
Commit d28d99e2 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

More performance work for LLUI

parent 43c08ce5
No related branches found
No related tags found
No related merge requests found
......@@ -798,7 +798,7 @@ void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LL
}
gGL.end();
LLRender2D::getInstance()->setLineWidth(1.f);
LLRender2D::setLineWidth(1.f);
}
void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F32 start_angle, F32 end_angle)
......@@ -965,7 +965,7 @@ void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha)
}
else
{ //polygon stipple is deprecated, use "Checker" texture
LLPointer<LLUIImage> img = LLRender2D::getInstance()->getUIImage("Checker");
LLUIImagePtr img = LLRender2D::getInstance()->getUIImage("Checker");
gGL.getTexUnit(0)->bind(img->getImage());
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP);
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
......
......@@ -81,10 +81,10 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c
}
}
LLRender2D::getInstance()->pushMatrix();
LLRender2D::pushMatrix();
{
LLVector3 rect_origin = origin_agent + (rect.mLeft * x_axis) + (rect.mBottom * y_axis);
LLRender2D::getInstance()->translate(rect_origin.mV[VX],
LLRender2D::translate(rect_origin.mV[VX],
rect_origin.mV[VY],
rect_origin.mV[VZ]);
gGL.getTexUnit(0)->bind(getImage());
......@@ -103,7 +103,7 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c
rect.getWidth() * x_axis,
rect.getHeight() * y_axis);
} LLRender2D::getInstance()->popMatrix();
} LLRender2D::popMatrix();
}
//#include "lluiimage.inl"
......
......@@ -69,6 +69,8 @@ LLConsole::LLConsole(const LLConsole::Params& p)
}
mFadeTime = mLinePersistTime - FADE_DURATION;
setMaxLines(LLUI::getInstance()->mSettingGroups["config"]->getS32("ConsoleMaxLines"));
mBackgroundImagep = LLUI::getUIImage("transparent");
}
void LLConsole::setLinePersistTime(F32 seconds)
......@@ -178,8 +180,6 @@ void LLConsole::draw()
// draw remaining lines
F32 y_pos = 0.f;
LLUIImagePtr imagep = LLUI::getUIImage("transparent");
static LLUICachedControl<F32> console_bg_opacity("ConsoleBackgroundOpacity", 0.7f);
F32 console_opacity = llclamp(console_bg_opacity(), 0.f, 1.f);
......@@ -196,7 +196,7 @@ void LLConsole::draw()
S32 target_width = llfloor( (*paragraph_it).mMaxWidth + padding_horizontal);
y_pos += ((*paragraph_it).mLines.size()) * line_height;
imagep->drawSolid(-14, (S32)(y_pos + line_height - target_height), target_width, target_height, color);
mBackgroundImagep->drawSolid(-14, (S32)(y_pos + line_height - target_height), target_width, target_height, color);
F32 y_off=0;
......
......@@ -143,6 +143,7 @@ class LLConsole : public LLFixedBuffer, public LLUICtrl, public LLInstanceTracke
private:
void update();
LLUIImagePtr mBackgroundImagep;
F32 mLinePersistTime; // Age at which to stop drawing.
F32 mFadeTime; // Age at which to start fading
const LLFontGL* mFont;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment