summaryrefslogtreecommitdiff
path: root/indra/llrender/lluiimage.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2014-02-12 10:32:02 -0800
committerRichard Linden <none@none>2014-02-12 10:32:02 -0800
commit5866bb7ef09b786f8f195770a70dc4289d183ca0 (patch)
tree0be3b5e63506bf30edd3748f9e31740ae9ebbaa8 /indra/llrender/lluiimage.cpp
parent413be91cf5044889ade97dcbec4b17fceff122e3 (diff)
parenta8192fbf60540e42dcff5f1efb8bf8cafbfac484 (diff)
merge with release
Diffstat (limited to 'indra/llrender/lluiimage.cpp')
-rw-r--r--indra/llrender/lluiimage.cpp50
1 files changed, 20 insertions, 30 deletions
diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp
index b954b66350..6f1fae92cd 100644
--- a/indra/llrender/lluiimage.cpp
+++ b/indra/llrender/lluiimage.cpp
@@ -38,11 +38,9 @@ LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image)
mImage(image),
mScaleRegion(0.f, 1.f, 1.f, 0.f),
mClipRegion(0.f, 1.f, 1.f, 0.f),
- mUniformScaling(TRUE),
- mNoClip(TRUE),
- mImageLoaded(NULL)
-{
-}
+ mImageLoaded(NULL),
+ mScaleStyle(SCALE_INNER)
+{}
LLUIImage::~LLUIImage()
{
@@ -52,44 +50,35 @@ LLUIImage::~LLUIImage()
void LLUIImage::setClipRegion(const LLRectf& region)
{
mClipRegion = region;
- mNoClip = mClipRegion.mLeft == 0.f
- && mClipRegion.mRight == 1.f
- && mClipRegion.mBottom == 0.f
- && mClipRegion.mTop == 1.f;
}
void LLUIImage::setScaleRegion(const LLRectf& region)
{
mScaleRegion = region;
- mUniformScaling = mScaleRegion.mLeft == 0.f
- && mScaleRegion.mRight == 1.f
- && mScaleRegion.mBottom == 0.f
- && mScaleRegion.mTop == 1.f;
+}
+
+void LLUIImage::setScaleStyle(LLUIImage::EScaleStyle style)
+{
+ mScaleStyle = style;
}
//TODO: move drawing implementation inside class
void LLUIImage::draw(S32 x, S32 y, const LLColor4& color) const
{
- gl_draw_scaled_image(x, y, getWidth(), getHeight(), mImage, color, mClipRegion);
+ draw(x, y, getWidth(), getHeight(), color);
}
void LLUIImage::draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const
{
- if (mUniformScaling)
- {
- gl_draw_scaled_image(x, y, width, height, mImage, color, mClipRegion);
- }
- else
- {
- gl_draw_scaled_image_with_border(
- x, y,
- width, height,
- mImage,
- color,
- FALSE,
- mClipRegion,
- mScaleRegion);
- }
+ gl_draw_scaled_image_with_border(
+ x, y,
+ width, height,
+ mImage,
+ color,
+ FALSE,
+ mClipRegion,
+ mScaleRegion,
+ mScaleStyle == SCALE_INNER);
}
void LLUIImage::drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const
@@ -101,7 +90,8 @@ void LLUIImage::drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& c
color,
TRUE,
mClipRegion,
- mScaleRegion);
+ mScaleRegion,
+ mScaleStyle == SCALE_INNER);
}
void LLUIImage::drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const