Merge lp://qastaging/~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-private-shapes into lp://qastaging/ubuntu-ui-toolkit/staging

Proposed by Loïc Molinari
Status: Merged
Approved by: Tim Peeters
Approved revision: no longer in the source branch.
Merged at revision: 1814
Proposed branch: lp://qastaging/~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-private-shapes
Merge into: lp://qastaging/ubuntu-ui-toolkit/staging
Diff against target: 6428 lines (+6334/-3)
11 files modified
src/Ubuntu/Components/plugin/plugin.cpp (+4/-0)
src/Ubuntu/Components/plugin/plugin.pri (+7/-3)
src/Ubuntu/Components/plugin/plugin.qrc (+2/-0)
src/Ubuntu/Components/plugin/privates/frame.cpp (+469/-0)
src/Ubuntu/Components/plugin/privates/frame.h (+101/-0)
src/Ubuntu/Components/plugin/privates/shaders/frame.frag (+33/-0)
src/Ubuntu/Components/plugin/privates/shaders/frame.vert (+34/-0)
src/Ubuntu/Components/plugin/privates/textures.h (+5483/-0)
src/Ubuntu/Components/tools/privates/createprivateshapetextures.cpp (+125/-0)
src/Ubuntu/Components/tools/privates/privates.pro (+5/-0)
tests/resources/ubuntushape/FrameTest.qml (+71/-0)
To merge this branch: bzr merge lp://qastaging/~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-private-shapes
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Tim Peeters Approve
Zsombor Egri Needs Fixing
PS Jenkins bot continuous-integration Approve
Cris Dywan Needs Information
Review via email: mp+281740@code.qastaging.launchpad.net

Commit message

Added private items and nodes for the new component styles.

Description of the change

Added private items and nodes for the new component styles.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

What are the respective use cases for Stroke and StrokeShape? What is size for?

review: Needs Information
Revision history for this message
Cris Dywan (kalikiana) wrote :

> What are the respective use cases for Stroke and StrokeShape? What is size
> for?

Looks like Stroke is a rectangle that isn't filled, which we can use for list items. We need better names :-]
Still unclear what size is. It's not the size of the item.

Revision history for this message
Zsombor Egri (zsombi) wrote :

> > What are the respective use cases for Stroke and StrokeShape? What is size
> > for?
>
> Looks like Stroke is a rectangle that isn't filled, which we can use for list
> items. We need better names :-]
> Still unclear what size is. It's not the size of the item.

What if by default fills the Item and has a negative margin of 1-2 DP? Tbh, this could also be set in the components...

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

> > What are the respective use cases for Stroke and StrokeShape? What is size
> > for?
>
> Looks like Stroke is a rectangle that isn't filled, which we can use for list
> items. We need better names :-]
> Still unclear what size is. It's not the size of the item.

I introduced it during the meeting, I gues I should have also described it here. Stroke is a stroked rectangle, size is the size of the stroke. I could name it StrokeRectangle, and maybe rename size to strokeSize, but I thought it was redundant.

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

StrokeShape is the shape version with an additional radius.

That makes me think that we should actually rename size to stroke, simply.

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

> > > What are the respective use cases for Stroke and StrokeShape? What is size
> > > for?
> >
> > Looks like Stroke is a rectangle that isn't filled, which we can use for
> list
> > items. We need better names :-]
> > Still unclear what size is. It's not the size of the item.
>
> What if by default fills the Item and has a negative margin of 1-2 DP? Tbh,
> this could also be set in the components...

Yes, I'd let it for the components ;)

It's not really complexifying the components and items rendering outside of their area is not really standard and causes a few issues with clipping for isntance.

Revision history for this message
Cris Dywan (kalikiana) wrote :

> StrokeShape is the shape version with an additional radius.
>
> That makes me think that we should actually rename size to stroke, simply.

StrokeRectangle and StrokeShape would make sense to me, you can relate them to the respective non-stroke components.

I think stroke should work. Possibly strokeWidth comes to mind.

1280. By Loïc Molinari

Simplified shader.

1281. By Loïc Molinari

Renamed Stroke to StrokeRectangle.

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

