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

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

Issue 2845613002: Fix the bug that sticky element may not be correctly invalidated due to non-promotion (Closed)
Patch Set: Address comments Created 3 years, 7 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // We have to promote the sticky element to work around the bug
276 // (https://crbug.com/698358) of not being able to invalidate the ancestor
277 // after updating the sticky layer position.
278 // TODO(yigu): We should check if we have already lost lcd text. This
279 // would require tracking if we think the current compositing ancestor
280 // layer meets the requirements (i.e. opaque, integer transform, etc).
281 const bool moves_with_respect_to_compositing_ancestor =
282 layer->SticksToScroller() &&
283 !current_recursion_data.compositing_ancestor_->IsRootLayer();
275 // TODO(chrishtr): use |hasCompositedScrollingAncestor| instead. 284 // TODO(chrishtr): use |hasCompositedScrollingAncestor| instead.
276 const bool ignore_lcd_text = 285 const bool ignore_lcd_text =
277 current_recursion_data.has_composited_scrolling_ancestor_; 286 current_recursion_data.has_composited_scrolling_ancestor_ ||
287 moves_with_respect_to_compositing_ancestor;
278 direct_reasons |= 288 direct_reasons |=
279 compositing_reason_finder_.DirectReasons(layer, ignore_lcd_text); 289 compositing_reason_finder_.DirectReasons(layer, ignore_lcd_text);
280 290
281 bool can_be_composited = compositor->CanBeComposited(layer); 291 bool can_be_composited = compositor->CanBeComposited(layer);
282 if (can_be_composited) { 292 if (can_be_composited) {
283 reasons_to_composite |= direct_reasons; 293 reasons_to_composite |= direct_reasons;
284 294
285 if (layer->IsRootLayer() && compositor->RootShouldAlwaysComposite()) 295 if (layer->IsRootLayer() && compositor->RootShouldAlwaysComposite())
286 reasons_to_composite |= kCompositingReasonRoot; 296 reasons_to_composite |= kCompositingReasonRoot;
287 297
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 descendant_has3d_transform |= 566 descendant_has3d_transform |=
557 any_descendant_has3d_transform || layer->Has3DTransform(); 567 any_descendant_has3d_transform || layer->Has3DTransform();
558 } 568 }
559 569
560 // 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
561 // layer. 571 // layer.
562 layer->SetCompositingReasons(reasons_to_composite); 572 layer->SetCompositingReasons(reasons_to_composite);
563 } 573 }
564 574
565 } // namespace blink 575 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698