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

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

Issue 1490063002: Implement Paint Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary adjustStyleForContainment declaration Created 5 years 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 * 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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 { 756 {
757 const bool hasCompositorAnimation = m_compositingReasonFinder.requiresCompos itingForAnimation(*layer->layoutObject()->style()); 757 const bool hasCompositorAnimation = m_compositingReasonFinder.requiresCompos itingForAnimation(*layer->layoutObject()->style());
758 return m_hasAcceleratedCompositing && (hasCompositorAnimation || !layer->sub treeIsInvisible()) && layer->isSelfPaintingLayer() && !layer->layoutObject()->is LayoutFlowThread(); 758 return m_hasAcceleratedCompositing && (hasCompositorAnimation || !layer->sub treeIsInvisible()) && layer->isSelfPaintingLayer() && !layer->layoutObject()->is LayoutFlowThread();
759 } 759 }
760 760
761 // Return true if the given layer is a stacking context and has compositing chil d 761 // Return true if the given layer is a stacking context and has compositing chil d
762 // layers that it needs to clip. In this case we insert a clipping GraphicsLayer 762 // layers that it needs to clip. In this case we insert a clipping GraphicsLayer
763 // into the hierarchy between this layer and its children in the z-order hierarc hy. 763 // into the hierarchy between this layer and its children in the z-order hierarc hy.
764 bool PaintLayerCompositor::clipsCompositingDescendants(const PaintLayer* layer) const 764 bool PaintLayerCompositor::clipsCompositingDescendants(const PaintLayer* layer) const
765 { 765 {
766 return layer->hasCompositingDescendant() && layer->layoutObject()->hasClipOr OverflowClip(); 766 return layer->hasCompositingDescendant() && layer->layoutObject()->hasOverfl owClipPaintContainmentOrClip();
767 } 767 }
768 768
769 // If an element has composited negative z-index children, those children paint in front of the 769 // If an element has composited negative z-index children, those children paint in front of the
770 // layer background, so we need an extra 'contents' layer for the foreground of the layer 770 // layer background, so we need an extra 'contents' layer for the foreground of the layer
771 // object. 771 // object.
772 bool PaintLayerCompositor::needsContentsCompositingLayer(const PaintLayer* layer ) const 772 bool PaintLayerCompositor::needsContentsCompositingLayer(const PaintLayer* layer ) const
773 { 773 {
774 if (!layer->hasCompositingDescendant()) 774 if (!layer->hasCompositingDescendant())
775 return false; 775 return false;
776 return layer->stackingNode()->hasNegativeZOrderList(); 776 return layer->stackingNode()->hasNegativeZOrderList();
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 } else if (graphicsLayer == m_scrollLayer.get()) { 1192 } else if (graphicsLayer == m_scrollLayer.get()) {
1193 name = "Frame Scrolling Layer"; 1193 name = "Frame Scrolling Layer";
1194 } else { 1194 } else {
1195 ASSERT_NOT_REACHED(); 1195 ASSERT_NOT_REACHED();
1196 } 1196 }
1197 1197
1198 return name; 1198 return name;
1199 } 1199 }
1200 1200
1201 } // namespace blink 1201 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698