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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 if (gImageQualityController->isEmpty()) { | 56 if (gImageQualityController->isEmpty()) { |
57 delete gImageQualityController; | 57 delete gImageQualityController; |
58 gImageQualityController = 0; | 58 gImageQualityController = 0; |
59 } | 59 } |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 InterpolationQuality ImageQualityController::chooseInterpolationQuality(Graphics
Context* context, RenderObject* object, Image* image, const void* layer, const L
ayoutSize& layoutSize) | 63 InterpolationQuality ImageQualityController::chooseInterpolationQuality(Graphics
Context* context, RenderObject* object, Image* image, const void* layer, const L
ayoutSize& layoutSize) |
64 { | 64 { |
65 if (object->style()->imageRendering() == ImageRenderingPixelated | 65 if (object->style()->imageRendering() == ImageRenderingPixelated |
| 66 && image |
66 && (layoutSize.width() > image->width() || layoutSize.height() > image->
height())) { | 67 && (layoutSize.width() > image->width() || layoutSize.height() > image->
height())) { |
67 return InterpolationNone; | 68 return InterpolationNone; |
68 } | 69 } |
69 | 70 |
70 if (InterpolationDefault == InterpolationLow) | 71 if (InterpolationDefault == InterpolationLow) |
71 return InterpolationLow; | 72 return InterpolationLow; |
72 | 73 |
73 if (shouldPaintAtLowQuality(context, object, image, layer, layoutSize)) | 74 if (shouldPaintAtLowQuality(context, object, image, layer, layoutSize)) |
74 return InterpolationLow; | 75 return InterpolationLow; |
75 | 76 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 // This object has been resized to two different sizes while the timer | 227 // This object has been resized to two different sizes while the timer |
227 // is active, so draw at low quality, set the flag for animated resizes and | 228 // is active, so draw at low quality, set the flag for animated resizes and |
228 // the object to the list for high quality redraw. | 229 // the object to the list for high quality redraw. |
229 set(object, innerMap, layer, scaledLayoutSize); | 230 set(object, innerMap, layer, scaledLayoutSize); |
230 m_animatedResizeIsActive = true; | 231 m_animatedResizeIsActive = true; |
231 restartTimer(); | 232 restartTimer(); |
232 return true; | 233 return true; |
233 } | 234 } |
234 | 235 |
235 } // namespace WebCore | 236 } // namespace WebCore |
OLD | NEW |