| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool ImageQualityController::has(RenderObject* renderer) | 63 bool ImageQualityController::has(RenderObject* renderer) |
| 64 { | 64 { |
| 65 return gImageQualityController && gImageQualityController->m_objectLayerSize
Map.contains(renderer); | 65 return gImageQualityController && gImageQualityController->m_objectLayerSize
Map.contains(renderer); |
| 66 } | 66 } |
| 67 | 67 |
| 68 InterpolationQuality ImageQualityController::chooseInterpolationQuality(Graphics
Context* context, RenderObject* object, Image* image, const void* layer, const L
ayoutSize& layoutSize) | 68 InterpolationQuality ImageQualityController::chooseInterpolationQuality(Graphics
Context* context, RenderObject* object, Image* image, const void* layer, const L
ayoutSize& layoutSize) |
| 69 { | 69 { |
| 70 if (object->style()->imageRendering() == ImageRenderingPixelated | 70 if (object->style()->imageRendering() == ImageRenderingPixelated) |
| 71 && image | |
| 72 && (layoutSize.width() > image->width() || layoutSize.height() > image->
height() || layoutSize == image->size())) { | |
| 73 return InterpolationNone; | 71 return InterpolationNone; |
| 74 } | |
| 75 | 72 |
| 76 if (InterpolationDefault == InterpolationLow) | 73 if (InterpolationDefault == InterpolationLow) |
| 77 return InterpolationLow; | 74 return InterpolationLow; |
| 78 | 75 |
| 79 if (shouldPaintAtLowQuality(context, object, image, layer, layoutSize)) | 76 if (shouldPaintAtLowQuality(context, object, image, layer, layoutSize)) |
| 80 return InterpolationLow; | 77 return InterpolationLow; |
| 81 | 78 |
| 82 // For images that are potentially animated we paint them at medium quality. | 79 // For images that are potentially animated we paint them at medium quality. |
| 83 if (image && image->maybeAnimated()) | 80 if (image && image->maybeAnimated()) |
| 84 return InterpolationMedium; | 81 return InterpolationMedium; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // This object has been resized to two different sizes while the timer | 229 // This object has been resized to two different sizes while the timer |
| 233 // is active, so draw at low quality, set the flag for animated resizes and | 230 // is active, so draw at low quality, set the flag for animated resizes and |
| 234 // the object to the list for high quality redraw. | 231 // the object to the list for high quality redraw. |
| 235 set(object, innerMap, layer, scaledLayoutSize); | 232 set(object, innerMap, layer, scaledLayoutSize); |
| 236 m_animatedResizeIsActive = true; | 233 m_animatedResizeIsActive = true; |
| 237 restartTimer(); | 234 restartTimer(); |
| 238 return true; | 235 return true; |
| 239 } | 236 } |
| 240 | 237 |
| 241 } // namespace blink | 238 } // namespace blink |
| OLD | NEW |