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

Side by Side Diff: sky/engine/core/dom/DocumentLifecycle.cpp

Issue 847393003: Remove the PaintInvalidation DocumentLifeCycle states. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/dom/DocumentLifecycle.h ('k') | sky/engine/core/editing/FrameSelection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (state == InPerformLayout) 120 if (state == InPerformLayout)
121 return true; 121 return true;
122 // We can redundant arrive in the layout clean state. This situation 122 // We can redundant arrive in the layout clean state. This situation
123 // can happen when we call layout recursively and we unwind the stack. 123 // can happen when we call layout recursively and we unwind the stack.
124 if (state == LayoutClean) 124 if (state == LayoutClean)
125 return true; 125 return true;
126 if (state == StyleClean) 126 if (state == StyleClean)
127 return true; 127 return true;
128 return false; 128 return false;
129 } 129 }
130 if (m_state == InPaintInvalidation) { 130 if (m_state == StyleAndLayoutClean) {
131 if (state == PaintInvalidationClean)
132 return true;
133 return false;
134 }
135 if (m_state == PaintInvalidationClean) {
136 if (state == InStyleRecalc) 131 if (state == InStyleRecalc)
137 return true; 132 return true;
138 if (state == InPreLayout) 133 if (state == InPreLayout)
139 return true; 134 return true;
140 if (state == InPaintInvalidation) 135 if (state == LayoutClean)
136 return true;
137 // We can pump frames without style or layout needing updating.
138 if (state == StyleAndLayoutClean)
141 return true; 139 return true;
142 return false; 140 return false;
143 } 141 }
144 return false; 142 return false;
145 } 143 }
146 144
147 bool DocumentLifecycle::canRewindTo(State state) const 145 bool DocumentLifecycle::canRewindTo(State state) const
148 { 146 {
149 // This transition is bogus, but we've whitelisted it anyway. 147 // This transition is bogus, but we've whitelisted it anyway.
150 if (s_deprecatedTransitionStack && m_state == s_deprecatedTransitionStack->f rom() && state == s_deprecatedTransitionStack->to()) 148 if (s_deprecatedTransitionStack && m_state == s_deprecatedTransitionStack->f rom() && state == s_deprecatedTransitionStack->to())
151 return true; 149 return true;
152 return m_state == StyleClean || m_state == AfterPerformLayout || m_state == LayoutClean || m_state == PaintInvalidationClean; 150 return m_state == StyleClean || m_state == AfterPerformLayout || m_state == LayoutClean || m_state == StyleAndLayoutClean;
153 } 151 }
154 152
155 #endif 153 #endif
156 154
157 void DocumentLifecycle::advanceTo(State state) 155 void DocumentLifecycle::advanceTo(State state)
158 { 156 {
159 ASSERT(canAdvanceTo(state)); 157 ASSERT(canAdvanceTo(state));
160 m_state = state; 158 m_state = state;
161 } 159 }
162 160
163 void DocumentLifecycle::ensureStateAtMost(State state) 161 void DocumentLifecycle::ensureStateAtMost(State state)
164 { 162 {
165 ASSERT(state == VisualUpdatePending || state == StyleClean || state == Layou tClean); 163 ASSERT(state == VisualUpdatePending || state == StyleClean || state == Layou tClean);
166 if (m_state <= state) 164 if (m_state <= state)
167 return; 165 return;
168 ASSERT(canRewindTo(state)); 166 ASSERT(canRewindTo(state));
169 m_state = state; 167 m_state = state;
170 } 168 }
171 169
172 } 170 }
OLDNEW
« no previous file with comments | « sky/engine/core/dom/DocumentLifecycle.h ('k') | sky/engine/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698