shadowproject / shadow

ShadowCore integration/staging tree
MIT License
95 stars 62 forks source link

High resolution displays #54

Open bpierre opened 7 years ago

bpierre commented 7 years ago

Is there any plan to support hi-res displays?

I tried to set QT_DEVICE_PIXEL_RATIO (Qt 5.4) and QT_SCALE_FACTOR (Qt 5.6) without any success, as Umbra seem to target Qt 5.3.

bpierre commented 7 years ago

High resolution in Qt: http://doc.qt.io/qt-5/highdpi.html

bpierre commented 7 years ago

I investigated a bit more, and the problem is simply because the assets are in low resolution.

Example with the logo, its dimensions are 150x60, and it is meant to be displayed at 150x60. On screens with a pixel density of 2, it will be upscaled to 300x120.

Two solutions:

If we want to have dedicated files (e.g. we might want icons to be thinner on high res screens), Qt allow to use the @2x syntax to dynamically load high res assets.

@rynomster Are the sources of the assets freely available?

It also looks like there is a problem when GPU effects are used, as if the engine were rendering them without taking the pixel density into consideration. For example, if you remove the transform, -webkit-backface-visibility and -webkit-perspective properties that are set on .page-sidebar, the fonts will be rendered properly (instead of being upscaled from a low resolution).

Porting the code to Qt WebEngine could solve the problem, but it wouldn’t hurt to investigate and check if these CSS optimizations are still useful today, as some of these optimizations can do more harm than good as the browser engine changes.

rynomster commented 7 years ago

Unfortunately we can't upgrade to qtwebengine as you can't compile it statically. We've played around with it but it doesn't help if we can't compile for all operating systems. We've seen the blur and have marked it as an issue, so it will be resolved soon enough. I'm also testing Qt webkit 5.7, the community edition at the moment. We'll upgrade soon enough :)

The resources are all in our repo, under src/qt/res/assets.

I'll let you know as soon as I've had a chance to test

On Sep 23, 2016 17:43, "Pierre Bertet" notifications@github.com wrote:

I investigated a bit more, and the problem is simply because the assets are in low resolution.

Example with the logo https://raw.githubusercontent.com/shadowproject/shadow/master/src/qt/res/assets/img/shadow_logo.png, its dimensions are 150x60, and it is meant to be displayed at 150x60. On screens with a pixel density of 2, it will be upscaled to 300x120.

Two solutions:

  • Using x2 assets for everything (they will be downscaled to x1 on low res screens)
  • Using SVG files (better for the future, as it would work on other pixel densities than 1 and 2)

If we want to have dedicated files (e.g. we might want icons to be thinner on high res screens), Qt allow to use the @2x syntax https://blog.qt.io/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/ to dynamically load high res assets.

@rynomster https://github.com/rynomster Are the sources of the assets freely available?

It also looks like there is a problem when GPU effects are used, as if the engine were rendering them without taking the pixel density into consideration. For example, if you remove the transform, -webkit-backface-visibility and -webkit-perspective properties that are set on .page-sidebar, the fonts will be rendered properly (instead of being upscaled from a low resolution).

Porting the code to Qt WebEngine http://doc.qt.io/qt-5/qtwebenginewidgets-qtwebkitportingguide.html could solve the problem, but it wouldn’t hurt to investigate and check if these CSS optimizations are still useful today, as some of these optimizations can do more harm than good as the browser engine changes.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shadowproject/shadow/issues/54#issuecomment-249227866, or mute the thread https://github.com/notifications/unsubscribe-auth/AGl7Fbmk-i7hem10eW_adq2b60sBZA29ks5qs_OzgaJpZM4KDC-Z .

bpierre commented 7 years ago

The resources are all in our repo, under src/qt/res/assets.

Yes, but these are the final exports and are in @1x resolution. I was talking about the original sources used to create these assets (.svg, .sketch, .ai), so we can re-export them at @2x.

rynomster commented 7 years ago

Right, I didn't know you were talking about the vectors.. I'll see which ones I have, I don't have the umbra vectors but I know who does. We'll get them exported, but it's a good idea to have the vectors on gh somewhere

On Sep 23, 2016 18:23, "Pierre Bertet" notifications@github.com wrote:

The resources are all in our repo, under src/qt/res/assets.

These are the final exports and are in @1x https://github.com/1x resolution. I was talking about the original sources used to create these assets (.svg, .sketch, .ai), so we can re-export them at @2x https://github.com/2x.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shadowproject/shadow/issues/54#issuecomment-249237696, or mute the thread https://github.com/notifications/unsubscribe-auth/AGl7FVMMLpzsiG6FdwkS2Z6MrCukmaDCks5qs_zrgaJpZM4KDC-Z .

bpierre commented 7 years ago

Cool, a script could automate the export from these sources.

Question: I don’t see much activity here, is the project opened to external contributions at all, or is GitHub just used to publish the code and the releases?

rynomster commented 7 years ago

The gui was done more internally, we have a little group on slack. We are open to contributions, but we're giving it some time before we publish all the full sources, due to all the clone coins that have happened and never contributed back. We'll probably put the full sources on gh next month, currently we just have the minified sources on here for the new gui

On Sep 23, 2016 18:54, "Pierre Bertet" notifications@github.com wrote:

Cool, a script could automate the export from these sources.

Question: I don’t see much activity here, is the project opened to external contributions at all, or is GitHub just used to publish the code and the releases?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shadowproject/shadow/issues/54#issuecomment-249245107, or mute the thread https://github.com/notifications/unsubscribe-auth/AGl7FVxxcgypEOEsFmD-R59HWMyJIjI3ks5qtAREgaJpZM4KDC-Z .

kewde commented 7 years ago

For example, if you remove the transform, -webkit-backface-visibility and -webkit-perspective properties that are set on .page-sidebar, the fonts will be rendered properly (instead of being upscaled from a low resolution).

Hmm might be worth taking these out then. @crz- are these necessary or can the be removed?


Most activity happens through a few developers so most discussion happens through different channels, other than GitHub but we're moving towards a more open community for developers.