diff options
author | Charles Yin <charles.yin@nokia.com> | 2012-05-04 11:21:14 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-04 08:47:38 +0200 |
commit | c96c1d152c8506afb3993f23ac7cf35e46fb808f (patch) | |
tree | ce42c6487326f1ec0a3212c81618a6dcc54e5a11 | |
parent | 4b69c1ad76d86f4c197e6b32e64eb1a4f75c03f7 (diff) |
Fix tile rendering bug for context2d
aboutToDraw() should be called before checking the painter device,
if no device, aboutToDraw() will create a new one.
Also just release the FBO when delete tile, not need to release the fbo
after each draw.
Change-Id: Ida5954f1c65f25f0ce273f732c1608ed49bc148c
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dtile.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/items/context2d/qquickcontext2dtile.cpp b/src/quick/items/context2d/qquickcontext2dtile.cpp index dd416e15af..046300a526 100644 --- a/src/quick/items/context2d/qquickcontext2dtile.cpp +++ b/src/quick/items/context2d/qquickcontext2dtile.cpp @@ -65,8 +65,8 @@ QPainter* QQuickContext2DTile::createPainter(bool smooth) if (m_painter.isActive()) m_painter.end(); + aboutToDraw(); if (m_device) { - aboutToDraw(); m_painter.begin(m_device); m_painter.resetTransform(); m_painter.setCompositionMode(QPainter::CompositionMode_Source); @@ -104,6 +104,8 @@ QQuickContext2DFBOTile::QQuickContext2DFBOTile() QQuickContext2DFBOTile::~QQuickContext2DFBOTile() { + if (m_fbo) + m_fbo->release(); delete m_fbo; } @@ -121,7 +123,6 @@ void QQuickContext2DFBOTile::aboutToDraw() void QQuickContext2DFBOTile::drawFinished() { - m_fbo->release(); } void QQuickContext2DFBOTile::setRect(const QRect& r) |