Closed
Bug 317748
Opened 18 years ago
Closed 17 years ago
Merge BlackenFrame and SetMaskVisibility into ClearFrame
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
VERIFIED
FIXED
mozilla1.9alpha6
People
(Reporter: alfredkayser, Assigned: alfredkayser)
References
Details
(Keywords: memory-footprint)
Attachments
(1 file, 9 obsolete files)
16.31 KB,
patch
|
tor
:
superreview+
|
Details | Diff | Splinter Review |
Minor callpath optimisation, for less code and more clarity: Replace the two functions: 'BlackenFrame(aFrame);SetMaskVisibility(aFrame, PR_FALSE);' with one function: 'ClearFrame(aFrame);' Before: 16.448 imgContainerGIF.obj 39.630 imggif_s.lib After: 16.181 imgContainerGIF.obj 39.230 imggif_s.lib Saving: about 400 bytes
Assignee | ||
Comment 1•18 years ago
|
||
Attachment #204150 -
Flags: review?
Assignee | ||
Updated•18 years ago
|
Attachment #204150 -
Flags: review? → review?(pavlov)
Assignee | ||
Comment 2•17 years ago
|
||
When in Cairo, a little more that can be achieved, so a new patch is in order. (all SetMask/CombineMask/etc stuff is not needed for Cairo).
Comment 3•17 years ago
|
||
Comment on attachment 204150 [details] [diff] [review] Combine BlackenFrame and SetMaskVisibility into ClearFrame this should be updated to the trunk. sorry for taking so long to look at this.
Attachment #204150 -
Attachment is obsolete: true
Attachment #204150 -
Flags: review?(pavlov)
Assignee | ||
Comment 4•17 years ago
|
||
Also remove the SetMaskVisibility and BuildCompositeMask stuff, which is not needed for Cairo
Assignee | ||
Comment 6•17 years ago
|
||
Attachment #253225 -
Attachment is obsolete: true
Attachment #253225 -
Flags: review?(pavlov)
Assignee | ||
Updated•17 years ago
|
Attachment #253370 -
Flags: review?(pavlov)
Assignee | ||
Comment 7•17 years ago
|
||
Some statistics: Directory of C:\mozilla\suite-opt\modules\libpr0n\decoders\gif 28-02-2007 22:22 72.024 imggif_s.lib Directory of C:\mozilla\suite-opt\modules\libpr0n\decoders\gif\old 28-02-2007 22:16 84.272 imggif_s.lib So more than 12K code savings, with a simple patch!
Attachment #253370 -
Attachment is obsolete: true
Attachment #256837 -
Flags: review?(pavlov)
Attachment #253370 -
Flags: review?(pavlov)
Assignee | ||
Comment 8•17 years ago
|
||
Comment on attachment 256837 [details] [diff] [review] V4: updated to current tree (after Cairo cleanup) This is a patch! Some explanation: Make ClearFrame also clear the alpha byte. Remove BuildCompositeMask as it is no longer needed because of Cairo.
Attachment #256837 -
Attachment is patch: true
Attachment #256837 -
Attachment mime type: application/octet-stream → text/plain
Comment 9•17 years ago
|
||
I think this is probably fine but i'd like to wait until apng is in so andrew doesn't have any more merge conflicts he has to deal with.
Comment 10•17 years ago
|
||
ok, APNG is in the tree. Can you put together an updated patch?
Assignee | ||
Comment 11•17 years ago
|
||
Note, also tested with APNG's from http://littlesvr.ca/apng/
Attachment #256837 -
Attachment is obsolete: true
Attachment #260575 -
Flags: review?(pavlov)
Attachment #256837 -
Flags: review?(pavlov)
Comment 12•17 years ago
|
||
Comment on attachment 260575 [details] [diff] [review] v5: Patch imgContainer Rather than doing a memset() I think we'd be better off using the gfxContext code that was there before. Probably worth also setting the operator to OPERATOR_CLEAR. This allows is potentially much faster for some surfaces and is probably a bit slower for image surfaces.
Attachment #260575 -
Flags: review?(pavlov) → review-
Assignee | ||
Comment 13•17 years ago
|
||
Attachment #260575 -
Attachment is obsolete: true
Attachment #261117 -
Flags: review?(pavlov)
Updated•17 years ago
|
Attachment #261117 -
Flags: review?(pavlov) → review+
Assignee | ||
Updated•17 years ago
|
Attachment #261117 -
Flags: superreview?(tor)
Comment 14•17 years ago
|
||
Comment on attachment 261117 [details] [diff] [review] v6: Use Cairo and OPERATOR_CLEAR to clear the frame >+void imgContainer::ClearFrame(gfxIImageFrame *aFrame, nsIntRect &aRect) ... >+ // Erase the destination rectangle to transparent > nsRefPtr<gfxContext> ctx = new gfxContext(surf); >- ctx->SetColor(gfxRGBA(0, 0, 0)); >- ctx->Rectangle(gfxRect(aX, aY, aWidth, aHeight)); >+ ctx->SetOperator(gfxContext::OPERATOR_CLEAR); >+ ctx->SetColor(gfxRGBA(0, 0, 0, 0)); >+ ctx->Rectangle(gfxRect(aRect.x, aRect.y, aRect.width, aRect.height)); > ctx->Fill(); We don't need SetColor for OPERATOR_CLEAR, do we? With that change, sr=tor.
Attachment #261117 -
Flags: superreview?(tor) → superreview+
Assignee | ||
Comment 15•17 years ago
|
||
Attachment #261117 -
Attachment is obsolete: true
Assignee | ||
Comment 16•17 years ago
|
||
Who can do the checkin for me? Thanks in advance, Alfred
Whiteboard: [checkin needed]
Comment 17•17 years ago
|
||
mozilla/modules/libpr0n/src/imgContainer.cpp 1.44 mozilla/modules/libpr0n/src/imgContainer.h 1.22
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha4
Comment 18•17 years ago
|
||
Backed out due to tree bustage: nsGIFDecoder2.cpp /builds/slave/trunk_osx/mozilla/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp: In static member function 'static int nsGIFDecoder2::HaveDecodedRow(void*, PRUint8*, int, int, int)': /builds/slave/trunk_osx/mozilla/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp:479: error: 'BlackenFrame' is not a member of 'imgContainer' http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp&rev=1.74&mark=479#479 this got added before your last patch.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 19•17 years ago
|
||
Attachment #261361 -
Attachment is obsolete: true
Comment 20•17 years ago
|
||
Does this need a re-review or can it be landed?
Assignee | ||
Comment 21•17 years ago
|
||
Comment on attachment 262889 [details] [diff] [review] V8: Also fix nsGIFDecoder Tor, can you sr the part for nsGIFDecoder2.cpp?
Attachment #262889 -
Flags: superreview?(tor)
Comment 22•17 years ago
|
||
Comment on attachment 262889 [details] [diff] [review] V8: Also fix nsGIFDecoder >--- modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp 20 Mar 2007 23:56:49 -0000 1.74 >+++ modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp 26 Apr 2007 14:12:07 -0000 >@@ -470,19 +470,17 @@ int nsGIFDecoder2::HaveDecodedRow( ... > if (!cmap) { // cmap could have null value if the global color table flag is 0 >- for (int i = 0; i < aDuplicateCount; ++i) { >- imgContainer::BlackenFrame(decoder->mImageFrame, 0, aRowNumber+i, width, 1); >- } >+ imgContainer::ClearFrame(decoder->mImageFrame, 0, aRowNumber+i, width, aDuplicateCount); This won't build, due to "i" being undefined and the only ClearFrame methods in imgContainer accepting one or two arguments.
Attachment #262889 -
Flags: superreview?(tor) → superreview-
Assignee | ||
Comment 23•17 years ago
|
||
This one should be right. Compiled and tested against my library of test agif's. Note, bug 376446 seems to fixed by the patch as well. My guess would be that the 'BuildCompositeMask' function doesn't work well in Cairo...
Attachment #262889 -
Attachment is obsolete: true
Attachment #263343 -
Flags: superreview?
Assignee | ||
Comment 24•17 years ago
|
||
Note, the following image is not animated right in current builds. http://littlesvr.ca/apng/images/lion-rgb-3frame.png With this patch applied it works ok. (The second frame should blend with the first, but it stripes the old frame, indicating a faulty BuildCompositeMask). More testcases are at: http://littlesvr.ca/apng/
Comment 25•17 years ago
|
||
alfred, did you mean to actually request sr from tor on your v9 patch? :-)
Comment 26•17 years ago
|
||
Also, I should note that I've had the v9 patch in my local tree since it was posted and haven't noticed any visible regressions in the near month it's been there.
Assignee | ||
Updated•17 years ago
|
Attachment #263343 -
Flags: superreview? → superreview?(tor)
Assignee | ||
Comment 27•17 years ago
|
||
Confirmed with my local build with this patch applied that bug 382764 is fixed by this patch.
Comment 28•17 years ago
|
||
(In reply to comment #23) > Created an attachment (id=263343) [details] > V9: The right patch to nsGIFDecoder2.cpp One small note: in imgContainer::ClearFrame and imgContainerGIF::BlackenFrame, you can stack allocate the gfxContext rather than using nsRefPtr/new.
Assignee | ||
Comment 29•17 years ago
|
||
Note, there are great many other places with gfxContext could be placed on the stack...
Attachment #263343 -
Attachment is obsolete: true
Attachment #267161 -
Flags: superreview?(tor)
Attachment #263343 -
Flags: superreview?(tor)
Comment 30•17 years ago
|
||
Sounds like a followup bug to me
Assignee | ||
Comment 31•17 years ago
|
||
Created bug 383166 for the followup on stack allocation of gfxContext.
Attachment #267161 -
Flags: superreview?(tor) → superreview+
Comment 33•17 years ago
|
||
Checked in for Alfred.
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Whiteboard: [checkin needed]
Target Milestone: mozilla1.9alpha4 → mozilla1.9alpha6
Updated•17 years ago
|
Flags: in-testsuite-
Assignee | ||
Comment 34•17 years ago
|
||
Thanks! Tinderboxes all green: firefox-bin Total: -944 (+448/-1392) Code: -941 (+0/+0) Data: -3 (+448/-1392)
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•