Merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-disconnect-from-texture-changed2 into lp:ubuntu-ui-toolkit/staging

Proposed by Loïc Molinari
Status: Merged
Approved by: Florian Boucault
Approved revision: 1177
Merged at revision: 1177
Proposed branch: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-disconnect-from-texture-changed2
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 72 lines (+20/-3)
2 files modified
modules/Ubuntu/Components/plugin/shapeitem.cpp (+18/-3)
modules/Ubuntu/Components/plugin/shapeitem.h (+2/-0)
To merge this branch: bzr merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-disconnect-from-texture-changed2
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Florian Boucault Pending
Review via email: mp+229275@code.launchpad.net

Commit message

[UbuntuShape] Disconnected from old texture provider signals.

Description of the change

[UbuntuShape] Disconnected from old texture provider signals.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1177
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/708/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2937
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2325
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/540
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/540
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/540/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/540
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2998
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4180
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4180/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10885
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1925
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2591
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2591/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/708/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/plugin/shapeitem.cpp'
2--- modules/Ubuntu/Components/plugin/shapeitem.cpp 2014-05-20 20:02:38 +0000
3+++ modules/Ubuntu/Components/plugin/shapeitem.cpp 2014-08-01 19:48:48 +0000
4@@ -132,6 +132,7 @@
5
6 ShapeItem::ShapeItem(QQuickItem* parent)
7 : QQuickItem(parent)
8+ , provider_(NULL)
9 , color_(0.0, 0.0, 0.0, 0.0)
10 , gradientColor_(0.0, 0.0, 0.0, 0.0)
11 , gradientColorSet_(false)
12@@ -356,6 +357,12 @@
13 }
14 }
15
16+void ShapeItem::providerDestroyed(QObject* object)
17+{
18+ Q_UNUSED(object);
19+ provider_ = NULL;
20+}
21+
22 QSGNode* ShapeItem::updatePaintNode(QSGNode* old_node, UpdatePaintNodeData* data)
23 {
24 Q_UNUSED(data);
25@@ -394,7 +401,7 @@
26 // detected when the texture provider exists but not the texture itself. When that's the case we
27 // push the shape item in the dirty list to be handled next frame and we tell QtQuick not to
28 // render the item for the current frame.
29- const QSGTextureProvider* provider = image_ ? image_->textureProvider() : NULL;
30+ QSGTextureProvider* provider = image_ ? image_->textureProvider() : NULL;
31 const QSGTexture* texture = provider ? provider->texture() : NULL;
32 if (provider && !texture) {
33 update();
34@@ -403,8 +410,16 @@
35 }
36
37 // Update the node whenever the source item's texture changes.
38- if ((dirtyFlags_ & ShapeItem::DirtyImage) && provider) {
39- QObject::connect(provider, SIGNAL(textureChanged()), this, SLOT(update()));
40+ if (provider != provider_) {
41+ if (provider_) {
42+ QObject::disconnect(provider_, SIGNAL(textureChanged()), this, SLOT(update()));
43+ QObject::disconnect(provider_, SIGNAL(destroyed()), this, SLOT(providerDestroyed()));
44+ }
45+ if (provider) {
46+ QObject::connect(provider, SIGNAL(textureChanged()), this, SLOT(update()));
47+ QObject::connect(provider, SIGNAL(destroyed()), this, SLOT(providerDestroyed()));
48+ }
49+ provider_ = provider;
50 }
51
52 ShapeNode* node = static_cast<ShapeNode*>(old_node);
53
54=== modified file 'modules/Ubuntu/Components/plugin/shapeitem.h'
55--- modules/Ubuntu/Components/plugin/shapeitem.h 2014-05-09 08:10:02 +0000
56+++ modules/Ubuntu/Components/plugin/shapeitem.h 2014-08-01 19:48:48 +0000
57@@ -92,6 +92,7 @@
58 private Q_SLOTS:
59 void onImagePropertiesChanged();
60 void onOpenglContextDestroyed();
61+ void providerDestroyed(QObject* object=0);
62
63 private:
64 enum DirtyFlags {
65@@ -117,6 +118,7 @@
66 QSGTexture* low;
67 };
68
69+ QSGTextureProvider* provider_;
70 QColor color_;
71 QColor gradientColor_;
72 bool gradientColorSet_;

Subscribers

People subscribed via source and target branches