summaryrefslogtreecommitdiff
path: root/indra/llui/llui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llui.cpp')
-rw-r--r--indra/llui/llui.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 6a87977718..b9d935847b 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -1147,6 +1147,8 @@ void gl_rect_2d_simple( S32 width, S32 height )
gGL.end();
}
+static LLFastTimer::DeclareTimer FTM_RENDER_SEGMENTED_RECT ("Render segmented rectangle");
+
void gl_segmented_rect_2d_tex(const S32 left,
const S32 top,
const S32 right,
@@ -1156,6 +1158,7 @@ void gl_segmented_rect_2d_tex(const S32 left,
const S32 border_size,
const U32 edges)
{
+ LLFastTimer _(FTM_RENDER_SEGMENTED_RECT);
S32 width = llabs(right - left);
S32 height = llabs(top - bottom);
@@ -1306,10 +1309,7 @@ void gl_segmented_rect_2d_tex(const S32 left,
}
//FIXME: rewrite to use scissor?
-void gl_segmented_rect_2d_fragment_tex(const S32 left,
- const S32 top,
- const S32 right,
- const S32 bottom,
+void gl_segmented_rect_2d_fragment_tex(const LLRect& rect,
const S32 texture_width,
const S32 texture_height,
const S32 border_size,
@@ -1317,6 +1317,11 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left,
const F32 end_fragment,
const U32 edges)
{
+ LLFastTimer _(FTM_RENDER_SEGMENTED_RECT);
+ const S32 left = rect.mLeft;
+ const S32 right = rect.mRight;
+ const S32 top = rect.mTop;
+ const S32 bottom = rect.mBottom;
S32 width = llabs(right - left);
S32 height = llabs(top - bottom);
@@ -1354,9 +1359,9 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left,
{
if (start_fragment < middle_start)
{
- u_min = (start_fragment / middle_start) * border_uv_scale.mV[VX];
+ u_min = (start_fragment / middle_start) * border_uv_scale.mV[VX];
u_max = llmin(end_fragment / middle_start, 1.f) * border_uv_scale.mV[VX];
- x_min = (start_fragment / middle_start) * border_width_left;
+ x_min = (start_fragment / middle_start) * border_width_left;
x_max = llmin(end_fragment / middle_start, 1.f) * border_width_left;
// draw bottom left
@@ -1446,10 +1451,10 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left,
if (end_fragment > middle_end)
{
- u_min = (1.f - llmax(0.f, ((start_fragment - middle_end) / middle_start))) * border_uv_scale.mV[VX];
- u_max = (1.f - ((end_fragment - middle_end) / middle_start)) * border_uv_scale.mV[VX];
- x_min = width_vec - ((1.f - llmax(0.f, ((start_fragment - middle_end) / middle_start))) * border_width_right);
- x_max = width_vec - ((1.f - ((end_fragment - middle_end) / middle_start)) * border_width_right);
+ u_min = 1.f - ((1.f - llmax(0.f, (start_fragment - middle_end) / middle_start)) * border_uv_scale.mV[VX]);
+ u_max = 1.f - ((1.f - ((end_fragment - middle_end) / middle_start)) * border_uv_scale.mV[VX]);
+ x_min = width_vec - ((1.f - llmax(0.f, (start_fragment - middle_end) / middle_start)) * border_width_right);
+ x_max = width_vec - ((1.f - ((end_fragment - middle_end) / middle_start)) * border_width_right);
// draw bottom right
gGL.texCoord2f(u_min, 0.f);
@@ -1500,6 +1505,7 @@ void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& bo
const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec,
const U32 edges)
{
+ LLFastTimer _(FTM_RENDER_SEGMENTED_RECT);
LLVector3 left_border_width = ((edges & (~(U32)ROUNDED_RECT_RIGHT)) != 0) ? border_width : LLVector3::zero;
LLVector3 right_border_width = ((edges & (~(U32)ROUNDED_RECT_LEFT)) != 0) ? border_width : LLVector3::zero;