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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp

Issue 2776563003: Only automatically promote sticky position elements which move with scroll. (Closed)
Patch Set: Merge with master Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Google Inc. All rights reserved. 3 * Copyright (C) 2014 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 OverlapMap& overlapMap, 240 OverlapMap& overlapMap,
241 RecursionData& currentRecursionData, 241 RecursionData& currentRecursionData,
242 bool& descendantHas3DTransform, 242 bool& descendantHas3DTransform,
243 Vector<PaintLayer*>& unclippedDescendants, 243 Vector<PaintLayer*>& unclippedDescendants,
244 IntRect& absoluteDescendantBoundingBox) { 244 IntRect& absoluteDescendantBoundingBox) {
245 PaintLayerCompositor* compositor = m_layoutView.compositor(); 245 PaintLayerCompositor* compositor = m_layoutView.compositor();
246 246
247 layer->stackingNode()->updateLayerListsIfNeeded(); 247 layer->stackingNode()->updateLayerListsIfNeeded();
248 248
249 CompositingReasons reasonsToComposite = CompositingReasonNone; 249 CompositingReasons reasonsToComposite = CompositingReasonNone;
250 CompositingReasons directReasons = 250 CompositingReasons directReasons = CompositingReasonNone;
251 m_compositingReasonFinder.directReasons(layer);
252 251
253 // Video is special. It's the only PaintLayer type that can both have 252 // Video is special. It's the only PaintLayer type that can both have
254 // PaintLayer children and whose children can't use its backing to render 253 // PaintLayer children and whose children can't use its backing to render
255 // into. These children (the controls) always need to be promoted into their 254 // into. These children (the controls) always need to be promoted into their
256 // own layers to draw on top of the accelerated video. 255 // own layers to draw on top of the accelerated video.
257 if (currentRecursionData.m_compositingAncestor && 256 if (currentRecursionData.m_compositingAncestor &&
258 currentRecursionData.m_compositingAncestor->layoutObject().isVideo()) 257 currentRecursionData.m_compositingAncestor->layoutObject().isVideo())
259 directReasons |= CompositingReasonVideoOverlay; 258 directReasons |= CompositingReasonVideoOverlay;
260 259
261 bool hasCompositedScrollingAncestor = 260 bool hasCompositedScrollingAncestor =
262 layer->ancestorScrollingLayer() && 261 layer->ancestorScrollingLayer() &&
263 (m_compositingReasonFinder.directReasons( 262 (m_compositingReasonFinder.directReasons(layer->ancestorScrollingLayer(),
264 layer->ancestorScrollingLayer()) & 263 false) &
265 CompositingReasonOverflowScrollingTouch); 264 CompositingReasonOverflowScrollingTouch);
266 265
267 // TODO(chrishtr): use |hasCompositedScrollingAncestor| instead. 266 // TODO(chrishtr): use |hasCompositedScrollingAncestor| instead.
268 if (currentRecursionData.m_hasCompositedScrollingAncestor && 267 const bool ignoreLCDText =
269 layer->layoutObject().styleRef().hasViewportConstrainedPosition()) 268 currentRecursionData.m_hasCompositedScrollingAncestor;
270 directReasons |= CompositingReasonScrollDependentPosition; 269 directReasons |=
270 m_compositingReasonFinder.directReasons(layer, ignoreLCDText);
271 271
272 bool canBeComposited = compositor->canBeComposited(layer); 272 bool canBeComposited = compositor->canBeComposited(layer);
273 if (canBeComposited) { 273 if (canBeComposited) {
274 reasonsToComposite |= directReasons; 274 reasonsToComposite |= directReasons;
275 275
276 if (layer->isRootLayer() && compositor->rootShouldAlwaysComposite()) 276 if (layer->isRootLayer() && compositor->rootShouldAlwaysComposite())
277 reasonsToComposite |= CompositingReasonRoot; 277 reasonsToComposite |= CompositingReasonRoot;
278 278
279 // Add CompositingReasonOverflowScrollingTouch for layers that do not 279 // Add CompositingReasonOverflowScrollingTouch for layers that do not
280 // already have it but need it. 280 // already have it but need it.
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 descendantHas3DTransform |= 538 descendantHas3DTransform |=
539 anyDescendantHas3DTransform || layer->has3DTransform(); 539 anyDescendantHas3DTransform || layer->has3DTransform();
540 } 540 }
541 541
542 // At this point we have finished collecting all reasons to composite this 542 // At this point we have finished collecting all reasons to composite this
543 // layer. 543 // layer.
544 layer->setCompositingReasons(reasonsToComposite); 544 layer->setCompositingReasons(reasonsToComposite);
545 } 545 }
546 546
547 } // namespace blink 547 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698