Chromium Code Reviews| Index: Source/core/rendering/ImageQualityController.cpp |
| diff --git a/Source/core/rendering/ImageQualityController.cpp b/Source/core/rendering/ImageQualityController.cpp |
| index c9bdae70ea909590f357431089115d51c5025062..bd15ed251b6afe2c0e8adf1ec166d627bb8b4d10 100644 |
| --- a/Source/core/rendering/ImageQualityController.cpp |
| +++ b/Source/core/rendering/ImageQualityController.cpp |
| @@ -60,6 +60,18 @@ void ImageQualityController::remove(RenderObject* renderer) |
| } |
| } |
| +InterpolationQuality ImageQualityController::chooseInterpolationQuality(GraphicsContext* context, RenderObject* object, Image* image, const void* layer, const LayoutSize& layoutSize) |
| +{ |
| + if (shouldPaintAtLowQuality(context, object, image, layer, layoutSize)) |
| + return InterpolationLow; |
|
Stephen White
2014/03/18 17:26:43
We actually might want to consider using Medium he
Alpha Left Google
2014/03/18 22:59:13
That's right. We can update that later.
|
| + |
| + // For images that are potentially animated we paint them at low quality. |
|
Stephen Chennney
2014/03/18 12:56:32
This comment doesn't seem to match the code. Is th
Alpha Left Google
2014/03/18 22:59:13
The code is correct. I've updated the comments.
|
| + if (image && image->maybeAnimated()) |
| + return InterpolationMedium; |
| + |
| + return InterpolationDefault; |
| +} |
| + |
| ImageQualityController::~ImageQualityController() |
| { |
| // This will catch users of ImageQualityController that forget to call cleanUp. |
| @@ -137,10 +149,6 @@ bool ImageQualityController::shouldPaintAtLowQuality(GraphicsContext* context, R |
| if (object->style()->imageRendering() == ImageRenderingOptimizeContrast) |
| return true; |
| - // For images that are potentially animated we paint them at low quality. |
| - if (image->maybeAnimated()) |
| - return true; |
| - |
| // Look ourselves up in the hashtables. |
| ObjectLayerSizeMap::iterator i = m_objectLayerSizeMap.find(object); |
| LayerSizeMap* innerMap = i != m_objectLayerSizeMap.end() ? &i->value : 0; |