summaryrefslogtreecommitdiff
path: root/src/gui/widgets/scrollarea.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-25 22:07:05 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-25 22:07:05 +0300
commit2b681b167c1d307f550a8dc7b56a94d13886827e (patch)
tree8ab235ab55893ce4c97a34babd83d71750082de9 /src/gui/widgets/scrollarea.cpp
parent1f4410ab9ac4064ff0cfb0fd31b4e942bee82277 (diff)
downloadmanaverse-2b681b167c1d307f550a8dc7b56a94d13886827e.tar.gz
manaverse-2b681b167c1d307f550a8dc7b56a94d13886827e.tar.bz2
manaverse-2b681b167c1d307f550a8dc7b56a94d13886827e.tar.xz
manaverse-2b681b167c1d307f550a8dc7b56a94d13886827e.zip
Add method safeDrawFrame for safe OpenGL renderer.
Diffstat (limited to 'src/gui/widgets/scrollarea.cpp')
-rw-r--r--src/gui/widgets/scrollarea.cpp38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index 481e4365d..1eb5417e8 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -436,25 +436,33 @@ void ScrollArea::drawFrame(Graphics *graphics)
updateCalcFlag(graphics);
- if (isBatchDrawRenders(openGLMode))
+ if (mRedraw)
{
- if (mRedraw)
- {
- mVertexes2->clear();
- graphics->calcWindow(mVertexes2,
- 0, 0,
- w, h,
- background);
- graphics->finalize(mVertexes2);
- }
- graphics->drawTileCollection(mVertexes2);
- }
- else
- {
- graphics->drawImageRect(0, 0,
+ mVertexes2->clear();
+ graphics->calcWindow(mVertexes2,
+ 0, 0,
w, h,
background);
+ graphics->finalize(mVertexes2);
}
+ graphics->drawTileCollection(mVertexes2);
+ }
+ BLOCK_END("ScrollArea::drawFrame")
+}
+
+void ScrollArea::safeDrawFrame(Graphics *graphics)
+{
+ BLOCK_START("ScrollArea::drawFrame")
+ if (mOpaque)
+ {
+ const int bs = mFrameSize * 2;
+ const int w = mDimension.width + bs;
+ const int h = mDimension.height + bs;
+
+ updateCalcFlag(graphics);
+ graphics->drawImageRect(0, 0,
+ w, h,
+ background);
}
BLOCK_END("ScrollArea::drawFrame")
}