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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 m_liveResizeOptimizationIsActive = true; | 182 m_liveResizeOptimizationIsActive = true; |
183 return true; | 183 return true; |
184 } | 184 } |
185 if (m_liveResizeOptimizationIsActive) { | 185 if (m_liveResizeOptimizationIsActive) { |
186 // Live resize has ended, paint in HQ and remove this object from th
e list. | 186 // Live resize has ended, paint in HQ and remove this object from th
e list. |
187 removeLayer(object, innerMap, layer); | 187 removeLayer(object, innerMap, layer); |
188 return false; | 188 return false; |
189 } | 189 } |
190 } | 190 } |
191 | 191 |
| 192 // See crbug.com/382491. This test is insufficient to ensure that there is n
o scale |
| 193 // applied in the compositor, but it is probably adequate here. In the worst
case we |
| 194 // draw at high quality when we need not. |
192 if (!contextIsScaled && scaledLayoutSize == scaledImageSize) { | 195 if (!contextIsScaled && scaledLayoutSize == scaledImageSize) { |
193 // There is no scale in effect. If we had a scale in effect before, we c
an just remove this object from the list. | 196 // There is no scale in effect. If we had a scale in effect before, we c
an just remove this object from the list. |
194 removeLayer(object, innerMap, layer); | 197 removeLayer(object, innerMap, layer); |
195 return false; | 198 return false; |
196 } | 199 } |
197 | 200 |
198 // If an animated resize is active, paint in low quality and kick the timer
ahead. | 201 // If an animated resize is active, paint in low quality and kick the timer
ahead. |
199 if (m_animatedResizeIsActive) { | 202 if (m_animatedResizeIsActive) { |
200 set(object, innerMap, layer, scaledLayoutSize); | 203 set(object, innerMap, layer, scaledLayoutSize); |
201 restartTimer(); | 204 restartTimer(); |
(...skipping 16 matching lines...) Expand all Loading... |
218 // This object has been resized to two different sizes while the timer | 221 // This object has been resized to two different sizes while the timer |
219 // is active, so draw at low quality, set the flag for animated resizes and | 222 // is active, so draw at low quality, set the flag for animated resizes and |
220 // the object to the list for high quality redraw. | 223 // the object to the list for high quality redraw. |
221 set(object, innerMap, layer, scaledLayoutSize); | 224 set(object, innerMap, layer, scaledLayoutSize); |
222 m_animatedResizeIsActive = true; | 225 m_animatedResizeIsActive = true; |
223 restartTimer(); | 226 restartTimer(); |
224 return true; | 227 return true; |
225 } | 228 } |
226 | 229 |
227 } // namespace WebCore | 230 } // namespace WebCore |
OLD | NEW |