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

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

Issue 2859483006: cc: Enable composited border-radius scrolling.
Patch Set: Do not skip solid color mask layer quads. 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, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 const PaintLayer* compositing_ancestor = 583 const PaintLayer* compositing_ancestor =
584 owning_layer_.EnclosingLayerWithCompositedLayerMapping(kExcludeSelf); 584 owning_layer_.EnclosingLayerWithCompositedLayerMapping(kExcludeSelf);
585 if (!compositing_ancestor) 585 if (!compositing_ancestor)
586 return; 586 return;
587 587
588 const LayoutBoxModelObject* clipping_container = 588 const LayoutBoxModelObject* clipping_container =
589 owning_layer_.ClippingContainer(); 589 owning_layer_.ClippingContainer();
590 if (!clipping_container) 590 if (!clipping_container)
591 return; 591 return;
592 592
593 if (clipping_container->EnclosingLayer() == scroll_parent)
594 return;
595
596 if (compositing_ancestor->GetLayoutObject().IsDescendantOf( 593 if (compositing_ancestor->GetLayoutObject().IsDescendantOf(
597 clipping_container)) 594 clipping_container))
598 return; 595 return;
599 596
600 // We ignore overflow clip here; we want composited overflow content to 597 // We ignore overflow clip here; we want composited overflow content to
601 // behave as if it lives in an unclipped universe so it can prepaint, etc. 598 // behave as if it lives in an unclipped universe so it can prepaint, etc.
602 // This means that we need to check if we are actually clipped before 599 // This means that we need to check if we are actually clipped before
603 // setting up m_ancestorClippingLayer otherwise 600 // setting up m_ancestorClippingLayer otherwise
604 // updateAncestorClippingLayerGeometry will fail as the clip rect will be 601 // updateAncestorClippingLayerGeometry will fail as the clip rect will be
605 // infinite. 602 // infinite.
(...skipping 10 matching lines...) Expand all
616 owning_layer_is_clipped = parent_clip_rect != LayoutRect::InfiniteIntRect(); 613 owning_layer_is_clipped = parent_clip_rect != LayoutRect::InfiniteIntRect();
617 614
618 // TODO(schenney): CSS clips are not applied to composited children, and 615 // TODO(schenney): CSS clips are not applied to composited children, and
619 // should be via mask or by compositing the parent too. 616 // should be via mask or by compositing the parent too.
620 // https://bugs.chromium.org/p/chromium/issues/detail?id=615870 617 // https://bugs.chromium.org/p/chromium/issues/detail?id=615870
621 DCHECK(clipping_container->Style()); 618 DCHECK(clipping_container->Style());
622 owning_layer_is_masked = 619 owning_layer_is_masked =
623 owning_layer_is_clipped && 620 owning_layer_is_clipped &&
624 clipping_container->Style()->HasBorderRadius() && 621 clipping_container->Style()->HasBorderRadius() &&
625 !AncestorRoundedCornersWontClip(GetLayoutObject(), *clipping_container); 622 !AncestorRoundedCornersWontClip(GetLayoutObject(), *clipping_container);
623
624 if (clipping_container->EnclosingLayer() == scroll_parent)
625 owning_layer_is_clipped = owning_layer_is_masked;
626 } 626 }
627 627
628 const PaintLayer* CompositedLayerMapping::ScrollParent() { 628 const PaintLayer* CompositedLayerMapping::ScrollParent() {
629 const PaintLayer* scroll_parent = owning_layer_.ScrollParent(); 629 const PaintLayer* scroll_parent = owning_layer_.ScrollParent();
630 if (scroll_parent && !scroll_parent->NeedsCompositedScrolling()) 630 if (scroll_parent && !scroll_parent->NeedsCompositedScrolling())
631 return nullptr; 631 return nullptr;
632 return scroll_parent; 632 return scroll_parent;
633 } 633 }
634 634
635 bool CompositedLayerMapping::UpdateGraphicsLayerConfiguration() { 635 bool CompositedLayerMapping::UpdateGraphicsLayerConfiguration() {
(...skipping 2998 matching lines...) Expand 10 before | Expand all | Expand 10 after
3634 } else if (graphics_layer == decoration_outline_layer_.get()) { 3634 } else if (graphics_layer == decoration_outline_layer_.get()) {
3635 name = "Decoration Layer"; 3635 name = "Decoration Layer";
3636 } else { 3636 } else {
3637 NOTREACHED(); 3637 NOTREACHED();
3638 } 3638 }
3639 3639
3640 return name; 3640 return name;
3641 } 3641 }
3642 3642
3643 } // namespace blink 3643 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698