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

Side by Side Diff: sky/engine/core/rendering/compositing/CompositingReasonFinder.cpp

Issue 688433003: Remove viewportConstrained plumbing. (Closed) Base URL: git@github.com:domokit/mojo.git@master
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
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 12 matching lines...) Expand all
23 } 23 }
24 24
25 void CompositingReasonFinder::updateTriggers() 25 void CompositingReasonFinder::updateTriggers()
26 { 26 {
27 m_compositingTriggers = 0; 27 m_compositingTriggers = 0;
28 28
29 Settings& settings = m_renderView.document().page()->settings(); 29 Settings& settings = m_renderView.document().page()->settings();
30 if (settings.preferCompositingToLCDTextEnabled()) { 30 if (settings.preferCompositingToLCDTextEnabled()) {
31 m_compositingTriggers |= ScrollableInnerFrameTrigger; 31 m_compositingTriggers |= ScrollableInnerFrameTrigger;
32 m_compositingTriggers |= OverflowScrollTrigger; 32 m_compositingTriggers |= OverflowScrollTrigger;
33 m_compositingTriggers |= ViewportConstrainedPositionedTrigger;
34 } 33 }
35 } 34 }
36 35
37 bool CompositingReasonFinder::hasOverflowScrollTrigger() const 36 bool CompositingReasonFinder::hasOverflowScrollTrigger() const
38 { 37 {
39 return m_compositingTriggers & OverflowScrollTrigger; 38 return m_compositingTriggers & OverflowScrollTrigger;
40 } 39 }
41 40
42 CompositingReasons CompositingReasonFinder::directReasons(const RenderLayer* lay er) const 41 CompositingReasons CompositingReasonFinder::directReasons(const RenderLayer* lay er) const
43 { 42 {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 120
122 if (const RenderLayer* scrollingAncestor = layer->ancestorScrollingLayer ()) { 121 if (const RenderLayer* scrollingAncestor = layer->ancestorScrollingLayer ()) {
123 if (scrollingAncestor->needsCompositedScrolling() && layer->scrollPa rent()) 122 if (scrollingAncestor->needsCompositedScrolling() && layer->scrollPa rent())
124 directReasons |= CompositingReasonOverflowScrollingParent; 123 directReasons |= CompositingReasonOverflowScrollingParent;
125 } 124 }
126 125
127 if (layer->needsCompositedScrolling()) 126 if (layer->needsCompositedScrolling())
128 directReasons |= CompositingReasonOverflowScrollingTouch; 127 directReasons |= CompositingReasonOverflowScrollingTouch;
129 } 128 }
130 129
131 if (requiresCompositingForPositionFixed(layer))
132 directReasons |= CompositingReasonPositionFixed;
133
134 directReasons |= renderer->additionalCompositingReasons(); 130 directReasons |= renderer->additionalCompositingReasons();
135 131
136 ASSERT(!(directReasons & CompositingReasonComboAllStyleDeterminedReasons)); 132 ASSERT(!(directReasons & CompositingReasonComboAllStyleDeterminedReasons));
137 return directReasons; 133 return directReasons;
138 } 134 }
139 135
140 bool CompositingReasonFinder::requiresCompositingForAnimation(RenderStyle* style ) const 136 bool CompositingReasonFinder::requiresCompositingForAnimation(RenderStyle* style ) const
141 { 137 {
142 if (style->subtreeWillChangeContents()) 138 if (style->subtreeWillChangeContents())
143 return style->isRunningAnimationOnCompositor(); 139 return style->isRunningAnimationOnCompositor();
144 140
145 return style->shouldCompositeForCurrentAnimations(); 141 return style->shouldCompositeForCurrentAnimations();
146 } 142 }
147 143
148 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const RenderLa yer* layer) const
149 {
150 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger))
151 return false;
152 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements.
153 // They will stay fixed wrt the container rather than the enclosing frame.
154 return layer->scrollsWithViewport() && m_renderView.frameView()->isScrollabl e();
155 } 144 }
156
157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698