Bug 23364 - Font antialiasing (smoothing) changes when elements are rendered into compositing layers
Summary: Font antialiasing (smoothing) changes when elements are rendered into composi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
: 35188 40505 47352 54088 65351 77547 82777 82898 84282 91613 96589 117006 Text_jiggering 122075 122165 134917 (view as bug list)
Depends on: 155301 155443
Blocks: 23359
  Show dependency treegraph
 
Reported: 2009-01-15 15:20 PST by Simon Fraser (smfr)
Modified: 2017-10-23 08:28 PDT (History)
42 users (show)

See Also:


Attachments
Patch, changelog (3.36 KB, patch)
2009-02-06 13:52 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (8.04 KB, patch)
2010-12-03 14:35 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (3.12 KB, patch)
2010-12-04 20:35 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (30.54 KB, patch)
2016-03-09 18:50 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (30.61 KB, patch)
2016-03-09 18:51 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (49.60 KB, patch)
2016-03-10 16:46 PST, Simon Fraser (smfr)
thorton: review+
Details | Formatted Diff | Diff
Gibberish (8 bytes, text/plain)
2016-06-12 15:19 PDT, Abu Naser Saifullah
no flags Details
Nonsense (7 bytes, text/plain)
2016-06-12 15:22 PDT, Abu Naser Saifullah
no flags Details
Is this the issue? (1.82 MB, video/mp4)
2016-11-28 07:00 PST, Jack Wellborn
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2009-01-15 15:20:37 PST
When text is rendered into a GraphicsLayer when accelerated compositing is enabled, then it is rendered with no font smoothing (aka LCD antialiasing), because it is not being rendered directly to the screen.

This can cause "flashing" behavior when elements start or stop compositing (similarly to the way that text changes for opacity now).
Comment 1 Simon Fraser (smfr) 2009-02-06 13:52:02 PST
Created attachment 27417 [details]
Patch, changelog

The rationale for turning off font smoothing when painting with a transform is that the appearance of the text will not change when the transformed element pops into a layer if it starts to animate.

Also, it gives web authors a back-door way to control font smoothing.
Comment 2 Eric Seidel (no email) 2009-02-06 14:02:57 PST
Comment on attachment 27417 [details]
Patch, changelog

I don't like this API.  If they're instance methods, they should be stored as part of the graphics state (which is what I would prefer).  If they're not part of the graphics state, then they need to be static methods on GraphicsContext.  But I prefer that they just be added to teh graphics state.
Comment 3 Simon Fraser (smfr) 2009-06-16 11:12:59 PDT
<rdar://problem/6976712>
Comment 4 Simon Fraser (smfr) 2009-07-14 15:12:54 PDT
*** Bug 27272 has been marked as a duplicate of this bug. ***
Comment 5 Simon Fraser (smfr) 2009-10-17 11:45:36 PDT
<rdar://problem/7199704>
Comment 6 Simon Fraser (smfr) 2010-02-23 07:57:10 PST
*** Bug 35188 has been marked as a duplicate of this bug. ***
Comment 7 Simon Fraser (smfr) 2010-06-13 09:45:21 PDT
*** Bug 40505 has been marked as a duplicate of this bug. ***
Comment 8 Simon Fraser (smfr) 2010-10-08 14:42:11 PDT
*** Bug 47352 has been marked as a duplicate of this bug. ***
Comment 9 Alberto Calvo 2010-10-12 12:23:21 PDT
Any news about this? It's a pretty old bug, and the problem seems quite important to me, as it could be really obvious (I saw this even on Apple website).
Comment 10 Josh 2010-10-12 13:38:34 PDT
FWIW, I'm only seeing this issue when "position:relative;" is specified within a "position:relative;" parent container and animations are happening on the page AND after upgrading to Safari 5. I'm not sure which version of Webkit it first appeared in...

Does anybody have a bare-minimum working example to play with? I can come up with something if it will help.

For now, I have come across this issue in a corporate site I'm working on and my own personal site as well.


http://beta.daz3d.com/

