OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 timeline_state_ == kSuspendedWithAnimationPending; | 76 timeline_state_ == kSuspendedWithAnimationPending; |
77 timeline_state_ = kRunning; | 77 timeline_state_ = kRunning; |
78 | 78 |
79 // If an animation frame was pending/requested while animations were | 79 // If an animation frame was pending/requested while animations were |
80 // suspended, schedule a new animation frame. | 80 // suspended, schedule a new animation frame. |
81 if (!have_pending_animation) | 81 if (!have_pending_animation) |
82 return; | 82 return; |
83 ScheduleAnimation(nullptr); | 83 ScheduleAnimation(nullptr); |
84 } | 84 } |
85 | 85 |
86 void SVGImageChromeClient::ScheduleAnimation(LocalFrame*) { | 86 void SVGImageChromeClient::ScheduleAnimation(const PlatformLocalFrame*) { |
87 // Because a single SVGImage can be shared by multiple pages, we can't key | 87 // Because a single SVGImage can be shared by multiple pages, we can't key |
88 // our svg image layout on the page's real animation frame. Therefore, we | 88 // our svg image layout on the page's real animation frame. Therefore, we |
89 // run this fake animation timer to trigger layout in SVGImages. The name, | 89 // run this fake animation timer to trigger layout in SVGImages. The name, |
90 // "animationTimer", is to match the new requestAnimationFrame-based layout | 90 // "animationTimer", is to match the new requestAnimationFrame-based layout |
91 // approach. | 91 // approach. |
92 if (animation_timer_->IsActive()) | 92 if (animation_timer_->IsActive()) |
93 return; | 93 return; |
94 // Schedule the 'animation' ASAP if the image does not contain any | 94 // Schedule the 'animation' ASAP if the image does not contain any |
95 // animations, but prefer a fixed, jittery, frame-delay if there're any | 95 // animations, but prefer a fixed, jittery, frame-delay if there're any |
96 // animations. Checking for pending/active animations could be more | 96 // animations. Checking for pending/active animations could be more |
(...skipping 21 matching lines...) Expand all Loading... |
118 // | 118 // |
119 // TODO(Oilpan): move (SVG)Image to the Oilpan heap, and avoid | 119 // TODO(Oilpan): move (SVG)Image to the Oilpan heap, and avoid |
120 // this explicit lifetime check. | 120 // this explicit lifetime check. |
121 if (ThreadHeap::WillObjectBeLazilySwept(image_->GetImageObserver())) | 121 if (ThreadHeap::WillObjectBeLazilySwept(image_->GetImageObserver())) |
122 return; | 122 return; |
123 | 123 |
124 image_->ServiceAnimations(MonotonicallyIncreasingTime()); | 124 image_->ServiceAnimations(MonotonicallyIncreasingTime()); |
125 } | 125 } |
126 | 126 |
127 } // namespace blink | 127 } // namespace blink |
OLD | NEW |