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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 if (current_recursion_data.compositing_ancestor_ && | 265 if (current_recursion_data.compositing_ancestor_ && |
| 266 current_recursion_data.compositing_ancestor_->GetLayoutObject().IsVideo()) | 266 current_recursion_data.compositing_ancestor_->GetLayoutObject().IsVideo()) |
| 267 direct_reasons |= kCompositingReasonVideoOverlay; | 267 direct_reasons |= kCompositingReasonVideoOverlay; |
| 268 | 268 |
| 269 bool has_composited_scrolling_ancestor = | 269 bool has_composited_scrolling_ancestor = |
| 270 layer->AncestorScrollingLayer() && | 270 layer->AncestorScrollingLayer() && |
| 271 (compositing_reason_finder_.DirectReasons(layer->AncestorScrollingLayer(), | 271 (compositing_reason_finder_.DirectReasons(layer->AncestorScrollingLayer(), |
| 272 false) & | 272 false) & |
| 273 kCompositingReasonOverflowScrollingTouch); | 273 kCompositingReasonOverflowScrollingTouch); |
| 274 | 274 |
| 275 const bool moves_with_respect_to_compositing_ancestor = | |
| 276 layer->SticksToScroller(); | |
|
flackr
2017/05/18 18:13:14
Sorry, can you put both parts of the expression to
yigu
2017/05/18 19:26:43
Done.
| |
| 275 // TODO(chrishtr): use |hasCompositedScrollingAncestor| instead. | 277 // TODO(chrishtr): use |hasCompositedScrollingAncestor| instead. |
| 276 const bool ignore_lcd_text = | 278 const bool ignore_lcd_text = |
| 277 current_recursion_data.has_composited_scrolling_ancestor_; | 279 current_recursion_data.has_composited_scrolling_ancestor_ || |
| 280 // TODO(yigu): We should check if we have already lost lcd text. This | |
| 281 // would require tracking if we think the current compositing ancestor | |
| 282 // layer meets the requirements (i.e. opaque, integer transform, etc). | |
|
flackr
2017/05/18 18:13:14
From your discussions with Chris, we also have to
yigu
2017/05/18 19:26:43
Done.
| |
| 283 (moves_with_respect_to_compositing_ancestor && | |
| 284 !current_recursion_data.compositing_ancestor_->IsRootLayer()); | |
| 278 direct_reasons |= | 285 direct_reasons |= |
| 279 compositing_reason_finder_.DirectReasons(layer, ignore_lcd_text); | 286 compositing_reason_finder_.DirectReasons(layer, ignore_lcd_text); |
| 280 | 287 |
| 281 bool can_be_composited = compositor->CanBeComposited(layer); | 288 bool can_be_composited = compositor->CanBeComposited(layer); |
| 282 if (can_be_composited) { | 289 if (can_be_composited) { |
| 283 reasons_to_composite |= direct_reasons; | 290 reasons_to_composite |= direct_reasons; |
| 284 | 291 |
| 285 if (layer->IsRootLayer() && compositor->RootShouldAlwaysComposite()) | 292 if (layer->IsRootLayer() && compositor->RootShouldAlwaysComposite()) |
| 286 reasons_to_composite |= kCompositingReasonRoot; | 293 reasons_to_composite |= kCompositingReasonRoot; |
| 287 | 294 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 556 descendant_has3d_transform |= | 563 descendant_has3d_transform |= |
| 557 any_descendant_has3d_transform || layer->Has3DTransform(); | 564 any_descendant_has3d_transform || layer->Has3DTransform(); |
| 558 } | 565 } |
| 559 | 566 |
| 560 // At this point we have finished collecting all reasons to composite this | 567 // At this point we have finished collecting all reasons to composite this |
| 561 // layer. | 568 // layer. |
| 562 layer->SetCompositingReasons(reasons_to_composite); | 569 layer->SetCompositingReasons(reasons_to_composite); |
| 563 } | 570 } |
| 564 | 571 |
| 565 } // namespace blink | 572 } // namespace blink |
| OLD | NEW |