OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
6 #include "core/rendering/compositing/CompositingReasonFinder.h" | 6 #include "core/rendering/compositing/CompositingReasonFinder.h" |
7 | 7 |
8 #include "CSSPropertyNames.h" | 8 #include "CSSPropertyNames.h" |
9 #include "HTMLNames.h" | 9 #include "HTMLNames.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 bool CompositingReasonFinder::requiresCompositingForFilters(RenderObject* render
er) const | 134 bool CompositingReasonFinder::requiresCompositingForFilters(RenderObject* render
er) const |
135 { | 135 { |
136 if (!(m_compositingTriggers & FilterTrigger)) | 136 if (!(m_compositingTriggers & FilterTrigger)) |
137 return false; | 137 return false; |
138 | 138 |
139 return renderer->hasFilter(); | 139 return renderer->hasFilter(); |
140 } | 140 } |
141 | 141 |
142 bool CompositingReasonFinder::requiresCompositingForWillChangeCompositingHint(co
nst RenderObject* renderer) const | 142 bool CompositingReasonFinder::requiresCompositingForWillChangeCompositingHint(co
nst RenderObject* renderer) const |
143 { | 143 { |
| 144 if (renderer->style()->subtreeWillChangeContents()) |
| 145 return false; |
| 146 |
144 return renderer->style()->hasWillChangeCompositingHint(); | 147 return renderer->style()->hasWillChangeCompositingHint(); |
145 } | 148 } |
146 | 149 |
147 CompositingReasons CompositingReasonFinder::nonStyleDeterminedDirectReasons(cons
t RenderLayer* layer, bool* needToRecomputeCompositingRequirements) const | 150 CompositingReasons CompositingReasonFinder::nonStyleDeterminedDirectReasons(cons
t RenderLayer* layer, bool* needToRecomputeCompositingRequirements) const |
148 { | 151 { |
149 CompositingReasons directReasons = CompositingReasonNone; | 152 CompositingReasons directReasons = CompositingReasonNone; |
150 RenderObject* renderer = layer->renderer(); | 153 RenderObject* renderer = layer->renderer(); |
151 | 154 |
152 if (hasOverflowScrollTrigger()) { | 155 if (hasOverflowScrollTrigger()) { |
153 if (requiresCompositingForOutOfFlowClipping(layer)) | 156 if (requiresCompositingForOutOfFlowClipping(layer)) |
(...skipping 13 matching lines...) Expand all Loading... |
167 directReasons |= CompositingReasonPositionFixed; | 170 directReasons |= CompositingReasonPositionFixed; |
168 | 171 |
169 directReasons |= renderer->additionalCompositingReasons(m_compositingTrigger
s); | 172 directReasons |= renderer->additionalCompositingReasons(m_compositingTrigger
s); |
170 | 173 |
171 ASSERT(!(directReasons & CompositingReasonComboAllStyleDeterminedReasons)); | 174 ASSERT(!(directReasons & CompositingReasonComboAllStyleDeterminedReasons)); |
172 return directReasons; | 175 return directReasons; |
173 } | 176 } |
174 | 177 |
175 bool CompositingReasonFinder::requiresCompositingForAnimation(RenderObject* rend
erer) const | 178 bool CompositingReasonFinder::requiresCompositingForAnimation(RenderObject* rend
erer) const |
176 { | 179 { |
| 180 if (renderer->style()->subtreeWillChangeContents()) |
| 181 return renderer->style()->isRunningAnimationOnCompositor(); |
| 182 |
177 return renderer->style()->shouldCompositeForCurrentAnimations(); | 183 return renderer->style()->shouldCompositeForCurrentAnimations(); |
178 } | 184 } |
179 | 185 |
180 bool CompositingReasonFinder::requiresCompositingForOutOfFlowClipping(const Rend
erLayer* layer) const | 186 bool CompositingReasonFinder::requiresCompositingForOutOfFlowClipping(const Rend
erLayer* layer) const |
181 { | 187 { |
182 return layer->isUnclippedDescendant(); | 188 return layer->isUnclippedDescendant(); |
183 } | 189 } |
184 | 190 |
185 bool CompositingReasonFinder::requiresCompositingForOverflowScrollingParent(cons
t RenderLayer* layer) const | 191 bool CompositingReasonFinder::requiresCompositingForOverflowScrollingParent(cons
t RenderLayer* layer) const |
186 { | 192 { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 *needToRecomputeCompositingRequirements = true; | 288 *needToRecomputeCompositingRequirements = true; |
283 } | 289 } |
284 return false; | 290 return false; |
285 } | 291 } |
286 } | 292 } |
287 | 293 |
288 return true; | 294 return true; |
289 } | 295 } |
290 | 296 |
291 } | 297 } |
OLD | NEW |