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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // For images that are potentially animated we paint them at medium quality. | 86 // For images that are potentially animated we paint them at medium quality. |
87 if (image && image->maybeAnimated()) | 87 if (image && image->maybeAnimated()) |
88 return InterpolationMedium; | 88 return InterpolationMedium; |
89 | 89 |
90 return InterpolationDefault; | 90 return InterpolationDefault; |
91 } | 91 } |
92 | 92 |
93 ImageQualityController::~ImageQualityController() { | 93 ImageQualityController::~ImageQualityController() { |
94 // This will catch users of ImageQualityController that forget to call | 94 // This will catch users of ImageQualityController that forget to call |
95 // cleanUp. | 95 // cleanUp. |
96 ASSERT(!gImageQualityController || gImageQualityController->isEmpty()); | 96 DCHECK(!gImageQualityController || gImageQualityController->isEmpty()); |
97 } | 97 } |
98 | 98 |
99 ImageQualityController::ImageQualityController() | 99 ImageQualityController::ImageQualityController() |
100 : m_timer(WTF::wrapUnique(new Timer<ImageQualityController>( | 100 : m_timer(WTF::wrapUnique(new Timer<ImageQualityController>( |
101 this, | 101 this, |
102 &ImageQualityController::highQualityRepaintTimerFired))), | 102 &ImageQualityController::highQualityRepaintTimerFired))), |
103 m_frameTimeWhenTimerStarted(0.0) {} | 103 m_frameTimeWhenTimerStarted(0.0) {} |
104 | 104 |
105 void ImageQualityController::setTimer(std::unique_ptr<TimerBase> newTimer) { | 105 void ImageQualityController::setTimer(std::unique_ptr<TimerBase> newTimer) { |
106 m_timer = std::move(newTimer); | 106 m_timer = std::move(newTimer); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 235 } |
236 // This object has been resized to two different sizes while the timer | 236 // This object has been resized to two different sizes while the timer |
237 // is active, so draw at low quality, set the flag for animated resizes and | 237 // is active, so draw at low quality, set the flag for animated resizes and |
238 // the object to the list for high quality redraw. | 238 // the object to the list for high quality redraw. |
239 set(object, innerMap, layer, layoutSize, true); | 239 set(object, innerMap, layer, layoutSize, true); |
240 restartTimer(lastFrameTimeMonotonic); | 240 restartTimer(lastFrameTimeMonotonic); |
241 return true; | 241 return true; |
242 } | 242 } |
243 | 243 |
244 } // namespace blink | 244 } // namespace blink |
OLD | NEW |