summaryrefslogtreecommitdiff
path: root/indra/llui/lllocalcliprect.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-08-24 19:22:00 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-08-24 19:22:00 +0100
commite416840f85dc4a367894036b9fe483f17d959c54 (patch)
treee12956cbe7a0082bbaaa545cb80d9e86b13f88e8 /indra/llui/lllocalcliprect.cpp
parent98cc2365034a93c69704daa69efb389799cc9627 (diff)
Backed out changeset c3d41f18ce2b
back-out the back-out for this branch. yay.
Diffstat (limited to 'indra/llui/lllocalcliprect.cpp')
-rw-r--r--indra/llui/lllocalcliprect.cpp48
1 files changed, 9 insertions, 39 deletions
diff --git a/indra/llui/lllocalcliprect.cpp b/indra/llui/lllocalcliprect.cpp
index 1a311bb13a..6841301219 100644
--- a/indra/llui/lllocalcliprect.cpp
+++ b/indra/llui/lllocalcliprect.cpp
@@ -27,33 +27,8 @@
#include "lllocalcliprect.h"
#include "llfontgl.h"
-#include "llgl.h"
#include "llui.h"
-#include <stack>
-
-//---------------------------------------------------------------------------
-// LLScreenClipRect
-// implementation class in screen space
-//---------------------------------------------------------------------------
-class LLScreenClipRect
-{
-public:
- LLScreenClipRect(const LLRect& rect, BOOL enabled = TRUE);
- virtual ~LLScreenClipRect();
-
-private:
- static void pushClipRect(const LLRect& rect);
- static void popClipRect();
- static void updateScissorRegion();
-
-private:
- LLGLState mScissorState;
- BOOL mEnabled;
-
- static std::stack<LLRect> sClipRectStack;
-};
-
/*static*/ std::stack<LLRect> LLScreenClipRect::sClipRectStack;
@@ -64,9 +39,9 @@ LLScreenClipRect::LLScreenClipRect(const LLRect& rect, BOOL enabled)
if (mEnabled)
{
pushClipRect(rect);
+ mScissorState.setEnabled(!sClipRectStack.empty());
+ updateScissorRegion();
}
- mScissorState.setEnabled(!sClipRectStack.empty());
- updateScissorRegion();
}
LLScreenClipRect::~LLScreenClipRect()
@@ -74,8 +49,8 @@ LLScreenClipRect::~LLScreenClipRect()
if (mEnabled)
{
popClipRect();
+ updateScissorRegion();
}
- updateScissorRegion();
}
//static
@@ -125,16 +100,11 @@ void LLScreenClipRect::updateScissorRegion()
// LLLocalClipRect
//---------------------------------------------------------------------------
LLLocalClipRect::LLLocalClipRect(const LLRect& rect, BOOL enabled /* = TRUE */)
-{
- LLRect screen(rect.mLeft + LLFontGL::sCurOrigin.mX,
- rect.mTop + LLFontGL::sCurOrigin.mY,
- rect.mRight + LLFontGL::sCurOrigin.mX,
- rect.mBottom + LLFontGL::sCurOrigin.mY);
- mScreenClipRect = new LLScreenClipRect(screen, enabled);
-}
+: LLScreenClipRect(LLRect(rect.mLeft + LLFontGL::sCurOrigin.mX,
+ rect.mTop + LLFontGL::sCurOrigin.mY,
+ rect.mRight + LLFontGL::sCurOrigin.mX,
+ rect.mBottom + LLFontGL::sCurOrigin.mY), enabled)
+{}
LLLocalClipRect::~LLLocalClipRect()
-{
- delete mScreenClipRect;
- mScreenClipRect = NULL;
-}
+{}