| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 it->key->repaint(); | 119 it->key->repaint(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 m_liveResizeOptimizationIsActive = false; | 122 m_liveResizeOptimizationIsActive = false; |
| 123 } | 123 } |
| 124 | 124 |
| 125 void ImageQualityController::restartTimer() | 125 void ImageQualityController::restartTimer() |
| 126 { | 126 { |
| 127 m_timer.startOneShot(cLowQualityTimeThreshold); | 127 m_timer.startOneShot(cLowQualityTimeThreshold, FROM_HERE); |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool ImageQualityController::shouldPaintAtLowQuality(GraphicsContext* context, R
enderObject* object, Image* image, const void *layer, const LayoutSize& layoutSi
ze) | 130 bool ImageQualityController::shouldPaintAtLowQuality(GraphicsContext* context, R
enderObject* object, Image* image, const void *layer, const LayoutSize& layoutSi
ze) |
| 131 { | 131 { |
| 132 // If the image is not a bitmap image, then none of this is relevant and we
just paint at high | 132 // If the image is not a bitmap image, then none of this is relevant and we
just paint at high |
| 133 // quality. | 133 // quality. |
| 134 if (!image || !image->isBitmapImage() || context->paintingDisabled()) | 134 if (!image || !image->isBitmapImage() || context->paintingDisabled()) |
| 135 return false; | 135 return false; |
| 136 | 136 |
| 137 if (object->style()->imageRendering() == ImageRenderingOptimizeContrast) | 137 if (object->style()->imageRendering() == ImageRenderingOptimizeContrast) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // This object has been resized to two different sizes while the timer | 203 // This object has been resized to two different sizes while the timer |
| 204 // is active, so draw at low quality, set the flag for animated resizes and | 204 // is active, so draw at low quality, set the flag for animated resizes and |
| 205 // the object to the list for high quality redraw. | 205 // the object to the list for high quality redraw. |
| 206 set(object, innerMap, layer, scaledLayoutSize); | 206 set(object, innerMap, layer, scaledLayoutSize); |
| 207 m_animatedResizeIsActive = true; | 207 m_animatedResizeIsActive = true; |
| 208 restartTimer(); | 208 restartTimer(); |
| 209 return true; | 209 return true; |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace WebCore | 212 } // namespace WebCore |
| OLD | NEW |