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

Side by Side Diff: third_party/WebKit/Source/core/animation/CompositorPendingAnimations.cpp

Issue 2724083002: [SPv2] Decomposite otherwise-compositable animations that paint nothing. (Closed)
Patch Set: Progress. Created 3 years, 9 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 Document* document = animation->timeline()->document(); 47 Document* document = animation->timeline()->document();
48 if (document->view()) 48 if (document->view())
49 document->view()->scheduleAnimation(); 49 document->view()->scheduleAnimation();
50 50
51 bool visible = document->page() && document->page()->isPageVisible(); 51 bool visible = document->page() && document->page()->isPageVisible();
52 if (!visible && !m_timer.isActive()) { 52 if (!visible && !m_timer.isActive()) {
53 m_timer.startOneShot(0, BLINK_FROM_HERE); 53 m_timer.startOneShot(0, BLINK_FROM_HERE);
54 } 54 }
55 } 55 }
56 56
57 bool CompositorPendingAnimations::update(bool startOnCompositor) { 57 bool CompositorPendingAnimations::update(
58 const Optional<CompositorElementIdSet>& compositedAnimationElementIds,
59 bool startOnCompositor) {
58 HeapVector<Member<Animation>> waitingForStartTime; 60 HeapVector<Member<Animation>> waitingForStartTime;
59 bool startedSynchronizedOnCompositor = false; 61 bool startedSynchronizedOnCompositor = false;
60 62
61 HeapVector<Member<Animation>> animations; 63 HeapVector<Member<Animation>> animations;
62 HeapVector<Member<Animation>> deferred; 64 HeapVector<Member<Animation>> deferred;
63 animations.swap(m_pending); 65 animations.swap(m_pending);
64 int compositorGroup = ++m_compositorGroup; 66 int compositorGroup = ++m_compositorGroup;
65 while (compositorGroup == 0 || compositorGroup == 1) { 67 while (compositorGroup == 0 || compositorGroup == 1) {
66 // Wrap around, skipping 0, 1. 68 // Wrap around, skipping 0, 1.
67 // * 0 is reserved for automatic assignment 69 // * 0 is reserved for automatic assignment
68 // * 1 is used for animations with a specified start time 70 // * 1 is used for animations with a specified start time
69 compositorGroup = ++m_compositorGroup; 71 compositorGroup = ++m_compositorGroup;
70 } 72 }
71 73
72 for (auto& animation : animations) { 74 for (auto& animation : animations) {
73 bool hadCompositorAnimation = animation->hasActiveAnimationsOnCompositor(); 75 bool hadCompositorAnimation = animation->hasActiveAnimationsOnCompositor();
74 // Animations with a start time do not participate in compositor start-time 76 // Animations with a start time do not participate in compositor start-time
75 // grouping. 77 // grouping.
76 if (animation->preCommit(animation->hasStartTime() ? 1 : compositorGroup, 78 if (animation->preCommit(animation->hasStartTime() ? 1 : compositorGroup,
79 compositedAnimationElementIds,
77 startOnCompositor)) { 80 startOnCompositor)) {
78 if (animation->hasActiveAnimationsOnCompositor() && 81 if (animation->hasActiveAnimationsOnCompositor() &&
79 !hadCompositorAnimation) { 82 !hadCompositorAnimation) {
80 startedSynchronizedOnCompositor = true; 83 startedSynchronizedOnCompositor = true;
81 } 84 }
82 85
83 if (animation->playing() && !animation->hasStartTime() && 86 if (animation->playing() && !animation->hasStartTime() &&
84 animation->timeline() && animation->timeline()->isActive()) { 87 animation->timeline() && animation->timeline()->isActive()) {
85 waitingForStartTime.push_back(animation.get()); 88 waitingForStartTime.push_back(animation.get());
86 } 89 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 animation->timeline()->zeroTime()); 163 animation->timeline()->zeroTime());
161 } 164 }
162 } 165 }
163 166
164 DEFINE_TRACE(CompositorPendingAnimations) { 167 DEFINE_TRACE(CompositorPendingAnimations) {
165 visitor->trace(m_pending); 168 visitor->trace(m_pending);
166 visitor->trace(m_waitingForCompositorAnimationStart); 169 visitor->trace(m_waitingForCompositorAnimationStart);
167 } 170 }
168 171
169 } // namespace blink 172 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698