Merge lp://staging/~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-resolution-independance into lp://staging/ubuntu-ui-toolkit/staging
- ubuntu-ui-toolkit-resolution-independance
- Merge into staging
Status: | Merged |
---|---|
Approved by: | Zsombor Egri |
Approved revision: | 1363 |
Merged at revision: | 1477 |
Proposed branch: | lp://staging/~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-resolution-independance |
Merge into: | lp://staging/ubuntu-ui-toolkit/staging |
Diff against target: |
9515 lines (+1764/-7091) 15 files modified
components.api (+4/-1) debian/copyright (+23/-0) modules/Ubuntu/Components/plugin/shaders/shape.frag (+47/-11) modules/Ubuntu/Components/plugin/shaders/shapeoverlay.frag (+48/-11) modules/Ubuntu/Components/plugin/ucubuntushape.cpp (+309/-301) modules/Ubuntu/Components/plugin/ucubuntushape.h (+37/-25) modules/Ubuntu/Components/plugin/ucubuntushapeoverlay.cpp (+85/-176) modules/Ubuntu/Components/plugin/ucubuntushapeoverlay.h (+2/-2) modules/Ubuntu/Components/plugin/ucubuntushapetexture.h (+268/-6519) modules/Ubuntu/Components/tools/3rd_party/edtaa3func.c (+570/-0) modules/Ubuntu/Components/tools/createshapeimage.cpp (+231/-0) modules/Ubuntu/Components/tools/shape.svg (+77/-0) modules/Ubuntu/Components/tools/tools.pro (+5/-0) tests/resources/ubuntushape/UbuntuShapeOverlayTest.qml (+44/-37) tests/resources/ubuntushape/UbuntuShapeTest.qml (+14/-8) |
To merge this branch: | bzr merge lp://staging/~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-resolution-independance |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Peeters | Needs Fixing | ||
PS Jenkins bot | continuous-integration | Approve | |
Zsombor Egri | Approve | ||
Timo Jyrinki | license | Approve | |
Michael Zanetti (community) | Needs Fixing | ||
Florian Boucault | Pending | ||
Review via email: mp+252492@code.staging.launchpad.net |
Commit message
Description of the change
[UbuntuShape] Added support for resolution independent rendering.
Loïc Molinari (loic.molinari) wrote : | # |
Hey Michael, thanks for the report. This issue has been here for a while, so in order to avoid confusing that already big patch, I'll fix it in another branch.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1353
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1354. By Loïc Molinari
-
Ensured rendering is the same as it was before switching to distance fields.
- 1355. By Loïc Molinari
-
Fixed typo.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1355
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1356. By Loïc Molinari
-
Merged lp:ubuntu-ui-toolkit/staging.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1356
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Tim Peeters (tpeeters) wrote : | # |
54 uniform bool textured;
55 +uniform mediump int aspect;
56
57 varying mediump vec2 shapeCoord;
58 varying mediump vec4 sourceCoord;
59 varying lowp vec4 backgroundColor;
60
61 +const mediump int FLAT = 0x08; // 1 << 3
62 +const mediump int INSET = 0x10; // 1 << 4
are medium precision values no problem in the fragment shader, as it was here in the vertex shader? https:/
Tim Peeters (tpeeters) wrote : | # |
105 + // Blend the shape inner shadow over the current color. The shadow color is black, its
106 + // translucency is stored in the texture.
107 + lowp float shadow = shapeData[
108 + color = vec4(1.0 - shadow) * color + vec4(0.0, 0.0, 0.0, shadow);
Do you need anti-aliasing for the shadow? As I understand this code, it is either on or off.
Tim Peeters (tpeeters) wrote : | # |
379 + // The geometry is made of 9 vertices indexed with a triangle strip mode.
380 + // 0 - 1 - 2
381 + // | / | / |
382 + // 3 - 4 - 5
383 + // | / | / |
384 + // 6 - 7 - 8
Why do you need a triangle strip? Couldn't it be done with a single quad? (or two triangles)
Tim Peeters (tpeeters) wrote : | # |
The results look ugly on my laptop, see https:/
Loïc Molinari (loic.molinari) wrote : | # |
> 54 uniform bool textured;
> 55 +uniform mediump int aspect;
> 56
> 57 varying mediump vec2 shapeCoord;
> 58 varying mediump vec4 sourceCoord;
> 59 varying lowp vec4 backgroundColor;
> 60
> 61 +const mediump int FLAT = 0x08; // 1 << 3
> 62 +const mediump int INSET = 0x10; // 1 << 4
>
>
> are medium precision values no problem in the fragment shader, as it was here
> in the vertex shader? https:/
No, I don't think so, since these are integer values. But I'm going to test on arale since I got it flashed now.
Loïc Molinari (loic.molinari) wrote : | # |
> 105 + // Blend the shape inner shadow over the current color. The
> shadow color is black, its
> 106 + // translucency is stored in the texture.
> 107 + lowp float shadow = shapeData[
> 108 + color = vec4(1.0 - shadow) * color + vec4(0.0, 0.0, 0.0,
> shadow);
>
> Do you need anti-aliasing for the shadow? As I understand this code, it is
> either on or off.
This has nothing to do with antialiasing. shapeData[0] contains the top shadow, shapeData[1] contains the bottom shadow. This is needed because shadowing is different on top and bottom of the shape, the shadow distance on the top is higher than on the bottom.
Tim Peeters (tpeeters) wrote : | # |
Do we know whether the copyright notice from edtaa3func.c needs to be included anywhere else besides in the source file itself?
Loïc Molinari (loic.molinari) wrote : | # |
> 379 + // The geometry is made of 9 vertices indexed with a triangle
> strip mode.
> 380 + // 0 - 1 - 2
> 381 + // | / | / |
> 382 + // 3 - 4 - 5
> 383 + // | / | / |
> 384 + // 6 - 7 - 8
>
> Why do you need a triangle strip? Couldn't it be done with a single quad? (or
> two triangles)
It can't be done with a quad.
I need to have shape coordinate like that to correctly sample from the distance field:
(1,1) (0,1) - (0,1) (1,1)
(1,0) (0,0) (0,0) (1,0)
| |
(1,0) (0,0) (0,0) (1,0)
(1,0) (0,0) - (0,0) (1,0)
It looks like that should be done with 16 vertices, but 9 vertices can do it with middle coordinates set appropriately. Note that I could use 4 vertices like that:
(-1,-1) - (1,-1)
| |
(-1, 1) - (1, 1)
but that would require affine an affine transformation in the vertex shader with dedicated values for each shape, which would prevent the shapes to be batched together be the batched renderer. That's why I try to store all the per-shape values in the vertices (like for the colors).
Tim Peeters (tpeeters) wrote : | # |
Loic, do you think that having a different fragment shader depending on texture and aspect instead of the three if statements in shape.frag could increase the performance even more? Or just two different shaders for the different aspects.
Loïc Molinari (loic.molinari) wrote : | # |
> Do we know whether the copyright notice from edtaa3func.c needs to be included
> anywhere else besides in the source file itself?
There's a few licencing issues we'd need to solve. Can edtaa3func.c MIT code be linked to a LGPL3 binary? Should we update debian files (I guess yes, but I don't know what)? All our binary files (executables, not libraries or plugins) or scripts are LGPL3, shouldn't that be GPL3?
Loïc Molinari (loic.molinari) wrote : | # |
> The results look ugly on my laptop, see https:/
> 07h/Screenshot%
> 5s0u4vg9veo00m0
Mmmh, strange. Do you have support for standard derivatives on your system (dFdy() and dFdx())?
Tim Peeters (tpeeters) wrote : | # |
> > The results look ugly on my laptop, see
> https:/
> > 07h/Screenshot%
> https:/
> > 5s0u4vg9veo00m0
>
> Mmmh, strange. Do you have support for standard derivatives on your system
> (dFdy() and dFdx())?
from glxinfo:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 10.5.0-rc2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_OES_
Loïc Molinari (loic.molinari) wrote : | # |
> Loic, do you think that having a different fragment shader depending on
> texture and aspect instead of the three if statements in shape.frag could
> increase the performance even more? Or just two different shaders for the
> different aspects.
Having different shaders (as we had before) would imply an exponential number of shaders and would make maintenance a nightmare. GPUs have a feature called static flow control which means that when we branch on a fixed uniform variable, the driver can create a dedicated shader with the unused branch shaved off the code. This is also called über-shader and is used a lot in games.
Tim Peeters (tpeeters) wrote : | # |
With this shader, the inset renders perfectly: http://
There may be something weird happening related to the 'aspect' uniform.
Tim Peeters (tpeeters) wrote : | # |
<loicm> timp: could you try with that? (http://
I tried^, and it gives the same bad results.
Loïc Molinari (loic.molinari) wrote : | # |
Putting dFd*() calls outside of branches (even if uniform based, as accepted by the spec) fixes it. Will update the code.
Timo Jyrinki (timo-jyrinki) wrote : | # |
For GPL/LGPL, I don't know if there's a strict policy as long as libraries are LGPL and v3 of either license is in use. Considering the core parts of UITK are used in non-defined amount of applications (including possibly proprietary ones), it's probably easiest to just state that UITK is LGPLv3.
MIT license is fine: http://
Please update debian/copyright following the machine readable format it is in. That is, add at the bottom:
File: path/to/
Copyright: 201x, copyright owner
License: MIT
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
- 1357. By Loïc Molinari
-
Tweaked constant.
- 1358. By Loïc Molinari
-
Updated Debian copyright.
Timo Jyrinki (timo-jyrinki) : | # |
- 1359. By Loïc Molinari
-
Worked around a standard derivatives bug in Mesa.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1358
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1360. By Loïc Molinari
-
Tweaked constant.
Tim Peeters (tpeeters) wrote : | # |
The visuals are good now!
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1360
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1361. By Loïc Molinari
-
Pleased license checking CI.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1361
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Tim Peeters (tpeeters) wrote : | # |
All looks good to me!
- 1362. By Loïc Molinari
-
Fixed a comment.
- 1363. By Loïc Molinari
-
Adapted screen-space derivatives to screen orientation.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1363
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) : | # |
Tim Peeters (tpeeters) wrote : | # |
Does not look good to me. The rendering issue that we discussed before came back.
I suspect this is the guilty change:
60 lowp float dfdt = dFdy(shapeCoord.t);
60 lowp float dfdt = dfdtFactors.x != 0.0 ? dFdy(shapeCoord.t) : dFdx(shapeCoord.t);
setImplicitWidt h/setImplicitHe ight are used wrong. They are set to a hardcoded size wile instead they should reflect the real size of the loaded content.
In case of an image, they should reflect the actual pixel size of the loaded image, while for generated rectangles, it should match the set widht/height.