Last Comment Bug 753835 - [Azure] Text-shadow artifacts at descenders
: [Azure] Text-shadow artifacts at descenders
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86_64 Windows 7
: -- normal (vote)
: mozilla15
Assigned To: Bas Schouten (:bas.schouten)
:
Mentors:
Depends on:
Blocks: 715768
  Show dependency treegraph
 
Reported: 2012-05-10 09:30 PDT by Fanolian
Modified: 2012-05-20 13:41 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Text-shadow artifacts screenshot (100.36 KB, image/png)
2012-05-10 09:30 PDT, Fanolian
no flags Details
Artifact for a specific text-shadow (26.45 KB, image/png)
2012-05-10 09:43 PDT, Fanolian
no flags Details
Artifact on tabs by comment 1 (48.37 KB, image/png)
2012-05-10 09:45 PDT, Fanolian
no flags Details
Clip to mask image rather than relying on EXTEND_NONE (1.04 KB, patch)
2012-05-11 19:11 PDT, Bas Schouten (:bas.schouten)
roc: review+
Details | Diff | Splinter Review

Description Fanolian 2012-05-10 09:30:32 PDT
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.
Comment 1 Fanolian 2012-05-10 09:43:27 PDT
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.
Comment 2 Fanolian 2012-05-10 09:45:08 PDT
Created attachment 622762 [details]
Artifact on tabs by comment 1
Comment 3 Bas Schouten (:bas.schouten) 2012-05-11 15:19:29 PDT
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?
Comment 4 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2012-05-11 16:03:24 PDT
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.
Comment 5 Bas Schouten (:bas.schouten) 2012-05-11 17:05:14 PDT
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.
Comment 6 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2012-05-11 18:39:54 PDT
You mean add a 1px border to the mask surface and clip to the original mask extents when drawing into the mask?
Comment 7 Bas Schouten (:bas.schouten) 2012-05-11 19:11:56 PDT
Created attachment 623381 [details] [diff] [review]
Clip to mask image rather than relying on EXTEND_NONE

This patch should fix the issue.
Comment 8 Bas Schouten (:bas.schouten) 2012-05-11 19:26:06 PDT
(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.
Comment 9 Matt Brubeck (:mbrubeck) 2012-05-13 17:40:59 PDT
https://hg.mozilla.org/mozilla-central/rev/59efb49ea435

Note You need to log in before you can comment on or make changes to this bug.