| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 LayerSizeMap::iterator j = innerMap->find(layer); | 166 LayerSizeMap::iterator j = innerMap->find(layer); |
| 167 if (j != innerMap->end()) { | 167 if (j != innerMap->end()) { |
| 168 isFirstResize = false; | 168 isFirstResize = false; |
| 169 oldSize = j->value; | 169 oldSize = j->value; |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| 173 const AffineTransform& currentTransform = context->getCTM(); | 173 const AffineTransform& currentTransform = context->getCTM(); |
| 174 bool contextIsScaled = !currentTransform.isIdentityOrTranslationOrFlipped(); | 174 bool contextIsScaled = !currentTransform.isIdentityOrTranslationOrFlipped(); |
| 175 | 175 |
| 176 // Make sure to use the unzoomed image size, since if a full page zoom is in
effect, the image | |
| 177 // is actually being scaled. | |
| 178 LayoutSize scaledImageSize = currentTransform.mapSize(image->size()); | 176 LayoutSize scaledImageSize = currentTransform.mapSize(image->size()); |
| 179 LayoutSize scaledLayoutSize = currentTransform.mapSize(roundedIntSize(layout
Size)); | 177 LayoutSize scaledLayoutSize = currentTransform.mapSize(roundedIntSize(layout
Size)); |
| 180 | 178 |
| 181 // If the containing FrameView is being resized, paint at low quality until
resizing is finished. | 179 // If the containing FrameView is being resized, paint at low quality until
resizing is finished. |
| 182 if (m_liveResizeOptimizationIsActive) { | 180 if (m_liveResizeOptimizationIsActive) { |
| 183 // Live resize has ended, paint in HQ and remove this object from the li
st. | 181 // Live resize has ended, paint in HQ and remove this object from the li
st. |
| 184 removeLayer(object, innerMap, layer); | 182 removeLayer(object, innerMap, layer); |
| 185 return false; | 183 return false; |
| 186 } | 184 } |
| 187 | 185 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 217 // This object has been resized to two different sizes while the timer | 215 // This object has been resized to two different sizes while the timer |
| 218 // is active, so draw at low quality, set the flag for animated resizes and | 216 // is active, so draw at low quality, set the flag for animated resizes and |
| 219 // the object to the list for high quality redraw. | 217 // the object to the list for high quality redraw. |
| 220 set(object, innerMap, layer, scaledLayoutSize); | 218 set(object, innerMap, layer, scaledLayoutSize); |
| 221 m_animatedResizeIsActive = true; | 219 m_animatedResizeIsActive = true; |
| 222 restartTimer(); | 220 restartTimer(); |
| 223 return true; | 221 return true; |
| 224 } | 222 } |
| 225 | 223 |
| 226 } // namespace blink | 224 } // namespace blink |
| OLD | NEW |