| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // CompositingReasonFinder::potentialCompositingReasonsFromStyle, but theres | 188 // CompositingReasonFinder::potentialCompositingReasonsFromStyle, but theres |
| 189 // a poor interaction with LayoutTextControlSingleLine, which sets this | 189 // a poor interaction with LayoutTextControlSingleLine, which sets this |
| 190 // hasOverflowClip directly. | 190 // hasOverflowClip directly. |
| 191 if (layer->GetLayoutObject().HasClipRelatedProperty()) | 191 if (layer->GetLayoutObject().HasClipRelatedProperty()) |
| 192 subtree_reasons |= kCompositingReasonClipsCompositingDescendants; | 192 subtree_reasons |= kCompositingReasonClipsCompositingDescendants; |
| 193 | 193 |
| 194 // We ignore LCD text here because we are required to composite | 194 // We ignore LCD text here because we are required to composite |
| 195 // scroll-dependant fixed position elements with composited descendants for | 195 // scroll-dependant fixed position elements with composited descendants for |
| 196 // correctness - even if we lose LCD. | 196 // correctness - even if we lose LCD. |
| 197 const bool ignore_lcd_text = true; | 197 const bool ignore_lcd_text = true; |
| 198 if (layer->GetLayoutObject().Style()->GetPosition() == EPosition::kFixed && | 198 if (compositing_reason_finder.RequiresCompositingForScrollDependentPosition( |
| 199 compositing_reason_finder.RequiresCompositingForScrollDependentPosition( | |
| 200 layer, ignore_lcd_text)) { | 199 layer, ignore_lcd_text)) { |
| 201 subtree_reasons |= | 200 subtree_reasons |= |
| 202 kCompositingReasonPositionFixedWithCompositedDescendants; | 201 kCompositingReasonPositionFixedOrStickyWithCompositedDescendants; |
| 203 } | 202 } |
| 204 } | 203 } |
| 205 | 204 |
| 206 // A layer with preserve-3d or perspective only needs to be composited if | 205 // A layer with preserve-3d or perspective only needs to be composited if |
| 207 // there are descendant layers that will be affected by the preserve-3d or | 206 // there are descendant layers that will be affected by the preserve-3d or |
| 208 // perspective. | 207 // perspective. |
| 209 if (has3d_transformed_descendants) { | 208 if (has3d_transformed_descendants) { |
| 210 subtree_reasons |= layer->PotentialCompositingReasonsFromStyle() & | 209 subtree_reasons |= layer->PotentialCompositingReasonsFromStyle() & |
| 211 kCompositingReasonCombo3DDescendants; | 210 kCompositingReasonCombo3DDescendants; |
| 212 } | 211 } |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 descendant_has3d_transform |= | 556 descendant_has3d_transform |= |
| 558 any_descendant_has3d_transform || layer->Has3DTransform(); | 557 any_descendant_has3d_transform || layer->Has3DTransform(); |
| 559 } | 558 } |
| 560 | 559 |
| 561 // At this point we have finished collecting all reasons to composite this | 560 // At this point we have finished collecting all reasons to composite this |
| 562 // layer. | 561 // layer. |
| 563 layer->SetCompositingReasons(reasons_to_composite); | 562 layer->SetCompositingReasons(reasons_to_composite); |
| 564 } | 563 } |
| 565 | 564 |
| 566 } // namespace blink | 565 } // namespace blink |
| OLD | NEW |