OLD | NEW |
---|---|
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
183 subtreeReasons |= CompositingReasonIsolateCompositedDescendants; | 183 subtreeReasons |= CompositingReasonIsolateCompositedDescendants; |
184 } | 184 } |
185 | 185 |
186 // FIXME: This should move into | 186 // FIXME: This should move into |
187 // CompositingReasonFinder::potentialCompositingReasonsFromStyle, but theres | 187 // CompositingReasonFinder::potentialCompositingReasonsFromStyle, but theres |
188 // a poor interaction with LayoutTextControlSingleLine, which sets this | 188 // a poor interaction with LayoutTextControlSingleLine, which sets this |
189 // hasOverflowClip directly. | 189 // hasOverflowClip directly. |
190 if (layer->layoutObject().hasClipRelatedProperty()) | 190 if (layer->layoutObject().hasClipRelatedProperty()) |
191 subtreeReasons |= CompositingReasonClipsCompositingDescendants; | 191 subtreeReasons |= CompositingReasonClipsCompositingDescendants; |
192 | 192 |
193 if (layer->layoutObject().style()->position() == EPosition::kFixed) | 193 // TODO(smcgruer): Use hasStickyConstrainedPosition() from flackr's patch |
194 subtreeReasons |= CompositingReasonPositionFixedWithCompositedDescendants; | 194 if (layer->layoutObject().style()->position() == EPosition::kFixed || |
195 layer->layoutObject().style()->position() == EPosition::kSticky) { | |
196 subtreeReasons |= | |
197 CompositingReasonPositionFixedOrStickyWithCompositedDescendants; | |
flackr
2017/03/23 17:30:58
Will this cause the scroller to be composited too?
smcgruer
2017/03/24 18:28:28
It will not (based on testing http://output.jsbin.
flackr
2017/04/03 17:27:59
No I think just having the layout test is fine.
| |
198 } | |
195 } | 199 } |
196 | 200 |
197 // A layer with preserve-3d or perspective only needs to be composited if | 201 // A layer with preserve-3d or perspective only needs to be composited if |
198 // there are descendant layers that will be affected by the preserve-3d or | 202 // there are descendant layers that will be affected by the preserve-3d or |
199 // perspective. | 203 // perspective. |
200 if (has3DTransformedDescendants) { | 204 if (has3DTransformedDescendants) { |
201 subtreeReasons |= layer->potentialCompositingReasonsFromStyle() & | 205 subtreeReasons |= layer->potentialCompositingReasonsFromStyle() & |
202 CompositingReasonCombo3DDescendants; | 206 CompositingReasonCombo3DDescendants; |
203 } | 207 } |
204 | 208 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
538 descendantHas3DTransform |= | 542 descendantHas3DTransform |= |
539 anyDescendantHas3DTransform || layer->has3DTransform(); | 543 anyDescendantHas3DTransform || layer->has3DTransform(); |
540 } | 544 } |
541 | 545 |
542 // At this point we have finished collecting all reasons to composite this | 546 // At this point we have finished collecting all reasons to composite this |
543 // layer. | 547 // layer. |
544 layer->setCompositingReasons(reasonsToComposite); | 548 layer->setCompositingReasons(reasonsToComposite); |
545 } | 549 } |
546 | 550 |
547 } // namespace blink | 551 } // namespace blink |
OLD | NEW |