Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Correct Implementation for HiDPI

Hi,

> Then we have the paint problems Tom mentioned, right? Then we only have the half resolution available and we can't paint exact pixels any more, right?

I believe you would be using GC.drawPoint() API to draw/paint a point(at 100% it would be pixel). This API did not change.

In HiDpi the arithmetic has been changed from pixel to point. At 100% a point on the screen occupies 1 pixel. At 200% it will occupy 4 pixels(2 pixels wide and 2 pixels high). Currently we don't have finer control for drawing using GC.
The drawing always done in point arithmetic in all platforms so the clients have common API and for use across all scale levels.

In Mac we Draw using 100% scale canvas and scale it up while showing the canvas. So you will have blurry images.
In Windows and linux we use scaled up positions with canvas created to scaled size. So the images are sharper

If you can give us the exact use case I will be able find a solution


Thanks and Regards,
Sravan

Sravan Kumar Lakkimsetti
IBM India Pvt Ltd,
Embassy Golf Links Business Park, D Block,
Off Indiranagar-Kormangla Inner Ring Road,
Bangalore - 560071, India
Phone: 91-80-41776858

-----Original Message-----
From: Thomas Singer [mailto:ts-swt@xxxxxxxxxxx]
Sent: Tuesday, May 15, 2018 9:05 PM
To: platform-swt-dev@xxxxxxxxxxx
Subject: Re: [platform-swt-dev] Correct Implementation for HiDPI

> On linux don't set
> the system property "swt.autoScale" to false now.

Then we have the paint problems Tom mentioned, right? Then we only have the half resolution available and we can't paint exact pixels any more, right?

--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog


