Closed Bug 977459 Opened 6 years ago Closed 5 years ago

Give RasterImage the ability to hold multiple decoded versions of an image

Categories

(Core :: ImageLib, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: seth, Assigned: seth)

References

(Blocks 3 open bugs)

Details

RasterImage's inability to hold multiple decoded versions of the same image is the underlying cause for problems all over the place, from media fragment implementation issues, to mixed HTML/WebGL context causing duplicate decodes, to duplicate GET requests for the same image, to difficulties implementing a clean solution for decode-and-downside.

It's time to fix this problem. It's clearly a major limitation that's causing bugs and bad architectural decisions in all sorts of code related to images.

I've CC'ed people I thought would be interested. Feel free to un-CC if my guess was wrong.
This doesn't, strictly speaking, block a lot of things, since we already have hacks in place for many of them, so I'll just mention related bugs as I come across them.

Four I know offhand are bug 854795, bug 583351, bug 790640, and bug 952354.
Blocks: 583351
Blocks: 790640
Can you please clarify what this bug is about for a non-imagelib-kind-of-guy who I am? :-)

Thanks!
(In reply to :Ehsan Akhgari (needinfo? me!) (slow responsiveness, emailapocalypse) from comment #2)
> Can you please clarify what this bug is about for a non-imagelib-kind-of-guy
> who I am? :-)
> 
> Thanks!

If we need more than one decoded version of an image (different size, premultiplied alpha vs. not, different layer of an ICO, whatever), today we have to do ugly hacks or repeatedly throw away and redecode stuff. This is because RasterImage can't hold more than one decoded version of an image. I'm going to fix that.
Bug 969325 is likely another bug that is caused by this problem.
Blocks: 969325
Blocks: 888823
Depends on: DrawAPIRefactor
Depends on: 1006353
Blocks: 1050815
Blocks: 1013224
Since there is no ETA yet on the DrawAPI refactoring that this one depends on, is there a possibility to get an intermediate fix in so at the very least HQ downscaling can be enabled without penalty? Simply allocating independent buffers for downscaled images (since it only happens when the images are of the same src) should work? i.e.: treat al downscaled images as-if they are unique.
(In reply to Mark Straver from comment #5)
> Since there is no ETA yet on the DrawAPI refactoring that this one depends
> on

No ETA? It's already landed, and the bug is resolved!

This bug will be fixed in two stages. I'm testing a patch for the HQ downscaling case right now, and will probably have it up for review tonight or tomorrow. The general decoding case probably isn't far off either.
Depends on: 106020
Depends on: 1060200
No longer depends on: 106020
(In reply to Seth Fowler [:seth] from comment #6)
> No ETA? It's already landed, and the bug is resolved!

It landed after my comment ;)
No longer blocks: 969325
No longer blocks: 1050815
No longer blocks: 1013224
No longer depends on: 1006353
(In reply to Mark Straver from comment #7)
> It landed after my comment ;)

Yeah, the individual bugs the metabug was tracking landed earlier, but there was a delay before I resolved the metabug itself. Which leads us to the conclusion that it landed before your comment but was, I suppose, resolved after your comment. =)
I don't want to hijack this bug, but, Seth, do you know if your current work on RasterImage could fix the bug 745549 (by side-effect maybe)?
(In reply to Loic from comment #9)
> I don't want to hijack this bug, but, Seth, do you know if your current work
> on RasterImage could fix the bug 745549 (by side-effect maybe)?

It won't - that bug has more to do with the layers system. I'll add some needinfo's on that bug to see if we can get it moving, but I myself won't have time to tackle it immediately.
Blocks: ddd
Depends on: 1060869
No longer blocks: 846315
Blocks: 1065818
No longer blocks: 1065818
Depends on: 1116716
Wow, finally done! Resolving.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.