Live data from Hacker News

Accidental layer creation

jsbin.com

1–10 of 14 posts

Re: Accidental layer creation

#2
The text in Firefox doesn't lose subpixel antialiasing, at least in my browser.

Also, it's perfectly possible to use GPU compositing with subpixel antialiased texture, you just need a separate texture to store the (Ra, Ga, Ba) pre-component "alpha" vales and either dual source blending, two rendering passes (first to apply alpha to destination, second to add color), three rendering passes (one per color), or a pixel shader that takes the pre-blend target surface as an input.

If your browser doesn't do that, file a bug.

Re: Accidental layer creation

#3
post #2

The text in Firefox doesn't lose subpixel antialiasing, at least in my browser. Also, it's perfectly possible to use GPU compositing with subpixel antialiased texture, you just need a separate texture to store the (Ra, Ga, Ba) pre-component "alpha" vales and either dual source blending, two rendering passes (first to apply alpha to destination, second to add color), three rendering passes (one per color), or a pixel…

Mine either, Chrome 25 (stable) Mountain Lion.

Re: Accidental layer creation

#4
post #2

The text in Firefox doesn't lose subpixel antialiasing, at least in my browser. Also, it's perfectly possible to use GPU compositing with subpixel antialiased texture, you just need a separate texture to store the (Ra, Ga, Ba) pre-component "alpha" vales and either dual source blending, two rendering passes (first to apply alpha to destination, second to add color), three rendering passes (one per color), or a pixel…

Sure, but once the text is cached in a layer that layer might be rotated or scaled or similar, in which case subpixel antialiased text would cause ugly artifacts. Keeping subpixel antialiased text in the layer and re-rendering the layer without subpixel antialiasing when a rotating or scaling animation starts would lead to stutters in the animation.

Looking forward to high DPI displays obsoleting subpixel antialiasing as it leads to a bunch of problems when wanting to create fluidly animating UIs.

Re: Accidental layer creation

#5
It's unfortunate to see claims being made about best practices for performance and behavior entirely based on what Chrome Canary does (on one platform, no less). If you're going to tell people to cover their pages in z-index, you should at least test it in other browsers to see if there's a performance penalty (or improvement) there...

Re: Accidental layer creation

#6
post #4
post #2

The text in Firefox doesn't lose subpixel antialiasing, at least in my browser. Also, it's perfectly possible to use GPU compositing with subpixel antialiased texture, you just need a separate texture to store the (Ra, Ga, Ba) pre-component "alpha" vales and either dual source blending, two rendering passes (first to apply alpha to destination, second to add color), three rendering passes (one per color), or a pixel…

Sure, but once the text is cached in a layer that layer might be rotated or scaled or similar, in which case subpixel antialiased text would cause ugly artifacts. Keeping subpixel antialiased text in the layer and re-rendering the layer without subpixel antialiasing when a rotating or scaling animation starts would lead to stutters in the animation. Looking forward to high DPI displays obsoleting subpixel antialiasin…

I don't know what Firefox does on GNU/Linux or OSX but on Windows 7 with DirectWrite, applying transformations to subpixel-AA'ed text is very fast and has excellent fidelity.

Re: Accidental layer creation

#7
post #4
post #2

The text in Firefox doesn't lose subpixel antialiasing, at least in my browser. Also, it's perfectly possible to use GPU compositing with subpixel antialiased texture, you just need a separate texture to store the (Ra, Ga, Ba) pre-component "alpha" vales and either dual source blending, two rendering passes (first to apply alpha to destination, second to add color), three rendering passes (one per color), or a pixel…

Sure, but once the text is cached in a layer that layer might be rotated or scaled or similar, in which case subpixel antialiased text would cause ugly artifacts. Keeping subpixel antialiased text in the layer and re-rendering the layer without subpixel antialiasing when a rotating or scaling animation starts would lead to stutters in the animation. Looking forward to high DPI displays obsoleting subpixel antialiasin…

Yeah, but in the example the text is not transformed, it's merely overlaid on a composited surface.

Re: Accidental layer creation

#8

It's unfortunate to see claims being made about best practices for performance and behavior entirely based on what Chrome Canary does (on one platform, no less). If you're going to tell people to cover their pages in z-index, you should at least test it in other browsers to see if there's a performance penalty (or improvement) there...

This works the same way in Safari 6 on OS X Mountain Lion. z-index: 1 does the trick. And this is a wonderful advice - losing of subpixel antialiasing on the text while something is animating on the screen was always killing me. And now I know exactly why it happens and how to fix it.

Re: Accidental layer creation

#9

It's unfortunate to see claims being made about best practices for performance and behavior entirely based on what Chrome Canary does (on one platform, no less). If you're going to tell people to cover their pages in z-index, you should at least test it in other browsers to see if there's a performance penalty (or improvement) there...

It seems to be a more general issue with Webkit, for what it's worth: I see the exact same behavior in Safari 5.1
Post reply on HN