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

Side by Side Diff: Source/core/rendering/compositing/CompositingReasonFinder.cpp

Issue 317013005: Make CompositingReasonFinder::requiresCompositingForAnimation take RenderStyle* (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comment Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/compositing/CompositingReasonFinder.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 if (requiresCompositingForTransform(renderer)) 104 if (requiresCompositingForTransform(renderer))
105 directReasons |= CompositingReason3DTransform; 105 directReasons |= CompositingReason3DTransform;
106 106
107 if (requiresCompositingForFilters(renderer)) 107 if (requiresCompositingForFilters(renderer))
108 directReasons |= CompositingReasonFilters; 108 directReasons |= CompositingReasonFilters;
109 109
110 if (style->backfaceVisibility() == BackfaceVisibilityHidden) 110 if (style->backfaceVisibility() == BackfaceVisibilityHidden)
111 directReasons |= CompositingReasonBackfaceVisibilityHidden; 111 directReasons |= CompositingReasonBackfaceVisibilityHidden;
112 112
113 if (requiresCompositingForAnimation(renderer)) 113 if (requiresCompositingForAnimation(style))
114 directReasons |= CompositingReasonActiveAnimation; 114 directReasons |= CompositingReasonActiveAnimation;
115 115
116 if (style->hasWillChangeCompositingHint() && !style->subtreeWillChangeConten ts()) 116 if (style->hasWillChangeCompositingHint() && !style->subtreeWillChangeConten ts())
117 directReasons |= CompositingReasonWillChangeCompositingHint; 117 directReasons |= CompositingReasonWillChangeCompositingHint;
118 118
119 ASSERT(!(directReasons & ~CompositingReasonComboAllStyleDeterminedReasons)); 119 ASSERT(!(directReasons & ~CompositingReasonComboAllStyleDeterminedReasons));
120 return directReasons; 120 return directReasons;
121 } 121 }
122 122
123 bool CompositingReasonFinder::requiresCompositingForTransform(RenderObject* rend erer) const 123 bool CompositingReasonFinder::requiresCompositingForTransform(RenderObject* rend erer) const
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 if (requiresCompositingForPositionFixed(renderer, layer, 0)) 160 if (requiresCompositingForPositionFixed(renderer, layer, 0))
161 directReasons |= CompositingReasonPositionFixed; 161 directReasons |= CompositingReasonPositionFixed;
162 162
163 directReasons |= renderer->additionalCompositingReasons(m_compositingTrigger s); 163 directReasons |= renderer->additionalCompositingReasons(m_compositingTrigger s);
164 164
165 ASSERT(!(directReasons & CompositingReasonComboAllStyleDeterminedReasons)); 165 ASSERT(!(directReasons & CompositingReasonComboAllStyleDeterminedReasons));
166 return directReasons; 166 return directReasons;
167 } 167 }
168 168
169 bool CompositingReasonFinder::requiresCompositingForAnimation(RenderObject* rend erer) const 169 bool CompositingReasonFinder::requiresCompositingForAnimation(RenderStyle* style ) const
170 { 170 {
171 if (renderer->style()->subtreeWillChangeContents()) 171 if (style->subtreeWillChangeContents())
172 return renderer->style()->isRunningAnimationOnCompositor(); 172 return style->isRunningAnimationOnCompositor();
173 173
174 return renderer->style()->shouldCompositeForCurrentAnimations(); 174 return style->shouldCompositeForCurrentAnimations();
175 } 175 }
176 176
177 bool CompositingReasonFinder::requiresCompositingForPosition(RenderObject* rende rer, const RenderLayer* layer, RenderLayer::ViewportConstrainedNotCompositedReas on* viewportConstrainedNotCompositedReason) const 177 bool CompositingReasonFinder::requiresCompositingForPosition(RenderObject* rende rer, const RenderLayer* layer, RenderLayer::ViewportConstrainedNotCompositedReas on* viewportConstrainedNotCompositedReason) const
178 { 178 {
179 return requiresCompositingForPositionSticky(renderer, layer) || requiresComp ositingForPositionFixed(renderer, layer, viewportConstrainedNotCompositedReason) ; 179 return requiresCompositingForPositionSticky(renderer, layer) || requiresComp ositingForPositionFixed(renderer, layer, viewportConstrainedNotCompositedReason) ;
180 } 180 }
181 181
182 bool CompositingReasonFinder::requiresCompositingForPositionSticky(RenderObject* renderer, const RenderLayer* layer) const 182 bool CompositingReasonFinder::requiresCompositingForPositionSticky(RenderObject* renderer, const RenderLayer* layer) const
183 { 183 {
184 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) 184 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger))
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (viewportConstrainedNotCompositedReason) 264 if (viewportConstrainedNotCompositedReason)
265 *viewportConstrainedNotCompositedReason = RenderLayer::NotCompos itedForBoundsOutOfView; 265 *viewportConstrainedNotCompositedReason = RenderLayer::NotCompos itedForBoundsOutOfView;
266 return false; 266 return false;
267 } 267 }
268 } 268 }
269 269
270 return true; 270 return true;
271 } 271 }
272 272
273 } 273 }
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/CompositingReasonFinder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698