Closed Bug 804559 Opened 12 years ago Closed 12 years ago

Garbage drawn in image document when zoom-out

Categories

(Core :: Graphics: ImageLib, defect)

19 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla20
Tracking Status
firefox19 + verified
firefox20 --- verified

People

(Reporter: alice0775, Assigned: joe)

References

Details

(Keywords: regression)

Attachments

(4 files)

Attached image img (deleted) —
Build Identifier:
http://hg.mozilla.org/mozilla-central/rev/1c3e4cb1f754
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0 ID:20121022030551

Steps to reproduce:

1. Maximize browser
2. Open attached img, Click on the image to cancel autoscale if autoscaled. 
3. Zoom-out(Ctrl+-) 1-2 times

Actual results:
Vertical/horizontal garbage appears at left side/bottom

Expected results:
No such garbage


Setting image.high_quality_downscaling.enabled = false helps
Blocks: 486918
Keywords: regression
That actually looks like the opposite side of the image being drawn, and is (I suspect) a rounding error.
Component: ImageLib → Graphics: Layers
Steps to reproduce:

1. Just to make sure,Clear recent history (Ctrl+Shift+Del), Check "Cache" and Click "Clear Now".
2. Maximize browser,
3. Open attached img, Click on the image to cancel autoscale if autoscaled. 
4. Zoom-out(Ctrl+-) 1-2 times

Regression window(m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/ff86ec766232
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20121001112917
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/c0873dd40e2d
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20121001115917
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=ff86ec766232&tochange=c0873dd40e2d

Regressed by Bug 486918
This problem happens regardless of HWA enabled/Disabled.
Attached image same problem on ubuntu (deleted) —
http://hg.mozilla.org/mozilla-central/rev/5c6b71348e20
Mozilla/5.0 (X11; Linux i686; rv:19.0) Gecko/19 Firefox/19.0a1 ID:20121104030714
Assignee: nobody → joe
Removing qawanted as I believe comment 3 addresses the request. Please re-add if there's something else needed from QA on this bug.
Keywords: qawanted
When we roll our own scale + round code, we are wrong 100% of the time.
Attachment #686766 - Flags: review?(jmuizelaar)
Comment on attachment 686766 [details] [diff] [review]
don't roll our own rounding/scaling code

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

::: image/src/RasterImage.cpp
@@ +163,5 @@
> +
> +    nsIntRect dstRect = srcRect;
> +    dstRect.ScaleRoundOut(scale.width, scale.height);
> +    dstSize.width = dstRect.width;
> +    dstSize.height = dstRect.height;

dstSize = dstRect.Size()
Attachment #686766 - Flags: review?(jmuizelaar) → review+
Component: Graphics: Layers → ImageLib
https://hg.mozilla.org/integration/mozilla-inbound/rev/8c174a108843

I'll ask for mozilla19 (aurora) uplift once this has proven itself.
Target Milestone: --- → mozilla20
https://hg.mozilla.org/mozilla-central/rev/8c174a108843
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Triage drive-by, nominate for uplift when ready.
Comment on attachment 686766 [details] [diff] [review]
don't roll our own rounding/scaling code

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 486918
User impact if declined: Some bad drawing on Linux and Windows when you zoom out of images (and possibly web pages).
Testing completed (on m-c, etc.): on m-c for 2 weeks.
Risk to taking this patch (and alternatives if risky): Other possible bad drawing. Not terribly risky.
String or UUID changes made by this patch: none
Attachment #686766 - Flags: approval-mozilla-aurora?
Attachment #686766 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Following STR from Comment 0 and Comment 3 it looks to be fixed on FF 19b2. No garbage drawn in image document found.

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0
(20130116072953)
Thanks Mario, can you also verify on Firefox Aurora 20.0a2?
(In reply to Anthony Hughes, Mozilla QA (:ashughes) from comment #18)
> can you also verify on Firefox Aurora 20.0a2?

I confirm the fix is verified on Latest Aurora 20 too on Windows 7 x64.

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20130131 Firefox/20.0(20130131042017)
Status: RESOLVED → VERIFIED
Depends on: 925611
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: