Closed
Bug 1146663
Opened 10 years ago
Closed 9 years ago
Remove ImageLib's HQ scaling code, which has been replaced by downscale-during-decode
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla43
People
(Reporter: seth, Assigned: seth)
References
(Depends on 1 open bug)
Details
Attachments
(5 files, 1 obsolete file)
28.36 KB,
patch
|
tnikkel
:
review+
lizzard
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
4.63 KB,
patch
|
tnikkel
:
review+
lizzard
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
13.86 KB,
patch
|
tnikkel
:
review+
lizzard
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
18.72 KB,
patch
|
tnikkel
:
review+
lizzard
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
26.50 KB,
patch
|
lizzard
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
We should remove the "HQ scaling" code from ImageLib, since downscale-during-decode replaces it.
With it removed, we may also be able to remove imgFrame::Deoptimize, since I'm not sure that there are any other important users of it.
Comment 1•10 years ago
|
||
This seems to be a recent regression from 36, from bug 1144983. Is this a priority for 39? Should I be tracking this bug for 39 and 40 as well?
status-firefox38:
--- → wontfix
status-firefox39:
--- → affected
status-firefox40:
--- → affected
Flags: needinfo?(seth)
Assignee | ||
Comment 2•10 years ago
|
||
(In reply to Liz Henry (:lizzard) from comment #1)
> This seems to be a recent regression from 36, from bug 1144983. Is this a
> priority for 39? Should I be tracking this bug for 39 and 40 as well?
Any fix would not be upliftable. It's my goal to get this done during this quarter, but I can't guarantee this will land in Firefox 40. The problem is mainly that downscale-during-decode is not currently implemented for most image types - right now it only supports JPEGs. (That's why bug 1045926 is not yet resolved.) The image in bug 1144983 is a PNG, so we'd need PNG support to resolve that bug.
Flags: needinfo?(seth)
Assignee | ||
Comment 3•9 years ago
|
||
At this point the HQ scaling code is dead code, so let's remove it.
Attachment #8662801 -
Flags: review?(tnikkel)
Assignee | ||
Comment 4•9 years ago
|
||
After removing HQ scaling, there's nothing remaining that uses
Lifetime::Transient. (Except placeholders, but that's just because we had to
pick *some* lifetime for them. Regardless of their lifetime, placeholders don't
get locked.) That means the only possible lifetime is Lifetime::Persistent, so
there's no point in maintaining the lifetime concept at all. Let's remove that
idea from the SurfaceCache.
Attachment #8662803 -
Flags: review?(dholbert)
Assignee | ||
Comment 5•9 years ago
|
||
At this point there's no reason to ever deoptimize an imgFrame once it's been
optimized, so let's remove imgFrame::Deoptimize() totally.
Attachment #8662804 -
Flags: review?(tnikkel)
Assignee | ||
Comment 6•9 years ago
|
||
Since downscale-during-decode is supported by all content types and is the
normal state now, we can go ahead and stop deciding whether RasterImages should
support it in ImageFactory. Instead, we can verify that the DDD pref is enabled,
and that the image isn't transient, in RasterImage::CanDownscaleDuringDecode().
Attachment #8662806 -
Flags: review?(tnikkel)
Assignee | ||
Comment 7•9 years ago
|
||
Now that all image decoders suppor downscale-during-decode, we can make that a
requirement. That means that the downscaler can live on Decoder itself, and that
SetTargetSize() doesn't need to be virtual anymore.
Attachment #8662808 -
Flags: review?(tnikkel)
Assignee | ||
Comment 8•9 years ago
|
||
Assignee | ||
Comment 9•9 years ago
|
||
With these patches combined, 562 fewer lines!
Assignee | ||
Comment 10•9 years ago
|
||
Comment 11•9 years ago
|
||
[Adding dependency on bug 1060869, which is where SurfaceCache lifetimes were introduced.]
Depends on: 1060869
Comment 12•9 years ago
|
||
Comment on attachment 8662803 [details] [diff] [review]
(Part 2) - Remove the concept of lifetimes from the SurfaceCache
Nit: I found just one comment that still mentions "persistent" (in the lifetime sense) -- I think that word wants to be removed in this patch. It's in the documentation for OnSurfaceDiscarded, in Image.h:
220 * Called when the SurfaceCache discards a persistent surface belonging to
221 * this image.
222 */
223 virtual void OnSurfaceDiscarded() = 0;
http://mxr.mozilla.org/mozilla-central/source/image/Image.h?rev=8161b137af4a&force=1#220
Comment 13•9 years ago
|
||
Comment on attachment 8662803 [details] [diff] [review]
(Part 2) - Remove the concept of lifetimes from the SurfaceCache
r=me on part 2, with comment 12 addressed. Hooray for removing/simplifying code!
Attachment #8662803 -
Flags: review?(dholbert) → review+
Updated•9 years ago
|
Attachment #8662801 -
Flags: review?(tnikkel) → review+
Comment 14•9 years ago
|
||
Comment on attachment 8662804 [details] [diff] [review]
(Part 3) - Make it impossible to deoptimize imgFrames
Hooray!
Attachment #8662804 -
Flags: review?(tnikkel) → review+
Updated•9 years ago
|
Attachment #8662806 -
Flags: review?(tnikkel) → review+
Updated•9 years ago
|
Attachment #8662808 -
Flags: review?(tnikkel) → review+
Assignee | ||
Comment 15•9 years ago
|
||
Thanks for the reviews! I'll upload an updated version of part 2 shortly with that nit addressed.
Assignee | ||
Comment 16•9 years ago
|
||
Nits addressed.
Assignee | ||
Updated•9 years ago
|
Attachment #8662803 -
Attachment is obsolete: true
Assignee | ||
Comment 17•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b6a3ec30a14
https://hg.mozilla.org/integration/mozilla-inbound/rev/83a6dc9ee30c
https://hg.mozilla.org/integration/mozilla-inbound/rev/77357a5a1ad1
https://hg.mozilla.org/integration/mozilla-inbound/rev/07d6fcc70e7c
https://hg.mozilla.org/integration/mozilla-inbound/rev/c0d3f6e2a3e3
Comment 18•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/2b6a3ec30a14
https://hg.mozilla.org/mozilla-central/rev/83a6dc9ee30c
https://hg.mozilla.org/mozilla-central/rev/77357a5a1ad1
https://hg.mozilla.org/mozilla-central/rev/07d6fcc70e7c
https://hg.mozilla.org/mozilla-central/rev/c0d3f6e2a3e3
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I believe this is how the flags should be set at this point.
Status: REOPENED → RESOLVED
Closed: 9 years ago → 9 years ago
status-firefox44:
--- → fixed
Flags: needinfo?(seth)
Resolution: --- → FIXED
Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(seth)
Assignee | ||
Comment 21•9 years ago
|
||
Comment on attachment 8662801 [details] [diff] [review]
(Part 1) - Remove HQ scaling, which is now dead code
Approval Request Comment
[Feature/regressing bug #]: These patches transition us fully from the old "high-quality" downscaling code to downscale-during-decode. We measured a 96% reduction in time spent drawing images when painting the about:newtab page from making this change, so it'd be nice to get this into 43 if we can and ship those perf improvements.
[User impact if declined]: We lose out on those performance gains for drawing large images, and in particular we lose out on about:newtab.
[Describe test coverage new/current, TreeHerder]: On m-c for weeks now, with tests. (And we're working to add more tests.)
[Risks and why]: Not expected to be high risk as the code has been on m-c for so long, and there was never a regression related to it; it got backed out because it depended on bug 1201796, which we've since uplifted again.
[String/UUID change made/needed]: None.
Attachment #8662801 -
Flags: approval-mozilla-aurora?
Assignee | ||
Updated•9 years ago
|
Attachment #8663257 -
Flags: approval-mozilla-aurora?
Assignee | ||
Updated•9 years ago
|
Attachment #8662804 -
Flags: approval-mozilla-aurora?
Assignee | ||
Updated•9 years ago
|
Attachment #8662806 -
Flags: approval-mozilla-aurora?
Assignee | ||
Updated•9 years ago
|
Attachment #8662808 -
Flags: approval-mozilla-aurora?
Comment 22•9 years ago
|
||
Comment on attachment 8662801 [details] [diff] [review]
(Part 1) - Remove HQ scaling, which is now dead code
Approved for uplift to aurora, perf improvement, has tests.
Please uplift parts 1-5.
Attachment #8662801 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•9 years ago
|
Attachment #8662804 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•9 years ago
|
Attachment #8662806 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•9 years ago
|
Attachment #8662808 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•9 years ago
|
Attachment #8663257 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Comment 23•9 years ago
|
||
Uplifted with trivial rebase:
https://hg.mozilla.org/releases/mozilla-aurora/rev/b1e93301c3cf
https://hg.mozilla.org/releases/mozilla-aurora/rev/dfb869dc6a74
https://hg.mozilla.org/releases/mozilla-aurora/rev/7ef75c70593d
https://hg.mozilla.org/releases/mozilla-aurora/rev/7e0e6b839983
https://hg.mozilla.org/releases/mozilla-aurora/rev/5fdb49f370a7
You need to log in
before you can comment on or make changes to this bug.
Description
•