| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 timer_->Stop(); | 141 timer_->Stop(); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 void ImageQualityController::HighQualityRepaintTimerFired(TimerBase*) { | 145 void ImageQualityController::HighQualityRepaintTimerFired(TimerBase*) { |
| 146 for (auto& i : object_layer_size_map_) { | 146 for (auto& i : object_layer_size_map_) { |
| 147 // Only invalidate the object if it is animating. | 147 // Only invalidate the object if it is animating. |
| 148 if (!i.value.is_resizing) | 148 if (!i.value.is_resizing) |
| 149 continue; | 149 continue; |
| 150 | 150 |
| 151 // TODO(wangxianzhu): Use LayoutObject::getMutableForPainting(). | 151 i.key->GetMutableForPainting().SetShouldDoFullPaintInvalidation( |
| 152 const_cast<LayoutObject*>(i.key)->SetShouldDoFullPaintInvalidation(); | 152 PaintInvalidationReason::kImage); |
| 153 i.value.is_resizing = false; | 153 i.value.is_resizing = false; |
| 154 } | 154 } |
| 155 frame_time_when_timer_started_ = 0.0; | 155 frame_time_when_timer_started_ = 0.0; |
| 156 } | 156 } |
| 157 | 157 |
| 158 void ImageQualityController::RestartTimer(double last_frame_time_monotonic) { | 158 void ImageQualityController::RestartTimer(double last_frame_time_monotonic) { |
| 159 if (!timer_->IsActive() || last_frame_time_monotonic == 0.0 || | 159 if (!timer_->IsActive() || last_frame_time_monotonic == 0.0 || |
| 160 frame_time_when_timer_started_ == 0.0 || | 160 frame_time_when_timer_started_ == 0.0 || |
| 161 (last_frame_time_monotonic - frame_time_when_timer_started_ > | 161 (last_frame_time_monotonic - frame_time_when_timer_started_ > |
| 162 kCTimerRestartThreshold)) { | 162 kCTimerRestartThreshold)) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 238 } |
| 239 // This object has been resized to two different sizes while the timer | 239 // This object has been resized to two different sizes while the timer |
| 240 // is active, so draw at low quality, set the flag for animated resizes and | 240 // is active, so draw at low quality, set the flag for animated resizes and |
| 241 // the object to the list for high quality redraw. | 241 // the object to the list for high quality redraw. |
| 242 Set(object, inner_map, layer, layout_size, true); | 242 Set(object, inner_map, layer, layout_size, true); |
| 243 RestartTimer(last_frame_time_monotonic); | 243 RestartTimer(last_frame_time_monotonic); |
| 244 return true; | 244 return true; |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace blink | 247 } // namespace blink |
| OLD | NEW |