Merge lp:~mterry/unity8/bleeding-infographic into lp:unity8

Proposed by Michael Terry
Status: Merged
Approved by: Michael Terry
Approved revision: 1599
Merged at revision: 1608
Proposed branch: lp:~mterry/unity8/bleeding-infographic
Merge into: lp:unity8
Diff against target: 57 lines (+9/-0)
2 files modified
qml/Greeter/GreeterContent.qml (+1/-0)
tests/mocks/libusermetrics/UserMetrics.cpp (+8/-0)
To merge this branch: bzr merge lp:~mterry/unity8/bleeding-infographic
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Gerry Boland (community) Approve
Albert Astals Cid (community) Abstain
Daniel d'Andrada (community) Needs Information
Review via email: mp+249223@code.launchpad.net

Commit message

Clip the infographic to its bounding box, instead of letting it bleed past the welcome page (visible when dragging the welcome page to the side).

I've also done a bit of cleanup for the mock infographic data:
 - I've forced a very large data bubble on the right side of the screen so that this bug/fix can specifically be seen.
 - I've added data for the has-pin user (so that tryShellWithPin shows infographic data).
 - I've fixed a crasher in our mock libusermetrics when a user has no data but the user double-clicked on the infographic.

Description of the change

Clip the infographic to its bounding box, instead of letting it bleed past the welcome page (visible when dragging the welcome page to the side).

I've also done a bit of cleanup for the mock infographic data:
 - I've forced a very large data bubble on the right side of the screen so that this bug/fix can specifically be seen.
 - I've added data for the has-pin user (so that tryShellWithPin shows infographic data).
 - I've fixed a crasher in our mock libusermetrics when a user has no data but the user double-clicked on the infographic.

= Checklist =

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 Yes, you can see it clearly with tryShell or tryShellWithPin

 * Did you make sure that your branch does not contain spurious tags?
 Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 NA

 * If you changed the UI, has there been a design review?
 NA

To post a comment you must log in.
1597. By Michael Terry

More comments

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Are you aware of the performance impact caused by clipping? Isn't there any other way to achieve what you need?

review: Needs Information
Revision history for this message
Michael Terry (mterry) wrote :

