Chromium Code Reviews| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 } | 366 } |
| 367 | 367 |
| 368 reasons_to_composite |= overlap_compositing_reason; | 368 reasons_to_composite |= overlap_compositing_reason; |
| 369 | 369 |
| 370 // The children of this layer don't need to composite, unless there is | 370 // The children of this layer don't need to composite, unless there is |
| 371 // a compositing layer among them, so start by inheriting the compositing | 371 // a compositing layer among them, so start by inheriting the compositing |
| 372 // ancestor with m_subtreeIsCompositing set to false. | 372 // ancestor with m_subtreeIsCompositing set to false. |
| 373 RecursionData child_recursion_data = current_recursion_data; | 373 RecursionData child_recursion_data = current_recursion_data; |
| 374 child_recursion_data.subtree_is_compositing_ = false; | 374 child_recursion_data.subtree_is_compositing_ = false; |
| 375 | 375 |
| 376 if (layer->SticksToScroller() && | |
| 377 layer->AncestorOverflowLayer()->ScrollsOverflow() && | |
| 378 current_recursion_data.compositing_ancestor_ && | |
| 379 current_recursion_data.compositing_ancestor_->AncestorScrollingLayer() && | |
|
chrishtr
2017/05/10 19:29:36
Please add the comments explaining that this is no
yigu
2017/05/10 20:01:42
Done.
| |
| 380 !current_recursion_data.compositing_ancestor_->AncestorScrollingLayer() | |
| 381 ->IsRootLayer()) { | |
| 382 reasons_to_composite |= kCompositingReasonScrollDependentPosition; | |
| 383 } | |
| 384 | |
| 376 bool will_be_composited_or_squashed = | 385 bool will_be_composited_or_squashed = |
| 377 can_be_composited && RequiresCompositingOrSquashing(reasons_to_composite); | 386 can_be_composited && RequiresCompositingOrSquashing(reasons_to_composite); |
| 378 if (will_be_composited_or_squashed) { | 387 if (will_be_composited_or_squashed) { |
| 379 // This layer now acts as the ancestor for kids. | 388 // This layer now acts as the ancestor for kids. |
| 380 child_recursion_data.compositing_ancestor_ = layer; | 389 child_recursion_data.compositing_ancestor_ = layer; |
| 381 | 390 |
| 382 // Here we know that all children and the layer's own contents can blindly | 391 // Here we know that all children and the layer's own contents can blindly |
| 383 // paint into this layer's backing, until a descendant is composited. So, we | 392 // paint into this layer's backing, until a descendant is composited. So, we |
| 384 // don't need to check for overlap with anything behind this layer. | 393 // don't need to check for overlap with anything behind this layer. |
| 385 overlap_map.BeginNewOverlapTestingContext(); | 394 overlap_map.BeginNewOverlapTestingContext(); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 557 descendant_has3d_transform |= | 566 descendant_has3d_transform |= |
| 558 any_descendant_has3d_transform || layer->Has3DTransform(); | 567 any_descendant_has3d_transform || layer->Has3DTransform(); |
| 559 } | 568 } |
| 560 | 569 |
| 561 // At this point we have finished collecting all reasons to composite this | 570 // At this point we have finished collecting all reasons to composite this |
| 562 // layer. | 571 // layer. |
| 563 layer->SetCompositingReasons(reasons_to_composite); | 572 layer->SetCompositingReasons(reasons_to_composite); |
| 564 } | 573 } |
| 565 | 574 |
| 566 } // namespace blink | 575 } // namespace blink |
| OLD | NEW |