The issue on this site shows up on the Coda style slider links below the fold (Hot Products, Software, Free Products, etc). On hover, the text is rendered properly. The text is also rendered properly in the current tab when a background image set for the anchor tag.


http://www.uberfoto.com/index.php/uberfoto/blog/

For this site, the anti-aliasing from the message preview text is removed while the logo animates and is restored when finished.


If these instances help, I'm glad but they are also polluted with a lot of other code. I'll start working on a bare-bones example.
Comment 11 Simon Fraser (smfr) 2010-10-12 14:04:19 PDT
The problem is well understood. It's blocked on a technical issue that is outside the scope of WebKit.
Comment 12 Alberto Calvo 2010-10-12 15:09:12 PDT
And who to complain about this, then? I'd really like to see this problem solved.
Comment 13 Alberto Calvo 2010-10-19 02:16:56 PDT
Some video examples of the bug.

https://bug-47352-attachments.webkit.org/attachment.cgi?id=70092
http://idzr.org/e69k
http://idzr.org/8fwa

It happens on images as well:
http://idzr.org/11n4

Seriously… nobody at Apple is gonna fix this?
Comment 14 Jon Hurrell 2010-10-19 02:22:32 PDT
Echo of Alberto's sentiments. This needs attention.
Comment 15 Dean Jackson 2010-10-22 10:29:57 PDT
We hear you! We have not forgotten.
Comment 16 Josh 2010-10-27 10:23:38 PDT
The constant displayed version (still shows during animations) of this bug only shows for me when FLASH PLAYER 10.1 is installed.
Comment 17 Simon Fraser (smfr) 2010-10-27 11:27:13 PDT
(In reply to comment #16)
> The constant displayed version (still shows during animations) of this bug only shows for me when FLASH PLAYER 10.1 is installed.

Right. Flash 10.1 uses the Core Animation drawing model, so tickles this bug.
Comment 18 Alberto Calvo 2010-11-11 00:25:34 PST
You made some improvements to this on 10.6.5, right? Elements no longer flickr when you hover stuff. I'm still experiencing the font-antialiasing changes, though.
Comment 19 Alberto Calvo 2010-11-11 00:30:50 PST
Seems that the font antialiasing changes are now just on the element and not the surrounding ones. At least, now it's more localized and much less annoying.
Comment 20 mitz 2010-11-11 00:37:33 PST
There are no WebKit changes between Mac OS X 10.6.4 and 10.6.5. However, the 10.6.5 update may have updated the Flash Player plug-in on your system, which may affect which elements are composited and when.
Comment 21 Alberto Calvo 2010-11-11 00:44:31 PST
I assume there's no webkit improvements on this, as somebody told me this problem is outside the scope of webkit (I guess it should be some part of the Mac OS X graphics acceleration then). I was having this issue in a lot of more places besides flash sites (using CSS transitions, iframes…). Just take a look to the videos ;)
Comment 22 Simon Fraser (smfr) 2010-12-03 14:35:50 PST
Created attachment 75545 [details]
Patch
Comment 23 Simon Fraser (smfr) 2010-12-03 16:03:49 PST
Comment on attachment 75545 [details]
Patch

Dan gave me feedback; I'll revise the patch.
Comment 24 Simon Fraser (smfr) 2010-12-04 20:35:46 PST
Created attachment 75624 [details]
Patch
Comment 25 Eric Seidel (no email) 2010-12-05 00:35:55 PST
Attachment 75624 [details] did not build on chromium:
Build output: http://queues.webkit.org/results/6777051
Comment 26 Simon Fraser (smfr) 2010-12-06 11:32:06 PST
Comment on attachment 75624 [details]
Patch

http://trac.webkit.org/changeset/73379
Comment 27 Ryosuke Niwa 2010-12-06 13:24:41 PST
Build fix landed in http://trac.webkit.org/changeset/73394.

Please verify the change.
Comment 28 Simon Fraser (smfr) 2010-12-07 18:26:54 PST
Two more changes to do here:
1. Make it work on Leopard.
2. Make it possible for style to override the per-layer setting.
Comment 29 Simon Fraser (smfr) 2010-12-08 20:37:46 PST
See also bug 50732, bug 50733.
Comment 30 Anthony Ricaud 2011-02-06 10:42:57 PST
It seems this bug should be marked as closed.
Comment 31 Simon Fraser (smfr) 2011-02-25 08:48:29 PST
*** Bug 54088 has been marked as a duplicate of this bug. ***
Comment 32 Simon Fraser (smfr) 2011-07-29 16:06:28 PDT
*** Bug 65351 has been marked as a duplicate of this bug. ***
Comment 33 Marc Hoyois 2011-09-14 11:00:30 PDT
(In reply to comment #11)
> The problem is well understood. It's blocked on a technical issue that is outside the scope of WebKit.

But subpixel antialiasing worked fine around video elements (e.g. in the controls) in Safari 5.0, even though videos were hardware accelerated. I have no understanding of the technical issues here, but doesn't this show part of the problem is within WebKit's scope?
Comment 34 Simon Fraser (smfr) 2012-02-01 10:07:20 PST
*** Bug 77547 has been marked as a duplicate of this bug. ***
Comment 35 Alexey Proskuryakov 2012-04-02 15:55:02 PDT
*** Bug 82898 has been marked as a duplicate of this bug. ***
Comment 36 Simon Fraser (smfr) 2012-04-19 11:32:15 PDT
*** Bug 84282 has been marked as a duplicate of this bug. ***
Comment 37 Alexey Proskuryakov 2012-07-18 10:34:59 PDT
*** Bug 91613 has been marked as a duplicate of this bug. ***
Comment 38 Alexey Proskuryakov 2012-09-13 11:40:23 PDT
*** Bug 96589 has been marked as a duplicate of this bug. ***
Comment 39 pepijndevos 2012-11-29 06:34:05 PST
This bug is still causing trouble on http://pepijndevos.nl on Safari and the latest Webkit.

Antialiasing changes from sub-pixel to greyscale after executing "canvas.translate(-200, 400);"

Firefox on Mac does not suffer this problem, which indicates to the layman that the bug is indeed in Webkit and not the system itself. Clarification to the contrary would be helpful to avoid misunderstanding.
Comment 40 oliver 2013-04-16 21:39:24 PDT
Why is this issue still not fixed after 4 years?
IE10 is now making you guys look bad.
This is not an issue on any other browser.
font aliasing is a BASIC function and you guys still can't get it working?
Safari seems to be turning into the new IE6.

This issue should take president over any other "unnecessary" features you guys are wasting your time on.
Comment 41 Alexey Proskuryakov 2013-05-31 22:52:25 PDT
*** Bug 117006 has been marked as a duplicate of this bug. ***
Comment 42 Alexey Proskuryakov 2013-08-19 09:33:36 PDT
*** Bug 119904 has been marked as a duplicate of this bug. ***
Comment 43 Tim Horton 2013-10-01 12:47:57 PDT
*** Bug 122165 has been marked as a duplicate of this bug. ***
Comment 44 andy.venetis 2013-10-01 13:11:08 PDT
Hi there,
I CANNOT THINK THAT THIS BUG IS 4 YEARS OLD.
FONT IS THE NUMBER ONE IMPORTANT ELEMENT IN WEB BROWSING.

MAC OS BUCK IN 1984 WAS THE BEST OS CONSIDERED FOR FONT AND SCREEN RENDERING.
AND NOW THE MOST USED APPLICATION EVERY DAY , SAFARI, HAS THE WORST RENDERING ON THE WEB.
THIS IS THE TRUTH GUYS.
LEAVE ALL THE OTHER BUGS . THIS IS YOUR CHALLENGE. THIS IS YOUR BUG TO RESOLVE.

ANYWAY. WEBKIT HAS REALLY GOOD SPEED AND SCROLLING….

ANDREAS
Comment 45 Simon Fraser (smfr) 2013-10-25 11:03:20 PDT
*** Bug 122075 has been marked as a duplicate of this bug. ***
Comment 46 gamaliel 2013-10-26 04:38:23 PDT
Might be 4 years old but it just appeared for me with Safari 6.1 on Mac OS 10.8, looks very bad.
Comment 47 Kevin M. Dean 2013-10-26 08:01:14 PDT
I really don't get why this bug hasn't been fixed in years and it's showing up on more sites than before.
Comment 48 Simon Fraser (smfr) 2013-11-08 17:52:53 PST
*** Bug 82777 has been marked as a duplicate of this bug. ***
Comment 49 Simon Fraser (smfr) 2014-07-15 20:50:49 PDT
*** Bug 134917 has been marked as a duplicate of this bug. ***
Comment 50 James Wages 2014-07-15 21:15:24 PDT
Mr. Fraser, back in Oct. 2010, you said the following:

"The problem is well understood. It's blocked on a technical issue that is outside the scope of WebKit."

It's now July 2014.  This bug has been around since January 2009.  Despite being "outside the scope of WebKit" the fact remains that "the powers that be" have had sufficient time to resolve this issue by now.  Please describe in detail the specific "technical issue" that has "blocked" it from being fixed for the last 5.5 years.  (And please consider that CHROME 35, also built upon WebKit, does NOT have this problem.)  Thank you.
Comment 51 backit 2014-11-11 05:09:08 PST
This bug is still annoying us. I'm usign chrome 38 and setting a transition on a transform:scale effect, disable antialiasing.
Comment 52 Simon Fraser (smfr) 2016-03-09 18:50:26 PST
Created attachment 273526 [details]
Patch
Comment 53 Simon Fraser (smfr) 2016-03-09 18:51:40 PST
Created attachment 273527 [details]
Patch
Comment 54 Tim Horton 2016-03-09 18:58:02 PST
Comment on attachment 273527 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=273527&action=review

> Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:561
> +    BEGIN_BLOCK_OBJC_EXCEPTIONS

Seems like these should be inside setBackingStoreFormat, not here.
Comment 55 Simon Fraser (smfr) 2016-03-09 21:26:50 PST
https://trac.webkit.org/r197923
Comment 56 WebKit Commit Bot 2016-03-10 09:49:43 PST
Re-opened since this is blocked by bug 155301
Comment 57 Simon Fraser (smfr) 2016-03-10 16:46:22 PST
Created attachment 273652 [details]
Patch
Comment 58 Tim Horton 2016-03-10 17:29:46 PST
Comment on attachment 273652 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=273652&action=review

> Source/WebKit2/UIProcess/WebProcessPool.h:194
> +    void enableSmoothedLayerText(bool);

not sure why this isn't setSmoothedLayerTextEnabled but ok.
Comment 59 Simon Fraser (smfr) 2016-03-10 17:49:40 PST
https://trac.webkit.org/r197981
Comment 60 Chris Dumez 2016-03-14 12:03:55 PDT
Disabled in <http://trac.webkit.org/changeset/198145> due to a massive page load time regression.
Comment 61 Chris Dumez 2016-03-14 20:52:57 PDT
Reverted r197981 for reason:

Caused a massive PLT regression on Mac.

Committed r198189: <http://trac.webkit.org/changeset/198189>
Comment 62 Abu Naser Saifullah 2016-06-12 15:19:33 PDT
Created attachment 281129 [details]
Gibberish
Comment 63 Abu Naser Saifullah 2016-06-12 15:22:00 PDT
Created attachment 281131 [details]
Nonsense
Comment 64 Jack Wellborn 2016-11-28 07:00:01 PST
Created attachment 295487 [details]
Is this the issue?

Is the issue being discussed in this thread manifesting in the attached video. In either case, it's fairly ugly.
Comment 65 Simon Fraser (smfr) 2017-10-23 08:28:18 PDT
(In reply to Jack Wellborn from comment #64)
> Created attachment 295487 [details]
> Is this the issue?
> 
> Is the issue being discussed in this thread manifesting in the attached
> video. In either case, it's fairly ugly.

Yes, it is.

This has been fixed in macOS High Sierra.