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

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

Issue 2859483006: cc: Enable composited border-radius scrolling.
Patch Set: test-rebaseline Created 3 years, 6 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 const PaintLayer* compositing_ancestor = 545 const PaintLayer* compositing_ancestor =
546 owning_layer_.EnclosingLayerWithCompositedLayerMapping(kExcludeSelf); 546 owning_layer_.EnclosingLayerWithCompositedLayerMapping(kExcludeSelf);
547 if (!compositing_ancestor) 547 if (!compositing_ancestor)
548 return; 548 return;
549 549
550 const LayoutBoxModelObject* clipping_container = 550 const LayoutBoxModelObject* clipping_container =
551 owning_layer_.ClippingContainer(); 551 owning_layer_.ClippingContainer();
552 if (!clipping_container) 552 if (!clipping_container)
553 return; 553 return;
554 554
555 if (clipping_container->EnclosingLayer() == scroll_parent)
556 return;
557
558 if (compositing_ancestor->GetLayoutObject().IsDescendantOf( 555 if (compositing_ancestor->GetLayoutObject().IsDescendantOf(
559 clipping_container)) 556 clipping_container))
560 return; 557 return;
561 558
562 // We ignore overflow clip here; we want composited overflow content to 559 // We ignore overflow clip here; we want composited overflow content to
563 // behave as if it lives in an unclipped universe so it can prepaint, etc. 560 // behave as if it lives in an unclipped universe so it can prepaint, etc.
564 // This means that we need to check if we are actually clipped before 561 // This means that we need to check if we are actually clipped before
565 // setting up m_ancestorClippingLayer otherwise 562 // setting up m_ancestorClippingLayer otherwise
566 // updateAncestorClippingLayerGeometry will fail as the clip rect will be 563 // updateAncestorClippingLayerGeometry will fail as the clip rect will be
567 // infinite. 564 // infinite.
568 // FIXME: this should use cached clip rects, but this sometimes give 565 // FIXME: this should use cached clip rects, but this sometimes give
569 // inaccurate results (and trips the ASSERTS in PaintLayerClipper). 566 // inaccurate results (and trips the ASSERTS in PaintLayerClipper).
570 ClipRectsContext clip_rects_context(compositing_ancestor, kUncachedClipRects, 567 ClipRectsContext clip_rects_context(compositing_ancestor, kUncachedClipRects,
571 kIgnorePlatformOverlayScrollbarSize); 568 kIgnorePlatformOverlayScrollbarSize);
572 clip_rects_context.SetIgnoreOverflowClip(); 569 clip_rects_context.SetIgnoreOverflowClip();
573 570
574 ClipRect clip_rect; 571 ClipRect clip_rect;
575 owning_layer_.Clipper(PaintLayer::kDoNotUseGeometryMapper) 572 owning_layer_.Clipper(PaintLayer::kDoNotUseGeometryMapper)
576 .CalculateBackgroundClipRect(clip_rects_context, clip_rect); 573 .CalculateBackgroundClipRect(clip_rects_context, clip_rect);
577 IntRect parent_clip_rect = PixelSnappedIntRect(clip_rect.Rect()); 574 IntRect parent_clip_rect = PixelSnappedIntRect(clip_rect.Rect());
578 owning_layer_is_clipped = parent_clip_rect != LayoutRect::InfiniteIntRect(); 575 owning_layer_is_clipped = parent_clip_rect != LayoutRect::InfiniteIntRect();
579 576
580 // TODO(schenney): CSS clips are not applied to composited children, and 577 // TODO(schenney): CSS clips are not applied to composited children, and
581 // should be via mask or by compositing the parent too. 578 // should be via mask or by compositing the parent too.
582 // https://bugs.chromium.org/p/chromium/issues/detail?id=615870 579 // https://bugs.chromium.org/p/chromium/issues/detail?id=615870
583 if (owning_layer_is_clipped) { 580 if (owning_layer_is_clipped) {
584 owning_layer_is_masked = 581 owning_layer_is_masked =
585 !AncestorRoundedCornersWontClip(compositing_ancestor); 582 !AncestorRoundedCornersWontClip(compositing_ancestor);
586 } 583 }
584
585 if (clipping_container->EnclosingLayer() == scroll_parent)
586 owning_layer_is_clipped = owning_layer_is_masked;
587 } 587 }
588 588
589 const PaintLayer* CompositedLayerMapping::ScrollParent() { 589 const PaintLayer* CompositedLayerMapping::ScrollParent() {
590 const PaintLayer* scroll_parent = owning_layer_.ScrollParent(); 590 const PaintLayer* scroll_parent = owning_layer_.ScrollParent();
591 if (scroll_parent && !scroll_parent->NeedsCompositedScrolling()) 591 if (scroll_parent && !scroll_parent->NeedsCompositedScrolling())
592 return nullptr; 592 return nullptr;
593 return scroll_parent; 593 return scroll_parent;
594 } 594 }
595 595
596 bool CompositedLayerMapping::UpdateGraphicsLayerConfiguration() { 596 bool CompositedLayerMapping::UpdateGraphicsLayerConfiguration() {
(...skipping 3055 matching lines...) Expand 10 before | Expand all | Expand 10 after
3652 } else if (graphics_layer == decoration_outline_layer_.get()) { 3652 } else if (graphics_layer == decoration_outline_layer_.get()) {
3653 name = "Decoration Layer"; 3653 name = "Decoration Layer";
3654 } else { 3654 } else {
3655 NOTREACHED(); 3655 NOTREACHED();
3656 } 3656 }
3657 3657
3658 return name; 3658 return name;
3659 } 3659 }
3660 3660
3661 } // namespace blink 3661 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698