On 2018-05-15 16:23, Sravan K Lakkimsetti wrote:
>
>
> I have enabled native scaling with
> INVALID URI REMOVED
> bugs_show-5Fbug.cgi-3Fid-3D530932&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=
> BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wkY_no7y0H4rMzE&m=_kCEnwPKsV0mGi7YQSts5CAM
> XHrADvu_hSncduipHuo&s=WJvHQ3R5RPoonTnIPm1Pp68DEUjk249iVijmrBPgm4I&e=.
> This solves native widget scaling problem(checkboxes/radio buttons
> etc). On linux don't set the system property "swt.autoScale" to false
> now. The current implementation is use native scaling where ever
> possible. So if you set swt.autoScale to false you may encounter
> issues like some widgets not scaled and some scaled etc. With M7 you
> need to manipulate swt.autoScale flag. Linux hidpi support should work
> similar to Mac
>
> Thanks and Regards,
> Sravan
>
> Sravan Kumar Lakkimsetti
> IBM India Pvt Ltd,
> Embassy Golf Links Business Park, D Block, Off Indiranagar-Kormangla
> Inner Ring Road, Bangalore - 560071, India
> Phone: 91-80-41776858
>
> -----Original Message-----
> From: Thomas Singer [mailto:ts-swt@xxxxxxxxxxx]
> Sent: Tuesday, May 15, 2018 7:39 PM
> To: platform-swt-dev@xxxxxxxxxxx
> Subject: Re: [platform-swt-dev] Correct Implementation for HiDPI
>
> Currently, we set the system property "swt.autoScale" to "false"
> before creating the Display on non-macOS systems. Unfortunately, on
> Linux the zoom level can't be detected any more and I have the feeling
> some controls like checkboxes are a little bit too small.
>
> --
> Best regards,
> Thomas Singer
> =============
> syntevo GmbH
> INVALID URI REMOVED
> =DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wkY_no7
> y0H4rMzE&m=_kCEnwPKsV0mGi7YQSts5CAMXHrADvu_hSncduipHuo&s=L0ZFHegTr1Y-C
> cOptU17yKu1Yw6i4oWJn2oJxGglIwU&e=
>
> INVALID URI REMOVED
> log&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wk
> Y_no7y0H4rMzE&m=_kCEnwPKsV0mGi7YQSts5CAMXHrADvu_hSncduipHuo&s=Lb5czZ2e
> XmiOwLMY2k5Xd6YQRplkrh1KiO2s-NWnWps&e=
>
>
>
>
> On 2018-05-15 11:49, Tom Schindl wrote:
>> Yes the GC implementation simply multiplies the value it gets.
>>
>> A problem with that approach although is that if you draw at the
>> outline of a canvas half of your line is drawn outside.
>>
>> The only possibility to fix that is that you apply a transform
>> because everything is multiplied by eg 2.0 you can't offset the line
>> 1px, this leads to the problem that you can't stroke a rectangle but
>> need to do that line by line (top-line offset down, right line offet
>> left, bottom line offet top, left line offset right).
>>
>> While HiDPI works very well on OS-X we have had major problems on Win32.
>>
>> Tom
>>
>> On 15.05.18 11:35, Sravan K Lakkimsetti wrote:
>>> Hi,
>>>
>>> SWT scales automatically on Windows and Linux. Application won't
>>> have access to the screen coordinates. SWT does call a callback to
>>> the application for a new image when required (SWT supplies scale
>>> factor when it requests). If you use imageproviders(or
>>> imagedescriptor) you'll get sharper images otherwise the images and
>>> drawing gets scaled automatically will result in slightly blurred images.
>>>
>>> Thanks and Regards,
>>> Sravan
>>>
>>> Sravan Kumar Lakkimsetti
>>> IBM India Pvt Ltd,
>>> Embassy Golf Links Business Park, D Block, Off Indiranagar-Kormangla
>>> Inner Ring Road, Bangalore - 560071, India
>>> Phone: 91-80-41776858
>>>
>>> -----Original Message-----
>>> From: Thomas Singer [mailto:ts-swt@xxxxxxxxxxx]
>>> Sent: Tuesday, May 15, 2018 2:28 PM
>>> To: platform-swt-dev@xxxxxxxxxxx
>>> Subject: Re: [platform-swt-dev] Correct Implementation for HiDPI
>>>
>>> According to my understanding on macOS the zooming is handled
>>> transparently - for the application it looks like it does not have
>>> to perform any scaling itself, images are drawn scaled automatically
>>> by macOS and all paint operations are scaled automatically, too,
>>> with an unscaled coordinate-system. Is this right?
>>>
>>> If using SWT as designed now, should SWT scale automatically, too,
>>> on Windows and Linux. Or is the application able to (and has to)
>>> access the full screen coordinates, thus painting each pixel even at 200% zoom?
>>>
>>> --
>>> Best regards,
>>> Thomas Singer
>>> =============
>>> syntevo GmbH
>>>
> INVALID URI REMOVED
> =DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wkY_no7
> y0H4rMzE&m=_kCEnwPKsV0mGi7YQSts5CAMXHrADvu_hSncduipHuo&s=L0ZFHegTr1Y-C
> cOptU17yKu1Yw6i4oWJn2oJxGglIwU&e=
>
>>>
> INVALID URI REMOVED
> log&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wk
> Y_no7y0H4rMzE&m=_kCEnwPKsV0mGi7YQSts5CAMXHrADvu_hSncduipHuo&s=Lb5czZ2e
> XmiOwLMY2k5Xd6YQRplkrh1KiO2s-NWnWps&e=
>
>>>
>>>
>>> On 2018-05-03 16:50, Thomas Singer wrote:
>>>> Hi all,
>>>>
>>>> For our application SmartGit (et al) we are using HiDPI support
>>>> since it first was supported in SWT by adding workarounds where necessary.
>>>> In the mean-time the SWT-API has changed significantly in this area
>>>> and I only adapted our SWT use to get it working. Though I have the
>>>> feeling we are not using it as designed according to the current
>>>> API, especially on Linux the HiDPI detection does not work reliable for us.
>>>>
>>>> Is there a documentation how to implement image handling and paint
>>>> operations correctly on HiDPI screens (we are just supporting 100%
>>>> and 200% zoom level)? Thanks in advance.
>>>>
>>>> --
>>>> Best regards,
>>>> Thomas Singer
>>>> =============
>>>> syntevo GmbH
>>>> INVALID URI REMOVED
>>>> =DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wkY_
>>>> no7
>>>> y0H4rMzE&m=UPJdqJ9podCgvknQhS14jIiQIzf-KSSDLvoiF-boCaQ&s=Eutp3m4zZh
>>>> WUZ
>>>> BClxYGREH9303GwuOl9E0Oe8pqQgRw&e=
>>>> INVALID URI REMOVED
>>>> log&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ
>>>> 7wk
>>>> Y_no7y0H4rMzE&m=UPJdqJ9podCgvknQhS14jIiQIzf-KSSDLvoiF-boCaQ&s=xHVxd
>>>> DyO 7KbzO875Nk6J1tBzgA6w2k7MiAEy-U8d2xw&e=
>>>> _______________________________________________
>>>> platform-swt-dev mailing list
>>>> platform-swt-dev@xxxxxxxxxxx
>>>> To change your delivery options, retrieve your password, or
>>>> unsubscribe from this list, visit INVALID URI REMOVED
>>>> ailman_listinfo_platform-2Dswt-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1
>>>> ZOg
>>>> &r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wkY_no7y0H4rMzE&m=UPJdqJ9podCgvknQhS
>>>> 14j
>>>> IiQIzf-KSSDLvoiF-boCaQ&s=8bsjKEygspK_VjtYt4h04K9QjvGzpdYUtv39sXUz2R
>>>> c&e
>>>> =
>>>>
>>> _______________________________________________
>>> platform-swt-dev mailing list
>>> platform-swt-dev@xxxxxxxxxxx
>>> To change your delivery options, retrieve your password, or
>>> unsubscribe from this list, visit
>>>
> INVALID URI REMOVED
> ailman_listinfo_platform-2Dswt-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg
> &r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wkY_no7y0H4rMzE&m=_kCEnwPKsV0mGi7YQSts5
> CAMXHrADvu_hSncduipHuo&s=g--7G83XMYM7PiUcgoGziZGVrkMEKRFDfQEoOFUMOEc&e
> =
>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> platform-swt-dev mailing list
>>> platform-swt-dev@xxxxxxxxxxx
>>> To change your delivery options, retrieve your password, or
>>> unsubscribe
> from this list, visit
>>>
> INVALID URI REMOVED
> ailman_listinfo_platform-2Dswt-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg
> &r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wkY_no7y0H4rMzE&m=_kCEnwPKsV0mGi7YQSts5
> CAMXHrADvu_hSncduipHuo&s=g--7G83XMYM7PiUcgoGziZGVrkMEKRFDfQEoOFUMOEc&e
> =
>
>>>
>> _______________________________________________
>> platform-swt-dev mailing list
>> platform-swt-dev@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or
>> unsubscribe
> from this list, visit
>>
> INVALID URI REMOVED
> ailman_listinfo_platform-2Dswt-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg
> &r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wkY_no7y0H4rMzE&m=_kCEnwPKsV0mGi7YQSts5
> CAMXHrADvu_hSncduipHuo&s=g--7G83XMYM7PiUcgoGziZGVrkMEKRFDfQEoOFUMOEc&e
> =
>
>>
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or
> unsubscribe from this list, visit
> INVALID URI REMOVED
> ailman_listinfo_platform-2Dswt-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg
> &r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wkY_no7y0H4rMzE&m=_kCEnwPKsV0mGi7YQSts5
> CAMXHrADvu_hSncduipHuo&s=g--7G83XMYM7PiUcgoGziZGVrkMEKRFDfQEoOFUMOEc&e
> =
>
>
>
>
>
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or
> unsubscribe from this list, visit
> INVALID URI REMOVED
> ailman_listinfo_platform-2Dswt-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg
> &r=BbJ1i82pNJnkXoEbqK7sZDkJsrJ7wkY_no7y0H4rMzE&m=_kCEnwPKsV0mGi7YQSts5
> CAMXHrADvu_hSncduipHuo&s=g--7G83XMYM7PiUcgoGziZGVrkMEKRFDfQEoOFUMOEc&e
> =
>
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top