Closed
Bug 590252
Opened 14 years ago
Closed 14 years ago
Don't send incremental invalidations on image redecodes
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | beta5+ |
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(5 files, 3 obsolete files)
5.73 KB,
patch
|
joe
:
review+
|
Details | Diff | Splinter Review |
13.24 KB,
patch
|
joe
:
review+
|
Details | Diff | Splinter Review |
1.50 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
5.99 KB,
patch
|
joe
:
review+
|
Details | Diff | Splinter Review |
4.92 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
Part of bug 516320.
Assignee | ||
Comment 1•14 years ago
|
||
We want to be smarter about invalidations, but it's much easier to do it through the superclass. First we add a framework for this.
Assignee | ||
Comment 2•14 years ago
|
||
...then we make the decoders use it.
Assignee | ||
Comment 3•14 years ago
|
||
Currently we send invalidations way too often, and they aren't cheap (according to roc), even though the repaints are coalesced. This patch makes us smarter in that area.
Assignee | ||
Comment 4•14 years ago
|
||
Beltzner thought that this would be better UX than progressive display.
Assignee | ||
Comment 5•14 years ago
|
||
This fixes the flicker issue for the most part. For images with source data size less than 150k, we turn RequestDecode() into SyncDecode(). So big images still pop in asynchronously, but we don't have a flicker effect on most regular sized images. One crappy thing about this patch is that it means that we sometimes end up decoding _more_ on tab switch than we did in FF3.6, because the document tracker calls RequestDecode() on _everything_ when we tab over, not just things in the visible viewport. In theory we should be able to be smarter about it, and I'm going to work on that next. But given the impending beta, I wanted to get a patch stack up that fixes the flicker issue right away.
Assignee | ||
Updated•14 years ago
|
Attachment #469653 -
Flags: review?(joe)
Assignee | ||
Updated•14 years ago
|
Attachment #469654 -
Flags: review?(joe)
Assignee | ||
Updated•14 years ago
|
Attachment #469655 -
Flags: review?(joe)
Assignee | ||
Updated•14 years ago
|
Attachment #469656 -
Flags: review?(joe)
Assignee | ||
Updated•14 years ago
|
Attachment #469663 -
Flags: review?(joe)
Updated•14 years ago
|
Attachment #469653 -
Flags: review?(joe) → review+
Comment 6•14 years ago
|
||
Comment on attachment 469654 [details] [diff] [review] part 2 - v1 - Make decoder implementations use the Decoder superclass invalidation framework. >- // Offset to the frame position >- // Only notify observer(s) for first frame >- if (!mGIFStruct.images_decoded && mObserver) { >- PRUint32 imgCurFrame = mImage->GetCurrentFrameIndex(); >- mObserver->OnDataAvailable(nsnull, imgCurFrame == PRUint32(mGIFStruct.images_decoded), &r); >- } This means we're going to do sub-frame invalidations for animated images, right? We don't want that, I think. >- // Tell the image that it's data has been updated r+ strictly on the basis of removing this "it's" from the codebase.
Attachment #469654 -
Flags: review?(joe) → review+
Comment 7•14 years ago
|
||
Comment on attachment 469655 [details] [diff] [review] part 3 - v1 - Only flush invalidations when we need to >+ mInDecoder = PR_TRUE; >+ mDecoder->FlushInvalidations(); >+ mInDecoder = PR_FALSE; This pattern is pretty common in this patch, and it's quite ugly. Is it necessary? Also, it wasn't immediately obvious to me how the FlushInvalidations calls would result in us doing progressive decoding. It would be nice to have some comments to say how much of a frame is expected/known to be complete when at each FlushInvalidations call.
Attachment #469655 -
Flags: review?(joe) → review+
Comment 8•14 years ago
|
||
Comment on attachment 469663 [details] [diff] [review] part 5 - v1 - Make RequestDecode() SyncDecode() on images that are small enough. >+ // If it's a smallish image, it's not worth it to do things async >+ if (!mDecoded && !mInDecoder && mHasSourceData && (mSourceData.Length() < 150000)) >+ return SyncDecode(); >+ This should be a pref.
Attachment #469663 -
Flags: review?(joe) → review-
Updated•14 years ago
|
Attachment #469656 -
Flags: review?(joe) → review+
Assignee | ||
Comment 9•14 years ago
|
||
(In reply to comment #6) > This means we're going to do sub-frame invalidations for animated images, > right? We don't want that, I think. I don't think it matters. An image frame doesn't become current until it's fully decoded, so we'll always be passing aCurrentFrame=false for non-first-frames. The only important consumer that implements OnDataAvailable is nsImageFrame, which is a no-op for non-current frames: http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsImageFrame.cpp#542 Who knows what XUL and the like do, but I don't think it matters - we're not doing anything incorrect, we just could invalidate more than we need to. They're not the common case, so whatever.
Assignee | ||
Comment 10•14 years ago
|
||
Added a patch with more comments. carrying over r+.
> >+ mInDecoder = PR_TRUE;
> >+ mDecoder->FlushInvalidations();
> >+ mInDecoder = PR_FALSE;
>
> This pattern is pretty common in this patch, and it's quite ugly. Is it
> necessary?
At the moment it is, because we need to take different paths when we're re-entrant. We could probably architect it away, but that's a task for later.
Attachment #469656 -
Attachment is obsolete: true
Attachment #469920 -
Flags: review+
Assignee | ||
Comment 11•14 years ago
|
||
Added a patch making it a pref. Note that this is based on bug 590260. Flagging joe for review.
Attachment #469663 -
Attachment is obsolete: true
Assignee | ||
Updated•14 years ago
|
Attachment #469921 -
Flags: review?(joe)
Updated•14 years ago
|
Attachment #469921 -
Flags: review?(joe) → review+
Updated•14 years ago
|
blocking2.0: --- → beta5+
Assignee | ||
Comment 12•14 years ago
|
||
Oops, I accidentally uploaded-and-carried-over part 4, which didn't need it. Doing it for part 3, which is what I intended.
Attachment #469655 -
Attachment is obsolete: true
Attachment #469962 -
Flags: review+
Assignee | ||
Comment 13•14 years ago
|
||
Pushed to mozilla-central: part 1: http://hg.mozilla.org/mozilla-central/rev/24ae66f16d44 part 2: http://hg.mozilla.org/mozilla-central/rev/5875f7dbf9c6 part 3: http://hg.mozilla.org/mozilla-central/rev/9cf06ffbf06e part 4: http://hg.mozilla.org/mozilla-central/rev/17d4c9bde222 part 5: http://hg.mozilla.org/mozilla-central/rev/3df62472ba02 Resolving fixed.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•