Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Don't use high-quality scaler for non-downscales

RESOLVED FIXED in Firefox 18

Status

()

Core
ImageLib
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Joe Drew (not getting mail), Assigned: Joe Drew (not getting mail))

Tracking

unspecified
mozilla18
x86
Mac OS X
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(firefox18 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 666747 [details] [diff] [review]
ensure only downscales are scaled

Right now we do a high-quality scale on unity scales. This is obviously wrong.
Attachment #666747 - Flags: review?(justin.lebar+bug)
(Assignee)

Updated

5 years ago
Assignee: nobody → joe
Comment on attachment 666747 [details] [diff] [review]
ensure only downscales are scaled

Heh.

I'm not sure what the extra function is buying us, but either way is fine.  If you keep the function, can you mark it static or put it in an anonymous namespace?
Attachment #666747 - Flags: review?(justin.lebar+bug) → review+
(Assignee)

Comment 2

5 years ago
I couldn't think of a clearer way to express "Only downscales" than having three conditions, and IME having a separate function is helpful when you start adding tons of conditions.
(In reply to Joe Drew (:JOEDREW! \o/) from comment #2)
> I couldn't think of a clearer way to express "Only downscales" than having
> three conditions, and IME having a separate function is helpful when you
> start adding tons of conditions.

I mean we already have a function saying "are we going to downscale this?", so if you wrote it as

 bool
 RasterImage::CanScale(gfxPattern::GraphicsFilter aFilter,
                       gfxSize aScale)
 {
 // The high-quality scaler requires Skia.
 #ifdef MOZ_ENABLE_SKIA
   if (!gHQDownscaling || mAnim || !mDecoded ||
       aFilter != gfxPattern::FILTER_GOOD ) {
     return false;
   }

   if (scale.width > 1.0 || scale.height > 1.0) {
     return false;
   }

   if (scale.width == 1.0 && scale.height == 1.0) {
     return false;
   }

   gfxFloat factor = gHQDownscalingMinFactor / 1000.0;
   return (aScale.width < factor || aScale.height < factor);
 #endif

That would be plenty clear to me.
(Assignee)

Comment 4

5 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/629c399c6f8c
status-firefox18: --- → fixed
Target Milestone: --- → mozilla18
(Assignee)

Comment 5

5 years ago
Backed out: https://hg.mozilla.org/integration/mozilla-inbound/rev/90332928696a
and relanded: https://hg.mozilla.org/integration/mozilla-inbound/rev/6925601f4299
https://hg.mozilla.org/mozilla-central/rev/6925601f4299
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.