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

Side by Side Diff: Source/core/rendering/CompositedLayerMapping.cpp

Issue 59063003: Don't coerce pointers to compositor layer mappings to booleans. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaaaase Created 7 years, 1 month 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 | Annotate | Revision Log
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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 updateInternalHierarchy(); 462 updateInternalHierarchy();
463 463
464 if (updateMaskLayer(renderer->hasMask())) 464 if (updateMaskLayer(renderer->hasMask()))
465 m_graphicsLayer->setMaskLayer(m_maskLayer.get()); 465 m_graphicsLayer->setMaskLayer(m_maskLayer.get());
466 466
467 bool needsChildClippingMask = (renderer->style()->hasBorderRadius() || rende rer->style()->clipPath()) && isAcceleratedContents(renderer); 467 bool needsChildClippingMask = (renderer->style()->hasBorderRadius() || rende rer->style()->clipPath()) && isAcceleratedContents(renderer);
468 if (updateClippingMaskLayers(needsChildClippingMask)) 468 if (updateClippingMaskLayers(needsChildClippingMask))
469 m_graphicsLayer->setContentsClippingMaskLayer(m_childClippingMaskLayer.g et()); 469 m_graphicsLayer->setContentsClippingMaskLayer(m_childClippingMaskLayer.g et());
470 470
471 if (m_owningLayer->reflectionInfo()) { 471 if (m_owningLayer->reflectionInfo()) {
472 if (m_owningLayer->reflectionInfo()->reflectionLayer()->compositedLayerM apping()) { 472 if (m_owningLayer->reflectionInfo()->reflectionLayer()->compositingState () == PaintsIntoOwnBacking) {
473 GraphicsLayer* reflectionLayer = m_owningLayer->reflectionInfo()->re flectionLayer()->compositedLayerMapping()->mainGraphicsLayer(); 473 GraphicsLayer* reflectionLayer = m_owningLayer->reflectionInfo()->re flectionLayer()->compositedLayerMapping()->mainGraphicsLayer();
474 m_graphicsLayer->setReplicatedByLayer(reflectionLayer); 474 m_graphicsLayer->setReplicatedByLayer(reflectionLayer);
475 } 475 }
476 } else { 476 } else {
477 m_graphicsLayer->setReplicatedByLayer(0); 477 m_graphicsLayer->setReplicatedByLayer(0);
478 } 478 }
479 479
480 updateBackgroundColor(isSimpleContainerCompositingLayer()); 480 updateBackgroundColor(isSimpleContainerCompositingLayer());
481 481
482 if (isDirectlyCompositedImage()) 482 if (isDirectlyCompositedImage())
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 backgroundSize = frameView->visibleContentRect().size(); 698 backgroundSize = frameView->visibleContentRect().size();
699 } 699 }
700 m_backgroundLayer->setPosition(backgroundPosition); 700 m_backgroundLayer->setPosition(backgroundPosition);
701 if (backgroundSize != m_backgroundLayer->size()) { 701 if (backgroundSize != m_backgroundLayer->size()) {
702 m_backgroundLayer->setSize(backgroundSize); 702 m_backgroundLayer->setSize(backgroundSize);
703 m_backgroundLayer->setNeedsDisplay(); 703 m_backgroundLayer->setNeedsDisplay();
704 } 704 }
705 m_backgroundLayer->setOffsetFromRenderer(m_graphicsLayer->offsetFromRend erer()); 705 m_backgroundLayer->setOffsetFromRenderer(m_graphicsLayer->offsetFromRend erer());
706 } 706 }
707 707
708 if (m_owningLayer->reflectionInfo() && m_owningLayer->reflectionInfo()->refl ectionLayer()->compositedLayerMapping()) { 708 if (m_owningLayer->reflectionInfo() && m_owningLayer->reflectionInfo()->refl ectionLayer()->compositingState() == PaintsIntoOwnBacking) {
709 CompositedLayerMapping* reflectionCompositedLayerMapping = m_owningLayer ->reflectionInfo()->reflectionLayer()->compositedLayerMapping(); 709 CompositedLayerMappingPtr reflectionCompositedLayerMapping = m_owningLay er->reflectionInfo()->reflectionLayer()->compositedLayerMapping();
710 reflectionCompositedLayerMapping->updateGraphicsLayerGeometry(); 710 reflectionCompositedLayerMapping->updateGraphicsLayerGeometry();
711 711
712 // The reflection layer has the bounds of m_owningLayer->reflectionLayer (), 712 // The reflection layer has the bounds of m_owningLayer->reflectionLayer (),
713 // but the reflected layer is the bounds of this layer, so we need to po sition it appropriately. 713 // but the reflected layer is the bounds of this layer, so we need to po sition it appropriately.
714 FloatRect layerBounds = compositedBounds(); 714 FloatRect layerBounds = compositedBounds();
715 FloatRect reflectionLayerBounds = reflectionCompositedLayerMapping->comp ositedBounds(); 715 FloatRect reflectionLayerBounds = reflectionCompositedLayerMapping->comp ositedBounds();
716 reflectionCompositedLayerMapping->mainGraphicsLayer()->setReplicatedLaye rPosition(FloatPoint(layerBounds.location() - reflectionLayerBounds.location())) ; 716 reflectionCompositedLayerMapping->mainGraphicsLayer()->setReplicatedLaye rPosition(FloatPoint(layerBounds.location() - reflectionLayerBounds.location())) ;
717 } 717 }
718 718
719 if (m_scrollingLayer) { 719 if (m_scrollingLayer) {
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 parent->stackingNode()->updateLayerListsIfNeeded(); 1350 parent->stackingNode()->updateLayerListsIfNeeded();
1351 1351
1352 #if !ASSERT_DISABLED 1352 #if !ASSERT_DISABLED
1353 LayerListMutationDetector mutationChecker(parent->stackingNode()); 1353 LayerListMutationDetector mutationChecker(parent->stackingNode());
1354 #endif 1354 #endif
1355 1355
1356 if (Vector<RenderLayerStackingNode*>* normalFlowList = parent->stackingNode( )->normalFlowList()) { 1356 if (Vector<RenderLayerStackingNode*>* normalFlowList = parent->stackingNode( )->normalFlowList()) {
1357 size_t listSize = normalFlowList->size(); 1357 size_t listSize = normalFlowList->size();
1358 for (size_t i = 0; i < listSize; ++i) { 1358 for (size_t i = 0; i < listSize; ++i) {
1359 RenderLayer* curLayer = normalFlowList->at(i)->layer(); 1359 RenderLayer* curLayer = normalFlowList->at(i)->layer();
1360 if (!curLayer->compositedLayerMapping() 1360 if (curLayer->compositingState() == NotComposited
shawnsingh 2013/11/05 10:20:27 I think this should be written as: if (curLayer-
Ian Vollick 2013/11/08 03:35:12 I agree with you on this, but it is a behavior cha
1361 && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDes cendant(curLayer))) 1361 && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDes cendant(curLayer)))
1362 return true; 1362 return true;
1363 } 1363 }
1364 } 1364 }
1365 1365
1366 if (parent->stackingNode()->isStackingContainer()) { 1366 if (parent->stackingNode()->isStackingContainer()) {
1367 if (!parent->hasVisibleDescendant()) 1367 if (!parent->hasVisibleDescendant())
1368 return false; 1368 return false;
1369 1369
1370 // Use the m_hasCompositingDescendant bit to optimize? 1370 // Use the m_hasCompositingDescendant bit to optimize?
1371 if (Vector<RenderLayerStackingNode*>* negZOrderList = parent->stackingNo de()->negZOrderList()) { 1371 if (Vector<RenderLayerStackingNode*>* negZOrderList = parent->stackingNo de()->negZOrderList()) {
1372 size_t listSize = negZOrderList->size(); 1372 size_t listSize = negZOrderList->size();
1373 for (size_t i = 0; i < listSize; ++i) { 1373 for (size_t i = 0; i < listSize; ++i) {
1374 RenderLayer* curLayer = negZOrderList->at(i)->layer(); 1374 RenderLayer* curLayer = negZOrderList->at(i)->layer();
1375 if (!curLayer->compositedLayerMapping() 1375 if (curLayer->compositingState() == NotComposited
1376 && (curLayer->hasVisibleContent() || hasVisibleNonCompositin gDescendant(curLayer))) 1376 && (curLayer->hasVisibleContent() || hasVisibleNonCompositin gDescendant(curLayer)))
1377 return true; 1377 return true;
1378 } 1378 }
1379 } 1379 }
1380 1380
1381 if (Vector<RenderLayerStackingNode*>* posZOrderList = parent->stackingNo de()->posZOrderList()) { 1381 if (Vector<RenderLayerStackingNode*>* posZOrderList = parent->stackingNo de()->posZOrderList()) {
1382 size_t listSize = posZOrderList->size(); 1382 size_t listSize = posZOrderList->size();
1383 for (size_t i = 0; i < listSize; ++i) { 1383 for (size_t i = 0; i < listSize; ++i) {
1384 RenderLayer* curLayer = posZOrderList->at(i)->layer(); 1384 RenderLayer* curLayer = posZOrderList->at(i)->layer();
1385 if (!curLayer->compositedLayerMapping() 1385 if (curLayer->compositingState() == NotComposited
1386 && (curLayer->hasVisibleContent() || hasVisibleNonCompositin gDescendant(curLayer))) 1386 && (curLayer->hasVisibleContent() || hasVisibleNonCompositin gDescendant(curLayer)))
1387 return true; 1387 return true;
1388 } 1388 }
1389 } 1389 }
1390 } 1390 }
1391 1391
1392 return false; 1392 return false;
1393 } 1393 }
1394 1394
1395 // FIXME: By name the implementation is correct. But the code that uses this fun ction means something 1395 // FIXME: By name the implementation is correct. But the code that uses this fun ction means something
shawnsingh 2013/11/05 10:20:27 By the way, the 3 lines you are changing in hasVis
Ian Vollick 2013/11/08 03:35:12 I think I've spoken to this with my previous comme
1396 // very slightly different - the implementation needs to also include composited descendants that 1396 // very slightly different - the implementation needs to also include composited descendants that
1397 // don't paint into their own backing, and instead paint into this backing. 1397 // don't paint into their own backing, and instead paint into this backing.
1398 bool CompositedLayerMapping::hasVisibleNonCompositingDescendantLayers() const 1398 bool CompositedLayerMapping::hasVisibleNonCompositingDescendantLayers() const
1399 { 1399 {
1400 return hasVisibleNonCompositingDescendant(m_owningLayer); 1400 return hasVisibleNonCompositingDescendant(m_owningLayer);
1401 } 1401 }
1402 1402
1403 bool CompositedLayerMapping::containsPaintedContent(bool isSimpleContainer) cons t 1403 bool CompositedLayerMapping::containsPaintedContent(bool isSimpleContainer) cons t
1404 { 1404 {
1405 if (isSimpleContainer || paintsIntoCompositedAncestor() || m_artificiallyInf latedBounds || m_owningLayer->isReflection()) 1405 if (isSimpleContainer || paintsIntoCompositedAncestor() || m_artificiallyInf latedBounds || m_owningLayer->isReflection())
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2025 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2026 name = "Scrolling Contents Layer"; 2026 name = "Scrolling Contents Layer";
2027 } else { 2027 } else {
2028 ASSERT_NOT_REACHED(); 2028 ASSERT_NOT_REACHED();
2029 } 2029 }
2030 2030
2031 return name; 2031 return name;
2032 } 2032 }
2033 2033
2034 } // namespace WebCore 2034 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698