| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 ImageQualityController(); | 70 ImageQualityController(); |
| 71 | 71 |
| 72 static bool has(const LayoutObject&); | 72 static bool has(const LayoutObject&); |
| 73 void set(const LayoutObject&, LayerSizeMap* innerMap, const void* layer, con
st LayoutSize&, bool isResizing); | 73 void set(const LayoutObject&, LayerSizeMap* innerMap, const void* layer, con
st LayoutSize&, bool isResizing); |
| 74 | 74 |
| 75 bool shouldPaintAtLowQuality(const LayoutObject&, Image*, const void* layer,
const LayoutSize&, double lastFrameTimeMonotonic); | 75 bool shouldPaintAtLowQuality(const LayoutObject&, Image*, const void* layer,
const LayoutSize&, double lastFrameTimeMonotonic); |
| 76 void removeLayer(const LayoutObject&, LayerSizeMap* innerMap, const void* la
yer); | 76 void removeLayer(const LayoutObject&, LayerSizeMap* innerMap, const void* la
yer); |
| 77 void objectDestroyed(const LayoutObject&); | 77 void objectDestroyed(const LayoutObject&); |
| 78 bool isEmpty() { return m_objectLayerSizeMap.isEmpty(); } | 78 bool isEmpty() { return m_objectLayerSizeMap.isEmpty(); } |
| 79 | 79 |
| 80 void highQualityRepaintTimerFired(Timer<ImageQualityController>*); | 80 void highQualityRepaintTimerFired(TimerBase*); |
| 81 void restartTimer(double lastFrameTimeMonotonic); | 81 void restartTimer(double lastFrameTimeMonotonic); |
| 82 | 82 |
| 83 // Only for use in testing. | 83 // Only for use in testing. |
| 84 void setTimer(Timer<ImageQualityController>*); | 84 void setTimer(std::unique_ptr<TimerBase>); |
| 85 | 85 |
| 86 ObjectLayerSizeMap m_objectLayerSizeMap; | 86 ObjectLayerSizeMap m_objectLayerSizeMap; |
| 87 std::unique_ptr<Timer<ImageQualityController>> m_timer; | 87 std::unique_ptr<TimerBase> m_timer; |
| 88 double m_frameTimeWhenTimerStarted; | 88 double m_frameTimeWhenTimerStarted; |
| 89 | 89 |
| 90 // For calling set(). | 90 // For calling set(). |
| 91 FRIEND_TEST_ALL_PREFIXES(LayoutPartTest, DestroyUpdatesImageQualityControlle
r); | 91 FRIEND_TEST_ALL_PREFIXES(LayoutPartTest, DestroyUpdatesImageQualityControlle
r); |
| 92 | 92 |
| 93 // For calling setTimer(), | 93 // For calling setTimer(), |
| 94 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, LowQualityFilterForResi
zingImage); | 94 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, LowQualityFilterForResi
zingImage); |
| 95 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, MediumQualityFilterForN
otAnimatedWhileAnotherAnimates); | 95 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, MediumQualityFilterForN
otAnimatedWhileAnotherAnimates); |
| 96 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, DontKickTheAnimationTim
erWhenPaintingAtTheSameSize); | 96 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, DontKickTheAnimationTim
erWhenPaintingAtTheSameSize); |
| 97 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, DontRestartTimerUnlessA
dvanced); | 97 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, DontRestartTimerUnlessA
dvanced); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 } // namespace blink | 100 } // namespace blink |
| 101 | 101 |
| 102 #endif | 102 #endif |
| OLD | NEW |