After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 710501 - wrong graphics rendering on gtk-3.10 osx with retina display
wrong graphics rendering on gtk-3.10 osx with retina display
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Quartz
3.11.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-quartz maintainers
gtk-bugs
: 758338 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-10-19 10:59 UTC by Alexey Yakovenko
Modified: 2016-03-23 15:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Toolbar icons wrong size (45.96 KB, image/png)
2013-10-19 11:04 UTC, Alexey Yakovenko
  Details
images in custom widgets are pixelized (26.86 KB, image/png)
2013-10-19 11:04 UTC, Alexey Yakovenko
  Details
notification area icon doesn't fit and pixelized (34.13 KB, image/png)
2013-10-19 11:05 UTC, Alexey Yakovenko
  Details
GtkTextView text is pixelized (55.55 KB, image/png)
2013-10-19 11:05 UTC, Alexey Yakovenko
  Details
GtkTreeView is pixelized (62.53 KB, image/png)
2013-10-19 11:05 UTC, Alexey Yakovenko
  Details
patch: always return scalefactor of 1 for icons (proof of concept fix for retina) (451 bytes, patch)
2014-02-05 13:47 UTC, Alexey Yakovenko
none Details | Review

Description Alexey Yakovenko 2013-10-19 10:59:43 UTC
there are several issues in one, but i decided to file them in one, because i'm not sure if they are caused by different things.

system info

1. i compiled gtk-3.10.1 using jhbuild modules-stable, osx 10.8.5, xcode 5

2. i have macbookpro with retina 220 ppi

3. i've tested stuff in my own app deadbeef, but also double checked with gtktest

now the issues:

1. toolbar is twice bigger than it should be, while the toolbar button icons are using the low resolution, and stretched to approximately 4x of their source size. this is different from gtk 3.6 behaviour, where the toolbar size was correct. another difference here is that icons use high quality resizing, while in 3.6 they were not using filtering. still they look very bad.

2. in custom widgets, which render their content using cairo, all raster graphics are pixelized, even if their source resolution is HDPI. all vector graphics and text look correct.

3. in standard GtkTreeView with GtkCellRendererText, all text is pixelized (2x), the same happens in GtkTextView. this doesn't happen e.g. in labels and buttons.

4. in the notification area, the application icon doesn't fit in the panel, and is 2x pixelized, even though high res icon is present in the icon theme folder.

i will attach the relevant screenshots shortly.
Comment 1 Alexey Yakovenko 2013-10-19 11:04:08 UTC
Created attachment 257692 [details]
Toolbar icons wrong size
Comment 2 Alexey Yakovenko 2013-10-19 11:04:42 UTC
Created attachment 257693 [details]
images in custom widgets are pixelized
Comment 3 Alexey Yakovenko 2013-10-19 11:05:11 UTC
Created attachment 257694 [details]
notification area icon doesn't fit and pixelized
Comment 4 Alexey Yakovenko 2013-10-19 11:05:35 UTC
Created attachment 257695 [details]
GtkTextView text is pixelized
Comment 5 Alexey Yakovenko 2013-10-19 11:05:55 UTC
Created attachment 257696 [details]
GtkTreeView is pixelized
Comment 6 andriusr 2013-11-03 17:23:42 UTC
I have the same issues when compiling bluefish using gtk+3.10.
Just few more observations:
1. Not only toolbar icons are twice the size, all images are larger twice. This causes interface look weird when widgets are trying to accomodate oversized graphics. 
2. Compiling bluefish with gtk+3.9.6 gave back normal icon sizes and good looking text in GtkTextView. However, text in GtkTreeView is still pixelized. 
I have noticed that both GtkTreeView and GtkTextView some time ago were ported to use GtkPixelCache. This might have caused this behavior. To make sure one would need to try to compare 3.9.12 and 3.9.14 versions...
Comment 7 Alexey Yakovenko 2014-02-05 13:47:51 UTC
Created attachment 268175 [details] [review]
patch: always return scalefactor of 1 for icons (proof of concept fix for retina)

adding a patch which fixes oversized icons
Comment 8 Emmanuele Bassi (:ebassi) 2014-02-05 13:49:56 UTC
the code inside GdkQuartzScreen does:

    scale_factor = [(id <ScaleFactor>) nsscreen backingScaleFactor];

but if Quartz is already scaling up surfaces then we should not be doing this.

alternatively, we need to find a way to opt out of the automatic scaling done by Quartz, so that we can apply our own scaling.

there's also the question whether Cairo supports per-device scaling on Quartz surfaces.
Comment 9 Kristian Rietveld 2014-02-05 13:52:41 UTC
Adding Mitch to CC, he once did some retina debugging. From what I remember, things mostly worked fine with the 2.x branch.
Comment 10 Christoph Reiter (lazka) 2015-07-15 10:20:24 UTC
The pixelation in GtkTextView/GtkTreeView seems to be caused by the pixel cache. Setting GTK_DEBUG=no-pixel-cache makes things work here.
Comment 11 Alexey Yakovenko 2015-07-15 10:57:00 UTC
I converted my project to use Cocoa on OSX, so this bug is no longer a problem to me, and can be closed.
Comment 12 Emmanuele Bassi (:ebassi) 2015-07-15 11:03:38 UTC
(In reply to Alexey Yakovenko from comment #11)
> I converted my project to use Cocoa on OSX, so this bug is no longer a
> problem to me, and can be closed.

Even if it's not a problem for you, it's still a bug.
Comment 13 Christoph Reiter (lazka) 2015-07-16 17:12:11 UTC
I think pixel cache breakage is due to https://bugs.freedesktop.org/show_bug.cgi?id=69796

As all my other uses of surface_create_similar() are pixelated as well.
Comment 14 Christoph Reiter (lazka) 2016-03-20 11:50:23 UTC
*** Bug 758338 has been marked as a duplicate of this bug. ***
Comment 15 Christoph Reiter (lazka) 2016-03-23 15:42:25 UTC
This should be fixed now: https://git.gnome.org/browse/gtk+/commit/?id=3f077ec36f4a59e803c9f4509996269c862e04af