Commit c96c1d15 authored by Charles Yin's avatar Charles Yin Committed by Qt by Nokia
Browse files

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: default avatarMichael Brasser <michael.brasser@nokia.com>
parent 4b69c1ad
No related merge requests found
Showing with 3 additions and 2 deletions
...@@ -65,8 +65,8 @@ QPainter* QQuickContext2DTile::createPainter(bool smooth) ...@@ -65,8 +65,8 @@ QPainter* QQuickContext2DTile::createPainter(bool smooth)
if (m_painter.isActive()) if (m_painter.isActive())
m_painter.end(); m_painter.end();
aboutToDraw();
if (m_device) { if (m_device) {
aboutToDraw();
m_painter.begin(m_device); m_painter.begin(m_device);
m_painter.resetTransform(); m_painter.resetTransform();
m_painter.setCompositionMode(QPainter::CompositionMode_Source); m_painter.setCompositionMode(QPainter::CompositionMode_Source);
...@@ -104,6 +104,8 @@ QQuickContext2DFBOTile::QQuickContext2DFBOTile() ...@@ -104,6 +104,8 @@ QQuickContext2DFBOTile::QQuickContext2DFBOTile()
QQuickContext2DFBOTile::~QQuickContext2DFBOTile() QQuickContext2DFBOTile::~QQuickContext2DFBOTile()
{ {
if (m_fbo)
m_fbo->release();
delete m_fbo; delete m_fbo;
} }
...@@ -121,7 +123,6 @@ void QQuickContext2DFBOTile::aboutToDraw() ...@@ -121,7 +123,6 @@ void QQuickContext2DFBOTile::aboutToDraw()
void QQuickContext2DFBOTile::drawFinished() void QQuickContext2DFBOTile::drawFinished()
{ {
m_fbo->release();
} }
void QQuickContext2DFBOTile::setRect(const QRect& r) void QQuickContext2DFBOTile::setRect(const QRect& r)
......
Supports Markdown
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