Merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-batched-renderer-support-for-ubuntushape2 into lp:ubuntu-ui-toolkit/staging

Proposed by Loïc Molinari
Status: Merged
Approved by: Zsombor Egri
Approved revision: 1178
Merged at revision: 1178
Proposed branch: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-batched-renderer-support-for-ubuntushape2
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 58 lines (+23/-0)
2 files modified
modules/Ubuntu/Components/plugin/shapeitem.cpp (+21/-0)
modules/Ubuntu/Components/plugin/shapeitem.h (+2/-0)
To merge this branch: bzr merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-batched-renderer-support-for-ubuntushape2
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Gerry Boland Pending
Florian Boucault Pending
Review via email: mp+229301@code.launchpad.net

Commit message

[UbuntuShape] Implemented QSGMaterial::compare() methods so that shapes can be batched.

Description of the change

[UbuntuShape] Implemented QSGMaterial::compare() methods so that shapes can be batched.

To post a comment you must log in.
Revision history for this message
Loïc Molinari (loic.molinari) wrote :

Resubmitted with staging merge.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1178
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/709/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2940
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2328
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/541
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/541
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/541/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/541
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3001
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4183
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4183/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10888
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1928
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2594
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2594/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/709/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-08-01 19:45:43 +0000
3+++ modules/Ubuntu/Components/plugin/shapeitem.cpp 2014-08-01 22:28:00 +0000
4@@ -702,6 +702,17 @@
5 return new ShapeTexturedShader;
6 }
7
8+int ShapeTexturedMaterial::compare(const QSGMaterial* other) const
9+{
10+ const ShapeTexturedMaterial* otherMaterial = static_cast<const ShapeTexturedMaterial*>(other);
11+ const QSGTextureProvider* otherTextureProvider = otherMaterial->imageTextureProvider();
12+ const QSGTexture* otherTexture = otherTextureProvider ? otherTextureProvider->texture() : NULL;
13+ const int otherTextureId = otherTexture ? otherTexture->textureId() : 0;
14+ const QSGTexture* texture = imageTextureProvider_ ? imageTextureProvider_->texture() : NULL;
15+ const int textureId = texture ? texture->textureId() : 0;
16+ return textureId - otherTextureId;
17+}
18+
19 void ShapeTexturedMaterial::setImage(QQuickItem* image)
20 {
21 imageTextureProvider_ = image ? image->textureProvider() : NULL;
22@@ -803,6 +814,16 @@
23 return new ShapeColoredShader;
24 }
25
26+int ShapeColoredMaterial::compare(const QSGMaterial* other) const
27+{
28+ const ShapeColoredMaterial* otherMaterial = static_cast<const ShapeColoredMaterial*>(other);
29+ if ((color_ != otherMaterial->color()) || (gradientColor_ != otherMaterial->gradientColor())) {
30+ return -1;
31+ } else {
32+ return 0;
33+ }
34+}
35+
36 void ShapeColoredMaterial::setColor(const QColor& color)
37 {
38 // Premultiply color components by alpha.
39
40=== modified file 'modules/Ubuntu/Components/plugin/shapeitem.h'
41--- modules/Ubuntu/Components/plugin/shapeitem.h 2014-08-01 19:45:43 +0000
42+++ modules/Ubuntu/Components/plugin/shapeitem.h 2014-08-01 22:28:00 +0000
43@@ -146,6 +146,7 @@
44 ShapeTexturedMaterial();
45 virtual QSGMaterialType* type() const;
46 virtual QSGMaterialShader* createShader() const;
47+ virtual int compare(const QSGMaterial* other) const;
48 QSGTextureProvider* imageTextureProvider() const;
49 void setImage(QQuickItem* image);
50 QSGTexture* shapeTexture() const { return shapeTexture_; }
51@@ -185,6 +186,7 @@
52 ShapeColoredMaterial();
53 virtual QSGMaterialType* type() const;
54 virtual QSGMaterialShader* createShader() const;
55+ virtual int compare(const QSGMaterial* other) const;
56 const QVector4D& color() const { return color_; }
57 void setColor(const QColor& color);
58 const QVector4D& gradientColor() const { return gradientColor_; }

Subscribers

People subscribed via source and target branches