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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2297873002: Remove unnecessary checks in PaintLayer::backgroundIsKnownToBeOpaqueInRect (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 2379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 return m_rareData && m_rareData->compositedLayerMapping && m_rareData->compo sitedLayerMapping->hasChildClippingMaskLayer(); 2390 return m_rareData && m_rareData->compositedLayerMapping && m_rareData->compo sitedLayerMapping->hasChildClippingMaskLayer();
2391 } 2391 }
2392 2392
2393 bool PaintLayer::paintsWithTransform(GlobalPaintFlags globalPaintFlags) const 2393 bool PaintLayer::paintsWithTransform(GlobalPaintFlags globalPaintFlags) const
2394 { 2394 {
2395 return (transform() || layoutObject()->style()->position() == FixedPosition) && ((globalPaintFlags & GlobalPaintFlattenCompositingLayers) || compositingStat e() != PaintsIntoOwnBacking); 2395 return (transform() || layoutObject()->style()->position() == FixedPosition) && ((globalPaintFlags & GlobalPaintFlattenCompositingLayers) || compositingStat e() != PaintsIntoOwnBacking);
2396 } 2396 }
2397 2397
2398 bool PaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const 2398 bool PaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const
2399 { 2399 {
2400 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant())
chrishtr 2016/08/30 20:49:01 childBackgroundIsKnownToBeOpaqueInRect calls backg
Stephen Chennney 2016/08/30 20:58:51 Right, in fact we only want the ones that are not
chrishtr 2016/08/30 21:15:39 No. self-painting is not the same thing as indepen
2401 return false;
2402
2403 if (paintsWithTransparency(GlobalPaintNormalPhase)) 2400 if (paintsWithTransparency(GlobalPaintNormalPhase))
2404 return false; 2401 return false;
2405 2402
2406 // We can't use hasVisibleContent(), because that will be true if our layout Object is hidden, but some child 2403 // We can't use hasVisibleContent(), because that will be true if our layout Object is hidden, but some child
2407 // is visible and that child doesn't cover the entire rect. 2404 // is visible and that child doesn't cover the entire rect.
2408 if (layoutObject()->style()->visibility() != EVisibility::Visible) 2405 if (layoutObject()->style()->visibility() != EVisibility::Visible)
2409 return false; 2406 return false;
2410 2407
2411 if (paintsWithFilters() && layoutObject()->style()->filter().hasFilterThatAf fectsOpacity()) 2408 if (paintsWithFilters() && layoutObject()->style()->filter().hasFilterThatAf fectsOpacity())
2412 return false; 2409 return false;
2413 2410
2414 // FIXME: Handle simple transforms. 2411 // FIXME: Handle simple transforms.
2415 if (paintsWithTransform(GlobalPaintNormalPhase)) 2412 if (paintsWithTransform(GlobalPaintNormalPhase))
2416 return false; 2413 return false;
2417 2414
2418 // FIXME: Remove this check.
2419 // This function should not be called when layer-lists are dirty. 2415 // This function should not be called when layer-lists are dirty.
2420 // It is somehow getting triggered during style update. 2416 DCHECK(!m_stackingNode->zOrderListsDirty());
2421 if (m_stackingNode->zOrderListsDirty())
2422 return false;
2423 2417
2424 // FIXME: We currently only check the immediate layoutObject, 2418 // FIXME: We currently only check the immediate layoutObject,
2425 // which will miss many cases. 2419 // which will miss many cases where additional layout objects paint
2420 // into this layer.
2426 if (layoutObject()->backgroundIsKnownToBeOpaqueInRect(localRect)) 2421 if (layoutObject()->backgroundIsKnownToBeOpaqueInRect(localRect))
2427 return true; 2422 return true;
2428 2423
2429 // We can't consult child layers if we clip, since they might cover 2424 // We can't consult child layers if we clip, since they might cover
2430 // parts of the rect that are clipped out. 2425 // parts of the rect that are clipped out.
2431 if (layoutObject()->hasClipRelatedProperty()) 2426 if (layoutObject()->hasClipRelatedProperty())
2432 return false; 2427 return false;
2433 2428
2434 return childBackgroundIsKnownToBeOpaqueInRect(localRect); 2429 return childBackgroundIsKnownToBeOpaqueInRect(localRect);
2435 } 2430 }
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2948 2943
2949 void showLayerTree(const blink::LayoutObject* layoutObject) 2944 void showLayerTree(const blink::LayoutObject* layoutObject)
2950 { 2945 {
2951 if (!layoutObject) { 2946 if (!layoutObject) {
2952 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2947 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2953 return; 2948 return;
2954 } 2949 }
2955 showLayerTree(layoutObject->enclosingLayer()); 2950 showLayerTree(layoutObject->enclosingLayer());
2956 } 2951 }
2957 #endif 2952 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698