| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/svg/graphics/SVGImage.h" | 5 #include "core/svg/graphics/SVGImage.h" |
| 6 | 6 |
| 7 #include "core/svg/graphics/SVGImageChromeClient.h" | 7 #include "core/svg/graphics/SVGImageChromeClient.h" |
| 8 #include "platform/SharedBuffer.h" | 8 #include "platform/SharedBuffer.h" |
| 9 #include "platform/Timer.h" | 9 #include "platform/Timer.h" |
| 10 #include "platform/geometry/FloatRect.h" | 10 #include "platform/geometry/FloatRect.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 void pumpFrame() | 85 void pumpFrame() |
| 86 { | 86 { |
| 87 Image* image = m_image.get(); | 87 Image* image = m_image.get(); |
| 88 RefPtr<SkCanvas> nullCanvas = adoptRef(SkCreateNullCanvas()); | 88 RefPtr<SkCanvas> nullCanvas = adoptRef(SkCreateNullCanvas()); |
| 89 SkPaint paint; | 89 SkPaint paint; |
| 90 FloatRect dummyRect(0, 0, 100, 100); | 90 FloatRect dummyRect(0, 0, 100, 100); |
| 91 image->draw( | 91 image->draw( |
| 92 nullCanvas.get(), paint, | 92 nullCanvas.get(), paint, |
| 93 dummyRect, dummyRect, | 93 dummyRect, dummyRect, true, |
| 94 DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect); | 94 DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect); |
| 95 } | 95 } |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 class PauseControlImageObserver | 98 class PauseControlImageObserver |
| 99 : public GarbageCollectedFinalized<PauseControlImageObserver>, public Im
ageObserver { | 99 : public GarbageCollectedFinalized<PauseControlImageObserver>, public Im
ageObserver { |
| 100 USING_GARBAGE_COLLECTED_MIXIN(PauseControlImageObserver); | 100 USING_GARBAGE_COLLECTED_MIXIN(PauseControlImageObserver); |
| 101 public: | 101 public: |
| 102 PauseControlImageObserver(bool shouldPause) : m_shouldPause(shouldPause)
{ } | 102 PauseControlImageObserver(bool shouldPause) : m_shouldPause(shouldPause)
{ } |
| 103 | 103 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 EXPECT_TRUE(chromeClient.isSuspended()); | 185 EXPECT_TRUE(chromeClient.isSuspended()); |
| 186 EXPECT_FALSE(timer->isActive()); | 186 EXPECT_FALSE(timer->isActive()); |
| 187 | 187 |
| 188 // Simulate a draw. This should resume the animation again. | 188 // Simulate a draw. This should resume the animation again. |
| 189 pumpFrame(); | 189 pumpFrame(); |
| 190 EXPECT_FALSE(chromeClient.isSuspended()); | 190 EXPECT_FALSE(chromeClient.isSuspended()); |
| 191 EXPECT_TRUE(timer->isActive()); | 191 EXPECT_TRUE(timer->isActive()); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace blink | 194 } // namespace blink |
| OLD | NEW |