No, I forgot that clipping was a performance no-no. Hrm. :(

I could scale all bubbles to fit within the welcome page... But that might need Design bye-in.

Revision history for this message
Michael Terry (mterry) wrote :

Is there an easy way to measure it's effect?

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> Is there an easy way to measure it's effect?

Nothing comes to mind.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

> Are you aware of the performance impact caused by clipping? Isn't there any
> other way to achieve what you need?
can't we just clip when needed? just when swiping greeter for example (x coordinate)? then we can make the infographics disappear when is out of screen

1598. By Michael Terry

Only clip while swiping the greeter

Revision history for this message
Michael Terry (mterry) wrote :

> can't we just clip when needed? just when swiping greeter for example (x coordinate)?

Fair point. I've done that and added a comment on why it's more complicated than simply 'clip: true'

> then we can make the infographics disappear when is out of screen

That already happens. This bug is only visible while swiping the greeter.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Honestly i am not sure this last change is better than just
  clip: true

Because we have an extra binding to evaluate and we have a clipping change just when the swiping starts, changing the clipping means recalculating the scene graph (i think) so not totally convinced that it's really faster as it is now.

OTOH we may just discussing over something that doesn't really matter much, it's not like the performance in this specific part matters that much i'd say

Revision history for this message
Albert Astals Cid (aacid) :
review: Abstain
Revision history for this message
Michael Terry (mterry) wrote :

Sounds like I need to get some actual performance numbers here.

On Wed, Feb 11, 2015 at 10:36 AM, Albert Astals Cid <
<email address hidden>> wrote:

> Review: Abstain
>
>
> --
>
> https://code.launchpad.net/~mterry/unity8/bleeding-infographic/+merge/249223
> You are the owner of lp:~mterry/unity8/bleeding-infographic.
>

--
-mt

Revision history for this message
MichaƂ Sawicz (saviq) wrote :

Yeah, without numbers there's only so much we can do. But maybe there's better ways? Can we not make it visible: false? Change the z-order? It's not as if we're interested in the contents that just got clipped - they're offscreen after all?

Revision history for this message
Michael Terry (mterry) wrote :

Saviq, it's not about the objects being wholly off screen. It's just that the circles bleed past the screen a bit:
http://i.imgur.com/X3TsyC9.jpg

Revision history for this message
Gerry Boland (gerboland) wrote :

A one-off clip of an un-rotated rectangular item is not particularly costly. Where clipping really has an impact is for rotated or non-rectangular things, or if you're clipping part of a delegate of a list/grid view (as it breaks batching)

Turning on/off clipping dynamically just adds/removes a ClipNode from the scenegraph at the root of the Infographics' subtree. That usually kicks off a rebatching scan, but as the contents of the Infographics item is pretty unique, I don't expect any batch changes to occur.

Overall I doubt this change mas much impact on rendering speed. To check, simplest is to set QSG_RENDER_TIMING=1, but hard to make accurate comparison that way.

review: Approve
1599. By Michael Terry

Go back to simple clip: true

Revision history for this message
Michael Terry (mterry) wrote :

OK, went back to clip: true based on IRC talk.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Greeter/GreeterContent.qml'
2--- qml/Greeter/GreeterContent.qml 2015-01-23 19:47:37 +0000
3+++ qml/Greeter/GreeterContent.qml 2015-02-11 16:04:25 +0000
4@@ -121,6 +121,7 @@
5 objectName: "infographics"
6 height: narrowMode ? parent.height : 0.75 * parent.height
7 model: greeterContentLoader.infographicModel
8+ clip: true // clip large data bubbles
9
10 property string selectedUser
11 property string infographicUser: AccountsService.statsWelcomeScreen ? selectedUser : ""
12
13=== modified file 'tests/mocks/libusermetrics/UserMetrics.cpp'
14--- tests/mocks/libusermetrics/UserMetrics.cpp 2014-10-01 11:09:25 +0000
15+++ tests/mocks/libusermetrics/UserMetrics.cpp 2015-02-11 16:04:25 +0000
16@@ -289,6 +289,7 @@
17 new UserMetricsData("<b>52km</b> travelled", first, firstMonth,
18 ninth, secondMonth, this));
19 m_fakeData.insert("single", data);
20+ m_fakeData.insert("has-pin", data);
21 }
22
23 {
24@@ -304,12 +305,14 @@
25 new UserMetricsData("<b>33</b> messages today", second,
26 firstMonth, eighth, secondMonth, this));
27 m_fakeData.insert("single", data);
28+ m_fakeData.insert("has-pin", data);
29 }
30
31 {
32 QVariantList firstMonth;
33 while (firstMonth.size() < 17)
34 firstMonth.push_back(QVariant(rand()));
35+ firstMonth[8] = QVariant(1.0); // oversized 9th day, to test clipping
36 while (firstMonth.size() < 31)
37 firstMonth.push_back(QVariant());
38 QVariantList secondMonth;
39@@ -319,6 +322,7 @@
40 new UserMetricsData("<b>19</b> minutes talk time", eighth,
41 firstMonth, second, secondMonth, this));
42 m_fakeData.insert("single", data);
43+ m_fakeData.insert("has-pin", data);
44 // Also use same data for some tablet users
45 m_fakeData.insert("has-password", data);
46 m_fakeData.insert("no-password", data);
47@@ -386,6 +390,10 @@
48 if (m_dataIndex == m_fakeData.constEnd() || m_dataIndex.key() != m_username)
49 {
50 m_dataIndex = m_fakeData.constFind(m_username);
51+ if (m_dataIndex == m_fakeData.constEnd())
52+ {
53+ m_dataIndex = m_fakeData.constFind("");
54+ }
55 }
56
57 loadFakeData();

Subscribers

People subscribed via source and target branches