Remains the property name, what about "weight"?

1282. By Loïc Molinari

Forgot renaming StrokeShader.

1283. By Loïc Molinari

Renamed size property to weight.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
1284. By Loïc Molinari

Removed StrokeRectangle.

1285. By Loïc Molinari

Renamed StrokeRectangle to Frame.

1286. By Loïc Molinari

Renamed weight property to thickness.

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

As discussed on IRC, I removed the StrokeRectangle (see [1]), renamed the StrokeShape to Frame and renamed the weight property to thickness.

[1] https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1526813/comments/1

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

In FrameTest.qml, can you use grid units and Label instead of pixels and Text? On a hi-dpi screen the text is unreadable.

review: Needs Fixing
Revision history for this message
Tim Peeters (tpeeters) wrote :

and sync with staging please

Revision history for this message
Tim Peeters (tpeeters) wrote :

262 + // The geometry is made of 8 vertices indexed with a triangle strip mode.

That should be *20* vertices.

Revision history for this message
Tim Peeters (tpeeters) wrote :

285 +const QSGGeometry::AttributeSet& UCFrameNode::attributeSet()

can you add a comment here what the attributes are?

Revision history for this message
Tim Peeters (tpeeters) wrote :

669 + // FMA'd shapeOut * (1.0 - shapeIn)
What is FMA?

    static char const* const attributes[] = {
        "positionAttrib", "texCoord1Attrib", "texCoord2Attrib", "colorAttrib", 0
    };

702 +varying mediump vec2 texCoord1;
703 +varying mediump vec2 texCoord2;

More descriptive names for the texCoord{1,2} would make it more clear what is happening.

Revision history for this message
Tim Peeters (tpeeters) wrote :

It looks like you have a triangle strip with 20 vertices. Did you evaluate whether this is faster than having a simple quad, and discarding all the pixels in the center?

Revision history for this message
Tim Peeters (tpeeters) wrote :

^I guess the triangle strip is fine, since with a large frame that has a thin border there would be a lot of pixels in the center to be discarded.

Revision history for this message
Tim Peeters (tpeeters) wrote :

The properties of Frame are quite straightforward, but still I think in frame.cpp we could have a bit of documentation for the Frame component.

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

> In FrameTest.qml, can you use grid units and Label instead of pixels and Text?
> On a hi-dpi screen the text is unreadable.

I'd prefer not, the point of using pixels in these tests is to visually check the rendering quality and accuracy at the pixel level. Unless you got a better idea?

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

> 669 + // FMA'd shapeOut * (1.0 - shapeIn)
> What is FMA?

Fused Multiply-Add [1]. GPUs got that since ages (Intel started including that recently in x86 [2]) and GLSL compilers often don't optimise that correctly, so it's better to help them detect these forms [3].

[1] https://en.wikipedia.org/wiki/Fused_multiply%E2%80%93add
[2] https://en.wikipedia.org/wiki/FMA_instruction_set
[3] http://www.humus.name/Articles/Persson_LowLevelThinking.pdf

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

> It looks like you have a triangle strip with 20 vertices. Did you evaluate
> whether this is faster than having a simple quad, and discarding all the
> pixels in the center?

It's much much slower. The discard keyword should actually never be used, it prevents GPUs from using early z-cull. See PowerVR's doc [1] on the topic, most constructors provided equivalent recommendations.

[1] Chapter 3.6 "Avoid Using Alpha Test/Discard": http://imgtec.eetrend.com/sites/imgtec.eetrend.com/files/download/201402/1462-2116-powervrdexingnengjianyi.pdf

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

I'll document the properties and use better names for the texture coordinates.

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

Should do that too:
- // FMA'd shapeOut * (1.0 - shapeIn)
+ // Fused multiply-add friendly version of (shapeOut * (1.0 - shapeIn))

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

I have one request: could you replace the Ubuntu.Components.Themes.Ambiance.FocusFrame implementation with this? Or the entire component eventually...

review: Needs Fixing
Revision history for this message
Tim Peeters (tpeeters) wrote :

All good.

Thanks for the references :)

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches