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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 void ImageQualityController::highQualityRepaintTimerFired(Timer<ImageQualityCont
roller>*) | 105 void ImageQualityController::highQualityRepaintTimerFired(Timer<ImageQualityCont
roller>*) |
106 { | 106 { |
107 if (!m_animatedResizeIsActive && !m_liveResizeOptimizationIsActive) | 107 if (!m_animatedResizeIsActive && !m_liveResizeOptimizationIsActive) |
108 return; | 108 return; |
109 m_animatedResizeIsActive = false; | 109 m_animatedResizeIsActive = false; |
110 | 110 |
111 for (ObjectLayerSizeMap::iterator it = m_objectLayerSizeMap.begin(); it != m
_objectLayerSizeMap.end(); ++it) { | 111 for (ObjectLayerSizeMap::iterator it = m_objectLayerSizeMap.begin(); it != m
_objectLayerSizeMap.end(); ++it) { |
112 if (Frame* frame = it->key->document()->frame()) { | 112 if (Frame* frame = it->key->document().frame()) { |
113 // If this renderer's containing FrameView is in live resize, punt t
he timer and hold back for now. | 113 // If this renderer's containing FrameView is in live resize, punt t
he timer and hold back for now. |
114 if (frame->view() && frame->view()->inLiveResize()) { | 114 if (frame->view() && frame->view()->inLiveResize()) { |
115 restartTimer(); | 115 restartTimer(); |
116 return; | 116 return; |
117 } | 117 } |
118 } | 118 } |
119 it->key->repaint(); | 119 it->key->repaint(); |
120 } | 120 } |
121 | 121 |
122 m_liveResizeOptimizationIsActive = false; | 122 m_liveResizeOptimizationIsActive = false; |
(...skipping 29 matching lines...) Expand all Loading... |
152 | 152 |
153 const AffineTransform& currentTransform = context->getCTM(); | 153 const AffineTransform& currentTransform = context->getCTM(); |
154 bool contextIsScaled = !currentTransform.isIdentityOrTranslationOrFlipped(); | 154 bool contextIsScaled = !currentTransform.isIdentityOrTranslationOrFlipped(); |
155 | 155 |
156 // Make sure to use the unzoomed image size, since if a full page zoom is in
effect, the image | 156 // Make sure to use the unzoomed image size, since if a full page zoom is in
effect, the image |
157 // is actually being scaled. | 157 // is actually being scaled. |
158 LayoutSize scaledImageSize = currentTransform.mapSize(image->size()); | 158 LayoutSize scaledImageSize = currentTransform.mapSize(image->size()); |
159 LayoutSize scaledLayoutSize = currentTransform.mapSize(roundedIntSize(layout
Size)); | 159 LayoutSize scaledLayoutSize = currentTransform.mapSize(roundedIntSize(layout
Size)); |
160 | 160 |
161 // If the containing FrameView is being resized, paint at low quality until
resizing is finished. | 161 // If the containing FrameView is being resized, paint at low quality until
resizing is finished. |
162 if (Frame* frame = object->document()->frame()) { | 162 if (Frame* frame = object->document().frame()) { |
163 bool frameViewIsCurrentlyInLiveResize = frame->view() && frame->view()->
inLiveResize(); | 163 bool frameViewIsCurrentlyInLiveResize = frame->view() && frame->view()->
inLiveResize(); |
164 if (frameViewIsCurrentlyInLiveResize) { | 164 if (frameViewIsCurrentlyInLiveResize) { |
165 set(object, innerMap, layer, scaledLayoutSize); | 165 set(object, innerMap, layer, scaledLayoutSize); |
166 restartTimer(); | 166 restartTimer(); |
167 m_liveResizeOptimizationIsActive = true; | 167 m_liveResizeOptimizationIsActive = true; |
168 return true; | 168 return true; |
169 } | 169 } |
170 if (m_liveResizeOptimizationIsActive) { | 170 if (m_liveResizeOptimizationIsActive) { |
171 // Live resize has ended, paint in HQ and remove this object from th
e list. | 171 // Live resize has ended, paint in HQ and remove this object from th
e list. |
172 removeLayer(object, innerMap, layer); | 172 removeLayer(object, innerMap, layer); |
(...skipping 30 matching lines...) Expand all 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 |