Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: Source/core/layout/ImageQualityController.cpp

Issue 1062283002: Use C++11 range-based loop for core/layout (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix it naming Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 m_timer.stop(); 124 m_timer.stop();
125 } 125 }
126 } 126 }
127 127
128 void ImageQualityController::highQualityRepaintTimerFired(Timer<ImageQualityCont roller>*) 128 void ImageQualityController::highQualityRepaintTimerFired(Timer<ImageQualityCont roller>*)
129 { 129 {
130 if (!m_animatedResizeIsActive && !m_liveResizeOptimizationIsActive) 130 if (!m_animatedResizeIsActive && !m_liveResizeOptimizationIsActive)
131 return; 131 return;
132 m_animatedResizeIsActive = false; 132 m_animatedResizeIsActive = false;
133 133
134 for (ObjectLayerSizeMap::iterator it = m_objectLayerSizeMap.begin(); it != m _objectLayerSizeMap.end(); ++it) { 134 for (auto* layoutObject : m_objectLayerSizeMap.keys()) {
135 if (LocalFrame* frame = it->key->document().frame()) { 135 if (LocalFrame* frame = layoutObject->document().frame()) {
136 // If this renderer's containing FrameView is in live resize, punt t he timer and hold back for now. 136 // If this renderer's containing FrameView is in live resize, punt t he timer and hold back for now.
137 if (frame->view() && frame->view()->inLiveResize()) { 137 if (frame->view() && frame->view()->inLiveResize()) {
138 restartTimer(); 138 restartTimer();
139 return; 139 return;
140 } 140 }
141 } 141 }
142 it->key->setShouldDoFullPaintInvalidation(); 142 layoutObject->setShouldDoFullPaintInvalidation();
143 } 143 }
144 144
145 m_liveResizeOptimizationIsActive = false; 145 m_liveResizeOptimizationIsActive = false;
146 } 146 }
147 147
148 void ImageQualityController::restartTimer() 148 void ImageQualityController::restartTimer()
149 { 149 {
150 m_timer.startOneShot(cLowQualityTimeThreshold, FROM_HERE); 150 m_timer.startOneShot(cLowQualityTimeThreshold, FROM_HERE);
151 } 151 }
152 152
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // This object has been resized to two different sizes while the timer 235 // This object has been resized to two different sizes while the timer
236 // is active, so draw at low quality, set the flag for animated resizes and 236 // is active, so draw at low quality, set the flag for animated resizes and
237 // the object to the list for high quality redraw. 237 // the object to the list for high quality redraw.
238 set(object, innerMap, layer, scaledLayoutSize); 238 set(object, innerMap, layer, scaledLayoutSize);
239 m_animatedResizeIsActive = true; 239 m_animatedResizeIsActive = true;
240 restartTimer(); 240 restartTimer();
241 return true; 241 return true;
242 } 242 }
243 243
244 } // namespace blink 244 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698