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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 } | 1124 } |
1125 | 1125 |
1126 Animation::CompositorAnimationPlayerHolder* | 1126 Animation::CompositorAnimationPlayerHolder* |
1127 Animation::CompositorAnimationPlayerHolder::create(Animation* animation) { | 1127 Animation::CompositorAnimationPlayerHolder::create(Animation* animation) { |
1128 return new CompositorAnimationPlayerHolder(animation); | 1128 return new CompositorAnimationPlayerHolder(animation); |
1129 } | 1129 } |
1130 | 1130 |
1131 Animation::CompositorAnimationPlayerHolder::CompositorAnimationPlayerHolder( | 1131 Animation::CompositorAnimationPlayerHolder::CompositorAnimationPlayerHolder( |
1132 Animation* animation) | 1132 Animation* animation) |
1133 : m_animation(animation) { | 1133 : m_animation(animation) { |
1134 ThreadState::current()->registerPreFinalizer(this); | |
1135 m_compositorPlayer = CompositorAnimationPlayer::create(); | 1134 m_compositorPlayer = CompositorAnimationPlayer::create(); |
1136 m_compositorPlayer->setAnimationDelegate(m_animation); | 1135 m_compositorPlayer->setAnimationDelegate(m_animation); |
1137 } | 1136 } |
1138 | 1137 |
1139 void Animation::CompositorAnimationPlayerHolder::dispose() { | 1138 void Animation::CompositorAnimationPlayerHolder::dispose() { |
1140 if (!m_animation) | 1139 if (!m_animation) |
1141 return; | 1140 return; |
1142 m_animation->dispose(); | 1141 m_animation->dispose(); |
1143 DCHECK(!m_animation); | 1142 DCHECK(!m_animation); |
1144 DCHECK(!m_compositorPlayer); | 1143 DCHECK(!m_compositorPlayer); |
1145 } | 1144 } |
1146 | 1145 |
1147 void Animation::CompositorAnimationPlayerHolder::detach() { | 1146 void Animation::CompositorAnimationPlayerHolder::detach() { |
1148 DCHECK(m_compositorPlayer); | 1147 DCHECK(m_compositorPlayer); |
1149 m_compositorPlayer->setAnimationDelegate(nullptr); | 1148 m_compositorPlayer->setAnimationDelegate(nullptr); |
1150 m_animation = nullptr; | 1149 m_animation = nullptr; |
1151 m_compositorPlayer.reset(); | 1150 m_compositorPlayer.reset(); |
1152 } | 1151 } |
1153 } // namespace blink | 1152 } // namespace blink |
OLD | NEW |