Changeset 147638 in webkit
- Timestamp:
- Apr 4, 2013 9:28:43 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r147636 r147638 1 2013-04-04 Andreas Kling <akling@apple.com> 2 3 Render images with low-quality scaling while FrameView is being resized. 4 <http://webkit.org/b/113764> 5 <rdar://problem/13555154> 6 7 Reviewed by Antti Koivisto. 8 9 Have ImageQualityController ask the renderer's containing FrameView if it's currently in live 10 resize, and if so, paint all images with low-quality scaling. A high-quality repaint will happen 11 ~0.5 sec after live resizing ends, piggybacking on the same mechanism we use to do JS-animated 12 resizing with low-quality scaling. 13 14 This reduces CPU time spent generating new tiles during live window resize, especially on Retina 15 systems where a lot of upscaling happens on legacy web content. 16 17 * rendering/RenderBoxModelObject.cpp: 18 (ImageQualityController): 19 20 Added an m_liveResizeOptimizationIsActive flag that tracks whether the ImageQualityController 21 is painting everything in low quality due to live window resize. It gets unset when the HQ 22 repaint timer fires and everything has been repainted properly. 23 24 (WebCore::ImageQualityController::highQualityRepaintTimerFired): 25 26 When the HQ repaint timer fires, check if the renderer's containing FrameView is still in 27 live resize, and if so, abort HQ repaint for now and reschedule the timer. 28 29 (WebCore::ImageQualityController::ImageQualityController): 30 (WebCore::ImageQualityController::objectDestroyed): 31 (WebCore::ImageQualityController::shouldPaintAtLowQuality): 32 1 33 2013-04-04 Seokju Kwon <seokju.kwon@gmail.com> 2 34 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r147533 r147638 91 91 Timer<ImageQualityController> m_timer; 92 92 bool m_animatedResizeIsActive; 93 bool m_liveResizeOptimizationIsActive; 93 94 }; 94 95 … … 96 97 : m_timer(this, &ImageQualityController::highQualityRepaintTimerFired) 97 98 , m_animatedResizeIsActive(false) 99 , m_liveResizeOptimizationIsActive(false) 98 100 { 99 101 } … … 130 132 void ImageQualityController::highQualityRepaintTimerFired(Timer<ImageQualityController>*) 131 133 { 132 if (m_animatedResizeIsActive) { 133 m_animatedResizeIsActive = false; 134 for (ObjectLayerSizeMap::iterator it = m_objectLayerSizeMap.begin(); it != m_objectLayerSizeMap.end(); ++it) 135 it->key->repaint(); 136 } 134 if (!m_animatedResizeIsActive && !m_liveResizeOptimizationIsActive) 135 return; 136 m_animatedResizeIsActive = false; 137 138 for (ObjectLayerSizeMap::iterator it = m_objectLayerSizeMap.begin(); it != m_objectLayerSizeMap.end(); ++it) { 139 if (Frame* frame = it->key->document()->frame()) { 140 // If this renderer's containing FrameView is in live resize, punt the timer and hold back for now. 141 if (frame->view() && frame->view()->inLiveResize()) { 142 restartTimer(); 143 return; 144 } 145 } 146 it->key->repaint(); 147 } 148 149 m_liveResizeOptimizationIsActive = false; 137 150 } 138 151 … … 166 179 isFirstResize = false; 167 180 oldSize = j->value; 181 } 182 } 183 184 // If the containing FrameView is being resized, paint at low quality until resizing is finished. 185 if (Frame* frame = object->document()->frame()) { 186 bool frameViewIsCurrentlyInLiveResize = frame->view() && frame->view()->inLiveResize(); 187 if (frameViewIsCurrentlyInLiveResize) { 188 set(object, innerMap, layer, size); 189 restartTimer(); 190 m_liveResizeOptimizationIsActive = true; 191 return true; 192 } 193 if (m_liveResizeOptimizationIsActive) { 194 // Live resize has ended, paint in HQ and remove this object from the list. 195 removeLayer(object, innerMap, layer); 196 return false; 168 197 } 169 198 }
Note: See TracChangeset
for help on using the changeset viewer.