зеркало из https://github.com/mozilla/gecko-dev.git
Bug 796174 - Only use the high-quality downscaler on downscales, not 1.0 scales. r=jlebar
This commit is contained in:
Родитель
9b48805329
Коммит
65398a1c60
|
@ -2801,6 +2801,19 @@ RasterImage::ScaleRequest::Stop(RasterImage* aImg)
|
|||
request->stopped = true;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
IsDownscale(const gfxSize& scale)
|
||||
{
|
||||
if (scale.width > 1.0)
|
||||
return false;
|
||||
if (scale.height > 1.0)
|
||||
return false;
|
||||
if (scale.width == 1.0 && scale.height == 1.0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
RasterImage::CanScale(gfxPattern::GraphicsFilter aFilter,
|
||||
gfxSize aScale)
|
||||
|
@ -2808,8 +2821,7 @@ RasterImage::CanScale(gfxPattern::GraphicsFilter aFilter,
|
|||
// The high-quality scaler requires Skia.
|
||||
#ifdef MOZ_ENABLE_SKIA
|
||||
if (gHQDownscaling && aFilter == gfxPattern::FILTER_GOOD &&
|
||||
!mAnim && mDecoded &&
|
||||
(aScale.width <= 1.0 && aScale.height <= 1.0)) {
|
||||
!mAnim && mDecoded && IsDownscale(aScale)) {
|
||||
gfxFloat factor = gHQDownscalingMinFactor / 1000.0;
|
||||
return (aScale.width < factor || aScale.height < factor);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче