Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Side by Side Diff: sky/engine/core/animation/PendingAnimations.cpp

Issue 875283003: Make all callers of scheduleAnimation() use scheduleVisualUpdate(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 28 matching lines...) Expand all
39 39
40 namespace blink { 40 namespace blink {
41 41
42 void PendingAnimations::add(AnimationPlayer* player) 42 void PendingAnimations::add(AnimationPlayer* player)
43 { 43 {
44 ASSERT(player); 44 ASSERT(player);
45 ASSERT(m_pending.find(player) == kNotFound); 45 ASSERT(m_pending.find(player) == kNotFound);
46 m_pending.append(player); 46 m_pending.append(player);
47 47
48 Document* document = player->timeline()->document(); 48 Document* document = player->timeline()->document();
49 if (document->view()) 49 document->scheduleVisualUpdate();
50 document->view()->scheduleAnimation();
51 50
52 bool visible = document->page() && document->page()->visibilityState() == Pa geVisibilityStateVisible; 51 bool visible = document->page() && document->page()->visibilityState() == Pa geVisibilityStateVisible;
53 if (!visible && !m_timer.isActive()) { 52 if (!visible && !m_timer.isActive()) {
54 m_timer.startOneShot(0, FROM_HERE); 53 m_timer.startOneShot(0, FROM_HERE);
55 } 54 }
56 } 55 }
57 56
58 bool PendingAnimations::update() 57 bool PendingAnimations::update()
59 { 58 {
60 Vector<AnimationPlayer*> waitingForStartTime; 59 Vector<AnimationPlayer*> waitingForStartTime;
(...skipping 18 matching lines...) Expand all
79 for (size_t i = 0; i < players.size(); ++i) { 78 for (size_t i = 0; i < players.size(); ++i) {
80 AnimationPlayer& player = *players[i].get(); 79 AnimationPlayer& player = *players[i].get();
81 player.postCommit(player.timeline()->currentTimeInternal()); 80 player.postCommit(player.timeline()->currentTimeInternal());
82 } 81 }
83 82
84 ASSERT(m_pending.isEmpty()); 83 ASSERT(m_pending.isEmpty());
85 return false; 84 return false;
86 } 85 }
87 86
88 } // namespace 87 } // namespace
OLDNEW
« no previous file with comments | « sky/engine/core/animation/DocumentAnimations.cpp ('k') | sky/engine/core/dom/ScriptedAnimationController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698