Closed Bug 796174 Opened 13 years ago Closed 13 years ago

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

Categories

(Core :: Graphics: ImageLib, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18
Tracking Status
firefox18 --- fixed

People

(Reporter: joe, Assigned: joe)

Details

Attachments

(1 file)

Right now we do a high-quality scale on unity scales. This is obviously wrong.
Attachment #666747 - Flags: review?(justin.lebar+bug)
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+
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.
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: