Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/sgtileitem-keep-data into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi
Status: Merged
Approved by: Stefano Verzegnassi
Approved revision: 279
Merged at revision: 282
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/sgtileitem-keep-data
Merge into: lp:ubuntu-docviewer-app
Diff against target: 13 lines (+0/-3)
1 file modified
src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.cpp (+0/-3)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/sgtileitem-keep-data
Reviewer Review Type Date Requested Status
Roman Shchekin Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+283958@code.launchpad.net

Commit message

SGTileItem: keep QImage data so that QSG don't fail on repainting

Description of the change

Sometimes we get some blank tile when rendering a document.
This happens only when a document is loaded for the first time: the tile gets painted with the proper texture, then it becomes blank.

I don't know much how the Qt SceneGraph works behind the scenes, but it seems that it deletes the old node of a tile when an update() is requested.
Since m_data is null when that happens, SGTileItem does not repaint the node texture as expected.

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Roman Shchekin (mrqtros) wrote :

LGTM, only one question - should we also remove property? Sorry for dumb question, but I am away from source code :)

review: Approve
Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Do you mean the getter and setter for m_data?
I guess we should keep them, since we need to store the QImage returned by the RenderEngine as long as the tile is not deleted.

The Qt SceneGraph seems to repaint the node randomly several times when the tile is created and, if it does not find any QImage (because we delete it after the first paint), it just deletes the whole node, resulting in a portion of document not rendered on screen.

This is more a workaround, we probably could refine the code after the release.

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Anyway, this was the last issue with paiting we found in these 7 months.
As this branch lands, we can say that the first part of the work on LOK plugin is completed! \o/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.cpp'
2--- src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.cpp 2016-01-21 00:29:15 +0000
3+++ src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.cpp 2016-01-26 14:02:47 +0000
4@@ -32,9 +32,6 @@
5 node->setOwnsTexture(true);
6 node->setRect(m_area);
7
8- // We don't need anymore QImage's data
9- m_data = QImage();
10-
11 #ifdef DEBUG_SHOW_TILE_BORDER
12 drawTileBorders(node);
13 #endif

Subscribers

People subscribed via source and target branches