[Azure] Text-shadow artifacts at descenders

RESOLVED FIXED in mozilla15

Status

()

Core
Graphics
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Fanolian, Assigned: bas)

Tracking

Trunk
mozilla15
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

5 years ago
Created attachment 622760 [details]
Text-shadow artifacts screenshot

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/15.0 Firefox/15.0a1
Build ID: 20120510030517

Steps to reproduce:

Go to https://developer.mozilla.org/en/CSS/text-shadow, scroll to the examples.


Actual results:

In the second example, shadow artifacts appear at the descenders.
(Reporter)

Updated

5 years ago
Blocks: 715768
(Reporter)

Comment 1

5 years ago
Created attachment 622761 [details]
Artifact for a specific text-shadow

Another STR:
1. Set gfx.content.azure.enabled to True.
2. Add the following CSS in Stylish (blank style), or both userChrome.css and userContent.css:
    * { text-shadow: 0px 0px 1px #909090 !important; }
3. Go to https://en.wikipedia.org/wiki/Descender

NB1: The artifact is present only if the blur-radius is exactly 1px.
NB2: The artifact is present at default zoom level only.
-----------

The above text-shadow also creates artifacts on tabs with some page titles only.
(Reporter)

Comment 2

5 years ago
Created attachment 622762 [details]
Artifact on tabs by comment 1
(Assignee)

Comment 3

5 years ago
I suspect this is an artifact from not having EXTEND_NONE. Anyone who by any chance knows how these shadows are drawn back onto the final surface?
nsTextFrame::PaintOneShadow calls nsContextBoxBlur::DoPaint calls gfxAlphaBoxBlur::Paint calls gfxContext::Mask. Mask is called with a solid-color source and the blurred alpha as the mask surface.
(Assignee)

Comment 5

5 years ago
Since mask is unbound my theory about EXTEND_NONE is probably correct, I'll look into adding a rectangular clip. That should fix this usecase without much of a performance cost.
You mean add a 1px border to the mask surface and clip to the original mask extents when drawing into the mask?
(Assignee)

Comment 7

5 years ago
Created attachment 623381 [details] [diff] [review]
Clip to mask image rather than relying on EXTEND_NONE

This patch should fix the issue.
Assignee: nobody → bas.schouten
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #623381 - Flags: review?(roc)
(Assignee)

Comment 8

5 years ago
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #6)
> You mean add a 1px border to the mask surface and clip to the original mask
> extents when drawing into the mask?

This solution seems easier. But I could do that if you'd have a strong preference.
Attachment #623381 - Flags: review?(roc) → review+
https://hg.mozilla.org/mozilla-central/rev/59efb49ea435
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
(Assignee)

Updated

5 years ago
No longer blocks: 715768
(Assignee)

Updated

5 years ago
Blocks: 715768
You need to log in before you can comment on or make changes to this bug.