Last Comment Bug 736460 - When gfx.content.azure.enabled = true, -moz-radial-gradient seems to be broken
: When gfx.content.azure.enabled = true, -moz-radial-gradient seems to be broken
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:
http://ie.microsoft.com/testdrive/Gra...
: 717091 (view as bug list)
Depends on:
Blocks: 715768
  Show dependency treegraph
 
Reported: 2012-03-16 07:31 PDT by Alice0775 White
Modified: 2012-06-02 12:14 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
sample html (498 bytes, text/html)
2012-03-16 07:31 PDT, Alice0775 White
no flags Details
Deal with gradient stops in a single position (1.57 KB, patch)
2012-05-31 14:45 PDT, Bas Schouten (:bas.schouten)
jmuizelaar: review+
Details | Diff | Splinter Review

Description Alice0775 White 2012-03-16 07:31:47 PDT
Created attachment 606572 [details]
sample html

Build Identifier:
http://hg.mozilla.org/mozilla-central/rev/e5f6caa40409
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120316 Firefox/14.0a1 ID:20120316031151

When gfx.content.azure.enabled = true, -moz-radial-gradient seems to be broken
Center color is not drawn because "stop" is not 0.

Reproducible: Always

Steps to Reproduce:
1. Start Firefox with Clean porofile + gfx.content.azure.enabled = true
2. Open http://ie.microsoft.com/testdrive/Graphics/Bayou/Default.html

Actual Results:
 Center color is not drawn.

Expected Results:
 Center color should be orange.
Comment 1 Alice0775 White 2012-03-16 07:44:30 PDT
Graphics        
Adapter Description : ATI Radeon HD 4300/4500 Series
Vendor ID : 0x1002
Device ID : 0x954f
Adapter RAM : 512
Adapter Drivers : aticfx64 aticfx64 aticfx32 aticfx32 atiumd64 atidxx64 atiumdag atidxx32 atiumdva atiumd6a atitmm64
Driver Version : 8.950.0.0
Driver Date : 2-14-2012
Direct2D Enabled : true
DirectWrite Enabled : true (6.1.7601.17776)
ClearType Parameters : Gamma: 2200 Pixel Structure: RGB ClearType Level: 50 Enhanced Contrast: 200
WebGL Renderer : Google Inc. -- ANGLE (ATI Radeon HD 4300/4500 Series) -- OpenGL ES 2.0 (ANGLE 1.0.0.963)
GPU Accelerated Windows : 1/1 Direct3D 10
AzureBackend : direct2d
Comment 2 Dão Gottwald [:dao] 2012-05-25 04:44:32 PDT
*** Bug 717091 has been marked as a duplicate of this bug. ***
Comment 3 Bas Schouten (:bas.schouten) 2012-05-31 10:05:55 PDT
I've determined this is caused by our custom radial gradient code which doesn't seem to be behaving exactly as expected here. I'll investigate further and fix this.
Comment 4 Bas Schouten (:bas.schouten) 2012-05-31 14:27:35 PDT
I've determined the underlying cause of the issue to be our gradient realization texture generation. If there is not difference in stops this will cause a division by zero and result in an empty pixel at that point. Here, this is the case for the first pixel in the texture, the color the center is clamped to, causing it to be empty. I will create a fix.
Comment 5 Bas Schouten (:bas.schouten) 2012-05-31 14:45:23 PDT
Created attachment 628909 [details] [diff] [review]
Deal with gradient stops in a single position

This fixes the issue, it's a little tricky what the -exact- behavior should be but I believe this is the best approximation. It fixes this issue, looks good and passes all canvas gradient tests.
Comment 6 Jeff Muizelaar [:jrmuizel] 2012-06-01 13:35:39 PDT
(In reply to Bas Schouten (:bas) from comment #5)
> Created attachment 628909 [details] [diff] [review]
> Deal with gradient stops in a single position
> 
> This fixes the issue, it's a little tricky what the -exact- behavior should
> be but I believe this is the best approximation. It fixes this issue, looks
> good and passes all canvas gradient tests.

Test case?
Comment 7 Jeff Muizelaar [:jrmuizel] 2012-06-01 13:37:50 PDT
Comment on attachment 628909 [details] [diff] [review]
Deal with gradient stops in a single position

Review of attachment 628909 [details] [diff] [review]:
-----------------------------------------------------------------

Mostly looks ok. A test case would be good though.

::: gfx/2d/DrawTargetD2D.cpp
@@ +2145,5 @@
> +    float interp = 0;
> +    
> +    if (nextColorPos != prevColorPos) {
> +      interp = (pos - prevColorPos) / (nextColorPos - prevColorPos);
> +    }

I think this might be more clear as an if else
Comment 8 Bas Schouten (:bas.schouten) 2012-06-01 15:02:27 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/1a22fee1faad

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