summaryrefslogtreecommitdiff
path: root/indra/llui/lllocalcliprect.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-07-23 22:07:15 -0700
committerRichard Linden <none@none>2010-07-23 22:07:15 -0700
commit6cc6f816780e64c5fb1e17a22fb5e473e75efe69 (patch)
tree0fb764971547fc3e8e8fad3ec7a1856b77fb1ac9 /indra/llui/lllocalcliprect.h
parent4d2daeed21dfba9d6a40e88ecd92aaaa6df92ae1 (diff)
first pass ui rendering performance improvements
Diffstat (limited to 'indra/llui/lllocalcliprect.h')
-rw-r--r--indra/llui/lllocalcliprect.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/indra/llui/lllocalcliprect.h b/indra/llui/lllocalcliprect.h
index cd0c55ca72..36413f1496 100644
--- a/indra/llui/lllocalcliprect.h
+++ b/indra/llui/lllocalcliprect.h
@@ -31,7 +31,9 @@
#ifndef LLLOCALCLIPRECT_H
#define LLLOCALCLIPRECT_H
+#include "llgl.h"
#include "llrect.h" // can't forward declare, it's templated
+#include <stack>
// Clip rendering to a specific rectangle using GL scissor
// Just create one of these on the stack:
@@ -39,15 +41,29 @@
// LLLocalClipRect(rect);
// draw();
// }
-class LLLocalClipRect
+class LLScreenClipRect
{
public:
- LLLocalClipRect(const LLRect& rect, BOOL enabled = TRUE);
- ~LLLocalClipRect();
+ LLScreenClipRect(const LLRect& rect, BOOL enabled = TRUE);
+ virtual ~LLScreenClipRect();
+
+private:
+ static void pushClipRect(const LLRect& rect);
+ static void popClipRect();
+ static void updateScissorRegion();
private:
- // implementation class
- class LLScreenClipRect* mScreenClipRect;
+ LLGLState mScissorState;
+ BOOL mEnabled;
+
+ static std::stack<LLRect> sClipRectStack;
+};
+
+class LLLocalClipRect : public LLScreenClipRect
+{
+public:
+ LLLocalClipRect(const LLRect& rect, BOOL enabled = TRUE);
+ ~LLLocalClipRect();
};
#endif