Closed
Bug 77497
Opened 23 years ago
Closed 22 years ago
imgContainer needs to have a GIF specific version
Categories
(Core :: Graphics: ImageLib, defect, P1)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
Future
People
(Reporter: saari, Assigned: paper)
References
Details
(Keywords: memory-footprint)
Attachments
(3 files, 15 obsolete files)
48.34 KB,
patch
|
Biesinger
:
review+
tor
:
superreview+
|
Details | Diff | Splinter Review |
3.23 KB,
patch
|
Details | Diff | Splinter Review | |
48.63 KB,
patch
|
paper
:
review+
paper
:
superreview+
|
Details | Diff | Splinter Review |
imgContainer has gotten too overloaded, needs to be spit up into a GIF specific version and a general version.
Reporter | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.1
Updated•23 years ago
|
Target Milestone: mozilla0.9.1 → mozilla0.9.3
Reporter | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.3 → mozilla1.0
Reporter | ||
Updated•23 years ago
|
Target Milestone: mozilla1.0 → mozilla1.0.1
Assignee | ||
Comment 1•22 years ago
|
||
I've been living and breathing imgContainer.cpp for the past 2+ weeks. I'm willing to make an imgContainerGIF and move relevent code to that module. That'll free up your time for other more important things. The only question I have (so far) is: why is this bug marked as Mac Platform and not All?
Comment 2•22 years ago
|
||
marking platform->all since that's the only sensible value for this bug
Hardware: Macintosh → All
Assignee | ||
Comment 3•22 years ago
|
||
taking bug from saari & ccing people who love bugmail I'll post a patch after Bug 85595 gets checked-in
Assignee: saari → paper
Status: ASSIGNED → NEW
Priority: -- → P1
Target Milestone: mozilla1.0.1 → mozilla1.1beta
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Updated•22 years ago
|
Assignee | ||
Comment 4•22 years ago
|
||
I intend to have 3 patches: 1) imgContainer stripped of gif stuff (this one) 2) imgContainerGIF (basically a copy of imgContainer before the strip, along with the required class name changes and compiler stuff) 3) Mac build file, which I will need someone with a Mac to do. I intend to make no changes in imgContainerGIF other than the class name changes and trailing white space removal. This will make for a faster review. Any code standardizations and optimizations will be done in other bugs (See Bug 148637) I anticipate that (1) will need the most "tender-lov'n reviewing" since after stripping, I cleaned it up and put in null checking everywhere I could.
Assignee | ||
Comment 5•22 years ago
|
||
Comment on attachment 86834 [details] [diff] [review] Patch 1of3: imgContainer stripped of gif stuff ignore that patch, it's diff'd on the wrong files
Attachment #86834 -
Attachment is obsolete: true
Comment 6•22 years ago
|
||
>2) imgContainerGIF (basically a copy of imgContainer before the strip, along
>with the required class name changes and compiler stuff)
Hm, is ContainerGIF really so different? As in, might it be a good idea to make
imgContainerGIF inherit from imgContainer, so that common code could be shared?
Assignee | ||
Comment 7•22 years ago
|
||
See Comment #4 for info on this patch. One question I anticipated from reviewers is about the removal of code from DecodingComplete. Only GIFs called DecodingComplete, so it's safe. (I may create a new bug to deal with removing or making all decoders use DecodingComplete) biesi, after the strip down, imgContainer contains hardly any code. The only common code that imgContainerGIF could use would be a few of the one-liner functions. The 2 biggest functions left in imgContainer, AppendFrame and Notify will look very different after Bug 148637. Actually, I question leaving the animation code bits in there in the first place. Replacing the animation functions with NS_ERROR_NOT_IMPLEMENTED and removing the variables would save a few bytes and get rid of that nsITimerCallback. Perhaps a good idea for another RFE bug, but out of the scope of this bug, IMO.
Assignee | ||
Comment 8•22 years ago
|
||
Addition of 2 files, plus changes to Makefile.in, Makefile.win, nsGIFDecoder2.cpp, and nsGIFModule.cpp. I think that's all I need to modify.
Assignee | ||
Comment 9•22 years ago
|
||
This proves that imgContainerGIF.cpp is the same as imgContainer.cpp with the exception of the class name. (meaning there's no need to review the imgContainerGIF.cpp code)
Assignee | ||
Comment 10•22 years ago
|
||
All my imgContainer patches seem to be in now. I'll be un-bitrotting the patches in this bug within the next day or two.
Assignee | ||
Comment 11•22 years ago
|
||
diff'd against imgContainer.h v1.15 and imgContainer.cpp v1.32
Attachment #87830 -
Attachment is obsolete: true
Assignee | ||
Comment 12•22 years ago
|
||
only diff change is in imgContainerGIF. Same diff for the rest of the files (no new checkins in them)
Attachment #87853 -
Attachment is obsolete: true
Assignee | ||
Comment 13•22 years ago
|
||
diff'd against imgContainer.cpp is v1.32 (latest) to prove that nothing was changed.
Attachment #87855 -
Attachment is obsolete: true
Assignee | ||
Comment 14•22 years ago
|
||
pavlov, tor: a r= and sr= before someone patches modules/libpr0n/decoders/src/imgContainer.* or modules/libpr0n/decoders/gif/* again would be nice. The sooner this one gets in, the sooner I can put up the patches for the bugs that this block. :)
Assignee | ||
Comment 15•22 years ago
|
||
fixed spelling error in makefile.win.. imgConatiner -> imgContainer
Attachment #90259 -
Attachment is obsolete: true
Comment 16•22 years ago
|
||
Comment on attachment 90340 [details] [diff] [review] Patch 2of3: imgContainerGIF r=pavlov
Attachment #90340 -
Flags: review+
Assignee | ||
Updated•22 years ago
|
Target Milestone: mozilla1.1beta → mozilla1.2alpha
Assignee | ||
Comment 17•22 years ago
|
||
futuring since I don't have time to hunt down r='s
Target Milestone: mozilla1.2alpha → Future
Assignee | ||
Comment 18•22 years ago
|
||
Attachment #90257 -
Attachment is obsolete: true
Assignee | ||
Updated•22 years ago
|
Attachment #90262 -
Attachment is obsolete: true
Assignee | ||
Comment 19•22 years ago
|
||
Attachment #90340 -
Attachment is obsolete: true
Assignee | ||
Comment 20•22 years ago
|
||
Patches are now current.
Assignee | ||
Comment 21•22 years ago
|
||
Corrected diff so the new files are added to the right directory.
Attachment #101084 -
Attachment is obsolete: true
Assignee | ||
Comment 22•22 years ago
|
||
New checkins today, current patches won't apply. Another set of patches coming up shortly.
Assignee | ||
Comment 23•22 years ago
|
||
did a cvs diff from the root this time
Attachment #101083 -
Attachment is obsolete: true
Assignee | ||
Comment 24•22 years ago
|
||
Attachment #101106 -
Attachment is obsolete: true
Assignee | ||
Comment 25•22 years ago
|
||
As per discussion with tor, all animation code has been removed. imgContainer is now one frame only.
Attachment #101721 -
Attachment is obsolete: true
Assignee | ||
Updated•22 years ago
|
Comment 26•22 years ago
|
||
Comment on attachment 101722 [details] [diff] [review] 2of3: imgContainerGIF A couple of small argument checking things: * GetCurrentFrame should check for a null pointer * GetNumFrames should return with NS_ERROR_NULL_POINTER if the arg is null instead of trying to assign through it.
Comment 27•22 years ago
|
||
Comment on attachment 101722 [details] [diff] [review] 2of3: imgContainerGIF Ignore that comment - wrong attachment. sr=tor
Attachment #101722 -
Flags: superreview+
Comment 28•22 years ago
|
||
Comment on attachment 101847 [details] [diff] [review] 1of3: imgContainer stripped of multi-frames A couple of small argument checking things: * GetCurrentFrame should check for a null pointer * GetNumFrames should return with NS_ERROR_NULL_POINTER if the arg is null instead of trying to assign through it.
Comment 29•22 years ago
|
||
re attachment 101847 [details] [diff] [review] (patch 1 of 3): + mFrame = nsnull; + NS_RELEASE(mFrame); doesn't look right to me :) also, maybe you should use a COMPtr for it? + if (!mFrame) + return NS_ERROR_FAILURE; + *aCurrentFrame = mFrame; + NS_IF_ADDREF(*aCurrentFrame); mFrame can not be null here. therefore, you can use NS_ADDREF rather than NS_IF_ADDREF + *aNumFrames = (mFrame) ? 1 : 0; no need for parentheses + NS_IF_ADDREF(*_retval); as above, use NS_ADDREF. + mFrame = item; + NS_ADDREF(mFrame); when using a COMPtr for mFrame as suggested above, you can remove the ADDREF here. NS_IMETHODIMP imgContainer::DecodingComplete(void) { - mDoneDecoding = PR_TRUE; - - PRUint32 numFrames; - mFrames.Count(&numFrames); - if (numFrames == 1) { - nsCOMPtr<gfxIImageFrame> currentFrame; - inlinedGetFrameAt(0, getter_AddRefs(currentFrame)); - currentFrame->SetMutable(PR_FALSE); - } return NS_OK; um, shouldn't you still do the SetMutable call? in StartAnimation and StopAnimation: I am not sure if NOT_IMPLEMENTED is the right thing to return. The old implementation returned NS_OK even if there was nothing to animate. SetLoopCount: you are always returning NOT_IMPLEMENTED here. this is inconsistent with SetAnimationMode, which returns OK but ignores the argument. rest of this patch looks ok on first sight.
Comment 30•22 years ago
|
||
Comment on attachment 101722 [details] [diff] [review] 2of3: imgContainerGIF r=biesi; I trust you that imgContainerGIF is indeed identical to the old imgCotainer except the name.
Attachment #101722 -
Flags: review+
Assignee | ||
Comment 31•22 years ago
|
||
-changed everything that biesi (see notes) and tor mentioned -removed NS_DECL_IMGICONTAINEROBSERVER -removed imgIDecoderObserver imgContainer is a wee thing now! :O Biesi: -DecodingComplete is only called by the GIF decoder. So the SetMutable is useless for anything else. (JPGs, for example, SetMutable inside the decoder) -Both [Get,Set]LoopCount now return NS_ERROR_NOT_IMPLEMENTED, and both AnimationModes return NS_OK. In other words, we are faking implementation of AnimationMode, and not implementing LoopCount.
Attachment #101847 -
Attachment is obsolete: true
Comment 32•22 years ago
|
||
Comment on attachment 101950 [details] [diff] [review] 1of3: imgContainer stripped thanks for the changes - I noticed some more things, though: in GetCurrentFrame: maybe NS_ERROR_NOT_INITIALIZED would be more appropriate than _FAILURE? looks great otherwise! I'm alas unable to test the patch currently... just make sure that you test well :) r=biesi.
Attachment #101950 -
Flags: review+
Comment 33•22 years ago
|
||
Comment on attachment 101950 [details] [diff] [review] 1of3: imgContainer stripped Please either remove all the NS_ENSURE crap or move the return outside a macro. Macros that return suck ass for debugging since you can't break on return. I think that checking these out paramters is a waste of cycles and just clutters up the code, but if you really really want them, then change them all to something that doesn't have return in the macro. aside from this, the patch looks good. Post a new patch and i'll r= it.
Attachment #101950 -
Flags: review+ → needs-work+
Assignee | ||
Comment 34•22 years ago
|
||
For all you anti NS_ENSURE-ers out there :)
Attachment #101950 -
Attachment is obsolete: true
Comment 35•22 years ago
|
||
Comment on attachment 102024 [details] [diff] [review] 1of3: imgContainer stripped bleh, r=pavlov
Attachment #102024 -
Flags: review+
Comment 36•22 years ago
|
||
Comment on attachment 102024 [details] [diff] [review] 1of3: imgContainer stripped sr=tor
Attachment #102024 -
Flags: superreview+
Comment 37•22 years ago
|
||
Not fully tested, but should work, as per #mozilla w/Paper, jkeiser.
Assignee | ||
Comment 38•22 years ago
|
||
Same as previous, except with the following bustage fix patch (1 line, variable name wrong) http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=mozilla/modules/libpr0n/src&command=DIFF_FRAMESET&file=imgContainer.cpp&rev1=1.35&rev2=1.36&root=/cvsroot
Attachment #102024 -
Attachment is obsolete: true
Assignee | ||
Comment 39•22 years ago
|
||
Comment on attachment 102095 [details] [diff] [review] 1of3: imgContainer stripped - end check-in transferring r= & sr=
Attachment #102095 -
Flags: superreview+
Attachment #102095 -
Flags: review+
Assignee | ||
Comment 40•22 years ago
|
||
Patches checked in on 10/07/2002 14:45 & 10/07/2002 14:49 Bustage fixed on 10/07/2002 15:25
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•