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

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

Issue 474683003: Not for review - Rebase of crrev.com/62833003 Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 1 month 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
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 "core/CSSPropertyNames.h" 8 #include "core/CSSPropertyNames.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 directReasons |= CompositingReasonOverflowScrollingParent; 140 directReasons |= CompositingReasonOverflowScrollingParent;
141 } 141 }
142 142
143 if (layer->needsCompositedScrolling()) 143 if (layer->needsCompositedScrolling())
144 directReasons |= CompositingReasonOverflowScrollingTouch; 144 directReasons |= CompositingReasonOverflowScrollingTouch;
145 } 145 }
146 146
147 if (requiresCompositingForPositionFixed(layer)) 147 if (requiresCompositingForPositionFixed(layer))
148 directReasons |= CompositingReasonPositionFixed; 148 directReasons |= CompositingReasonPositionFixed;
149 149
150 Node* node = layer->renderer()->node();
151 if (node->isElementNode() && toElement(node)->hasBoundAnimatedProperty())
152 directReasons |= CompositingReasonTeleport;
153
150 directReasons |= renderer->additionalCompositingReasons(); 154 directReasons |= renderer->additionalCompositingReasons();
151 155
152 ASSERT(!(directReasons & CompositingReasonComboAllStyleDeterminedReasons)); 156 ASSERT(!(directReasons & CompositingReasonComboAllStyleDeterminedReasons));
153 return directReasons; 157 return directReasons;
154 } 158 }
155 159
156 bool CompositingReasonFinder::requiresCompositingForAnimation(RenderStyle* style ) const 160 bool CompositingReasonFinder::requiresCompositingForAnimation(RenderStyle* style ) const
157 { 161 {
158 if (style->subtreeWillChangeContents()) 162 if (style->subtreeWillChangeContents())
159 return style->isRunningAnimationOnCompositor(); 163 return style->isRunningAnimationOnCompositor();
160 164
161 return style->shouldCompositeForCurrentAnimations(); 165 return style->shouldCompositeForCurrentAnimations();
162 } 166 }
163 167
164 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const RenderLa yer* layer) const 168 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const RenderLa yer* layer) const
165 { 169 {
166 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) 170 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger))
167 return false; 171 return false;
168 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements. 172 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements.
169 // They will stay fixed wrt the container rather than the enclosing frame. 173 // They will stay fixed wrt the container rather than the enclosing frame.
170 return layer->scrollsWithViewport() && m_renderView.frameView()->isScrollabl e(); 174 return layer->scrollsWithViewport() && m_renderView.frameView()->isScrollabl e();
171 } 175 }
172 176
173 } 177 }
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.cpp ('k') | Source/core/workers/DedicatedWorkerGlobalScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698