summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender')
-rwxr-xr-xindra/llrender/llfontfreetype.cpp4
-rwxr-xr-xindra/llrender/llfontgl.cpp32
-rw-r--r--indra/llrender/llrender2dutils.cpp16
-rw-r--r--indra/llrender/lluiimage.cpp4
4 files changed, 28 insertions, 28 deletions
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 254008fbcf..de26d19efc 100755
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -183,8 +183,8 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
mDescender = -mFTFace->descender * pixels_per_unit;
mLineHeight = mFTFace->height * pixels_per_unit;
- S32 max_char_width = llround(0.5f + (x_max - x_min));
- S32 max_char_height = llround(0.5f + (y_max - y_min));
+ S32 max_char_width = ll_round(0.5f + (x_max - x_min));
+ S32 max_char_height = ll_round(0.5f + (y_max - y_min));
mFontBitmapCachep->init(components, max_char_width, max_char_height);
claimMem(mFontBitmapCachep);
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index bedec4bd6f..53ca080d66 100755
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -211,10 +211,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
case LEFT:
break;
case RIGHT:
- cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX));
+ cur_x -= llmin(scaled_max_pixels, ll_round(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX));
break;
case HCENTER:
- cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2;
+ cur_x -= llmin(scaled_max_pixels, ll_round(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2;
break;
default:
break;
@@ -223,7 +223,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
cur_render_y = cur_y;
cur_render_x = cur_x;
- F32 start_x = (F32)llround(cur_x);
+ F32 start_x = (F32)ll_round(cur_x);
const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache();
@@ -237,12 +237,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
if (use_ellipses)
{
// check for too long of a string
- S32 string_width = llround(getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX);
+ S32 string_width = ll_round(getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX);
if (string_width > scaled_max_pixels)
{
// use four dots for ellipsis width to generate padding
const LLWString dots(utf8str_to_wstring(std::string("....")));
- scaled_max_pixels = llmax(0, scaled_max_pixels - llround(getWidthF32(dots.c_str())));
+ scaled_max_pixels = llmax(0, scaled_max_pixels - ll_round(getWidthF32(dots.c_str())));
draw_ellipses = TRUE;
}
}
@@ -307,10 +307,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
(fgi->mXBitmapOffset + fgi->mWidth) * inv_width,
(fgi->mYBitmapOffset - PAD_UVY) * inv_height);
// snap glyph origin to whole screen pixel
- LLRectf screen_rect((F32)llround(cur_render_x + (F32)fgi->mXBearing),
- (F32)llround(cur_render_y + (F32)fgi->mYBearing),
- (F32)llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
- (F32)llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
+ LLRectf screen_rect((F32)ll_round(cur_render_x + (F32)fgi->mXBearing),
+ (F32)ll_round(cur_render_y + (F32)fgi->mYBearing),
+ (F32)ll_round(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
+ (F32)ll_round(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
if (glyph_count >= GLYPH_BATCH_SIZE)
{
@@ -341,8 +341,8 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
// Must do this to cur_x, not just to cur_render_x, otherwise you
// will squish sub-pixel kerned characters too close together.
// For example, "CCCCC" looks bad.
- cur_x = (F32)llround(cur_x);
- //cur_y = (F32)llround(cur_y);
+ cur_x = (F32)ll_round(cur_x);
+ //cur_y = (F32)ll_round(cur_y);
cur_render_x = cur_x;
cur_render_y = cur_y;
@@ -452,7 +452,7 @@ S32 LLFontGL::getWidth(const std::string& utf8text, S32 begin_offset, S32 max_ch
S32 LLFontGL::getWidth(const llwchar* wchars, S32 begin_offset, S32 max_chars) const
{
F32 width = getWidthF32(wchars, begin_offset, max_chars);
- return llround(width);
+ return ll_round(width);
}
F32 LLFontGL::getWidthF32(const std::string& utf8text) const
@@ -514,7 +514,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars
cur_x += mFontFreetype->getXKerning(fgi, next_glyph);
}
// Round after kerning.
- cur_x = (F32)llround(cur_x);
+ cur_x = (F32)ll_round(cur_x);
}
// add in extra pixels for last character's width past its xadvance
@@ -622,7 +622,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
}
// Round after kerning.
- cur_x = (F32)llround(cur_x);
+ cur_x = (F32)ll_round(cur_x);
}
if( clip )
@@ -692,7 +692,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
}
// Round after kerning.
- total_width = (F32)llround(total_width);
+ total_width = (F32)ll_round(total_width);
}
if (drawable_chars == 0)
@@ -775,7 +775,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t
// Round after kerning.
- cur_x = (F32)llround(cur_x);
+ cur_x = (F32)ll_round(cur_x);
}
return llmin(max_chars, pos - begin_offset);
diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp
index df5d79a436..4e2ebfd51e 100644
--- a/indra/llrender/llrender2dutils.cpp
+++ b/indra/llrender/llrender2dutils.cpp
@@ -433,8 +433,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
F32 image_width = image->getWidth(0);
F32 image_height = image->getHeight(0);
- S32 image_natural_width = llround(image_width * uv_width);
- S32 image_natural_height = llround(image_height * uv_height);
+ S32 image_natural_width = ll_round(image_width * uv_width);
+ S32 image_natural_height = ll_round(image_height * uv_height);
LLRectf draw_center_rect( uv_center_rect.mLeft * image_width,
uv_center_rect.mTop * image_height,
@@ -468,10 +468,10 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
draw_center_rect.setCenterAndSize(uv_center_rect.getCenterX() * width, uv_center_rect.getCenterY() * height, scaled_width, scaled_height);
}
- draw_center_rect.mLeft = llround(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * ui_scale.mV[VX]);
- draw_center_rect.mTop = llround(ui_translation.mV[VY] + (F32)draw_center_rect.mTop * ui_scale.mV[VY]);
- draw_center_rect.mRight = llround(ui_translation.mV[VX] + (F32)draw_center_rect.mRight * ui_scale.mV[VX]);
- draw_center_rect.mBottom = llround(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * ui_scale.mV[VY]);
+ draw_center_rect.mLeft = ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * ui_scale.mV[VX]);
+ draw_center_rect.mTop = ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mTop * ui_scale.mV[VY]);
+ draw_center_rect.mRight = ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mRight * ui_scale.mV[VX]);
+ draw_center_rect.mBottom = ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * ui_scale.mV[VY]);
LLRectf draw_outer_rect(ui_translation.mV[VX],
ui_translation.mV[VY] + height * ui_scale.mV[VY],
@@ -703,8 +703,8 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
ui_translation.mV[VY] += y;
ui_translation.scaleVec(ui_scale);
S32 index = 0;
- S32 scaled_width = llround(width * ui_scale.mV[VX]);
- S32 scaled_height = llround(height * ui_scale.mV[VY]);
+ S32 scaled_width = ll_round(width * ui_scale.mV[VX]);
+ S32 scaled_height = ll_round(height * ui_scale.mV[VY]);
uv[index] = LLVector2(uv_rect.mRight, uv_rect.mTop);
pos[index] = LLVector3(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY] + scaled_height, 0.f);
diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp
index 6f1fae92cd..5d8f92b2e6 100644
--- a/indra/llrender/lluiimage.cpp
+++ b/indra/llrender/lluiimage.cpp
@@ -149,13 +149,13 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c
S32 LLUIImage::getWidth() const
{
// return clipped dimensions of actual image area
- return llround((F32)mImage->getWidth(0) * mClipRegion.getWidth());
+ return ll_round((F32)mImage->getWidth(0) * mClipRegion.getWidth());
}
S32 LLUIImage::getHeight() const
{
// return clipped dimensions of actual image area
- return llround((F32)mImage->getHeight(0) * mClipRegion.getHeight());
+ return ll_round((F32)mImage->getHeight(0) * mClipRegion.getHeight());
}
S32 LLUIImage::getTextureWidth() const