Kaydet (Commit) ac2bd6e1 authored tarafından Miklos Vajna's avatar Miklos Vajna Kaydeden (comit) Tomaž Vajngerl

tdf#92982 vcl rendercontext: no need to call SetupBuffer() twice

No need to call it in PaintHelper::StartBufferedPaint(), which would
happen only for the root of the paint hierarchy. It's enough to do it in
PaintHelper::DoPaint(), which happens for each widget.

(cherry picked from commits 27f6b2c0 and
8bb963c3)

Change-Id: Iaf3306ef746bedbe64be36c4efeae73afd75db2a
Reviewed-on: https://gerrit.libreoffice.org/17500Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst fd2bb184
...@@ -52,7 +52,7 @@ private: ...@@ -52,7 +52,7 @@ private:
sal_uInt16 m_nPaintFlags; sal_uInt16 m_nPaintFlags;
bool m_bPop : 1; bool m_bPop : 1;
bool m_bRestoreCursor : 1; bool m_bRestoreCursor : 1;
bool m_bCreatedBuffer : 1; ///< This PaintHelper created the buffer for the double-buffering, and should dispose it when being destructed (if it is still alive by then). bool m_bStartedBufferedPaint : 1; ///< This PaintHelper started a buffered paint, and should paint it on the screen when being destructed.
public: public:
PaintHelper(vcl::Window* pWindow, sal_uInt16 nPaintFlags); PaintHelper(vcl::Window* pWindow, sal_uInt16 nPaintFlags);
void SetPop() void SetPop()
...@@ -103,7 +103,7 @@ PaintHelper::PaintHelper(vcl::Window *pWindow, sal_uInt16 nPaintFlags) ...@@ -103,7 +103,7 @@ PaintHelper::PaintHelper(vcl::Window *pWindow, sal_uInt16 nPaintFlags)
, m_nPaintFlags(nPaintFlags) , m_nPaintFlags(nPaintFlags)
, m_bPop(false) , m_bPop(false)
, m_bRestoreCursor(false) , m_bRestoreCursor(false)
, m_bCreatedBuffer(false) , m_bStartedBufferedPaint(false)
{ {
} }
...@@ -122,9 +122,7 @@ void PaintHelper::StartBufferedPaint() ...@@ -122,9 +122,7 @@ void PaintHelper::StartBufferedPaint()
pFrameData->mpBuffer->Erase(m_aPaintRect); pFrameData->mpBuffer->Erase(m_aPaintRect);
pFrameData->mbInBufferedPaint = true; pFrameData->mbInBufferedPaint = true;
m_bCreatedBuffer = true; m_bStartedBufferedPaint = true;
SetupBuffer();
// Remember what was the map mode of m_aPaintRect. // Remember what was the map mode of m_aPaintRect.
m_aPaintRectMapMode = m_pWindow->GetMapMode(); m_aPaintRectMapMode = m_pWindow->GetMapMode();
...@@ -171,7 +169,7 @@ void PaintHelper::PaintBuffer() ...@@ -171,7 +169,7 @@ void PaintHelper::PaintBuffer()
{ {
ImplFrameData* pFrameData = m_pWindow->mpWindowImpl->mpFrameData; ImplFrameData* pFrameData = m_pWindow->mpWindowImpl->mpFrameData;
assert(pFrameData->mbInBufferedPaint); assert(pFrameData->mbInBufferedPaint);
assert(m_bCreatedBuffer); assert(m_bStartedBufferedPaint);
pFrameData->mpBuffer->mnOutOffX = 0; pFrameData->mpBuffer->mnOutOffX = 0;
pFrameData->mpBuffer->mnOutOffY = 0; pFrameData->mpBuffer->mnOutOffY = 0;
...@@ -524,7 +522,7 @@ PaintHelper::~PaintHelper() ...@@ -524,7 +522,7 @@ PaintHelper::~PaintHelper()
// double-buffering: paint in case we created the buffer, the children are // double-buffering: paint in case we created the buffer, the children are
// already painted inside // already painted inside
if (m_bCreatedBuffer && pFrameData->mbInBufferedPaint) if (m_bStartedBufferedPaint && pFrameData->mbInBufferedPaint)
{ {
PaintBuffer(); PaintBuffer();
pFrameData->mbInBufferedPaint = false; pFrameData->mbInBufferedPaint = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment