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

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

Issue 99883002: Refactor BlendMode into a separate class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 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) 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 RenderLayer::RenderLayer(RenderLayerModelObject* renderer) 105 RenderLayer::RenderLayer(RenderLayerModelObject* renderer)
106 : m_hasSelfPaintingLayerDescendant(false) 106 : m_hasSelfPaintingLayerDescendant(false)
107 , m_hasSelfPaintingLayerDescendantDirty(false) 107 , m_hasSelfPaintingLayerDescendantDirty(false)
108 , m_hasOutOfFlowPositionedDescendant(false) 108 , m_hasOutOfFlowPositionedDescendant(false)
109 , m_hasOutOfFlowPositionedDescendantDirty(true) 109 , m_hasOutOfFlowPositionedDescendantDirty(true)
110 , m_hasUnclippedDescendant(false) 110 , m_hasUnclippedDescendant(false)
111 , m_isUnclippedDescendant(false) 111 , m_isUnclippedDescendant(false)
112 , m_isRootLayer(renderer->isRenderView()) 112 , m_isRootLayer(renderer->isRenderView())
113 , m_usedTransparency(false) 113 , m_usedTransparency(false)
114 , m_childLayerHasBlendMode(false)
115 , m_childLayerHasBlendModeStatusDirty(false)
116 , m_visibleContentStatusDirty(true) 114 , m_visibleContentStatusDirty(true)
117 , m_hasVisibleContent(false) 115 , m_hasVisibleContent(false)
118 , m_visibleDescendantStatusDirty(false) 116 , m_visibleDescendantStatusDirty(false)
119 , m_hasVisibleDescendant(false) 117 , m_hasVisibleDescendant(false)
120 , m_hasVisibleNonLayerContent(false) 118 , m_hasVisibleNonLayerContent(false)
121 , m_isPaginated(false) 119 , m_isPaginated(false)
122 , m_3DTransformedDescendantStatusDirty(true) 120 , m_3DTransformedDescendantStatusDirty(true)
123 , m_has3DTransformedDescendant(false) 121 , m_has3DTransformedDescendant(false)
124 , m_containsDirtyOverlayScrollbars(false) 122 , m_containsDirtyOverlayScrollbars(false)
125 , m_canSkipRepaintRectsUpdateOnScroll(renderer->isTableCell()) 123 , m_canSkipRepaintRectsUpdateOnScroll(renderer->isTableCell())
126 , m_hasFilterInfo(false) 124 , m_hasFilterInfo(false)
127 , m_blendMode(blink::WebBlendModeNormal)
128 , m_renderer(renderer) 125 , m_renderer(renderer)
129 , m_parent(0) 126 , m_parent(0)
130 , m_previous(0) 127 , m_previous(0)
131 , m_next(0) 128 , m_next(0)
132 , m_first(0) 129 , m_first(0)
133 , m_last(0) 130 , m_last(0)
134 , m_staticInlinePosition(0) 131 , m_staticInlinePosition(0)
135 , m_staticBlockPosition(0) 132 , m_staticBlockPosition(0)
136 , m_enclosingPaginationLayer(0) 133 , m_enclosingPaginationLayer(0)
137 , m_repainter(renderer) 134 , m_repainter(renderer)
138 , m_clipper(renderer) 135 , m_clipper(renderer)
136 , m_blendInfo(renderer)
139 { 137 {
140 updateStackingNode(); 138 updateStackingNode();
141 139
142 m_isSelfPaintingLayer = shouldBeSelfPaintingLayer(); 140 m_isSelfPaintingLayer = shouldBeSelfPaintingLayer();
143 141
144 if (!renderer->firstChild() && renderer->style()) { 142 if (!renderer->firstChild() && renderer->style()) {
145 m_visibleContentStatusDirty = false; 143 m_visibleContentStatusDirty = false;
146 m_hasVisibleContent = renderer->style()->visibility() == VISIBLE; 144 m_hasVisibleContent = renderer->style()->visibility() == VISIBLE;
147 } 145 }
148 146
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 child->updateLayerPositionsAfterScroll(geometryMap, flags); 506 child->updateLayerPositionsAfterScroll(geometryMap, flags);
509 507
510 // We don't update our reflection as scrolling is a translation which does n ot change the size() 508 // We don't update our reflection as scrolling is a translation which does n ot change the size()
511 // of an object, thus RenderReplica will still repaint itself properly as th e layer position was 509 // of an object, thus RenderReplica will still repaint itself properly as th e layer position was
512 // updated above. 510 // updated above.
513 511
514 if (geometryMap) 512 if (geometryMap)
515 geometryMap->popMappingsToAncestor(parent()); 513 geometryMap->popMappingsToAncestor(parent());
516 } 514 }
517 515
518 bool RenderLayer::hasBlendMode() const
519 {
520 return RuntimeEnabledFeatures::cssCompositingEnabled() && renderer()->hasBle ndMode();
521 }
522
523 void RenderLayer::updateBlendMode()
524 {
525 if (!RuntimeEnabledFeatures::cssCompositingEnabled())
526 return;
527
528 bool hadBlendMode = m_blendMode != blink::WebBlendModeNormal;
529 blink::WebBlendMode newBlendMode = renderer()->style()->blendMode();
530 if (newBlendMode != m_blendMode) {
531 m_blendMode = newBlendMode;
532
533 // Only update the flag if a blend mode is set or unset.
534 if (parent() && (!hadBlendMode || !hasBlendMode()))
535 parent()->dirtyAncestorChainBlendedDescendantStatus();
536
537 if (hasCompositedLayerMapping())
538 compositedLayerMapping()->setBlendMode(newBlendMode);
539 }
540 }
541
542 void RenderLayer::updateTransform() 516 void RenderLayer::updateTransform()
543 { 517 {
544 // hasTransform() on the renderer is also true when there is transform-style : preserve-3d or perspective set, 518 // hasTransform() on the renderer is also true when there is transform-style : preserve-3d or perspective set,
545 // so check style too. 519 // so check style too.
546 bool hasTransform = renderer()->hasTransform() && renderer()->style()->hasTr ansform(); 520 bool hasTransform = renderer()->hasTransform() && renderer()->style()->hasTr ansform();
547 bool had3DTransform = has3DTransform(); 521 bool had3DTransform = has3DTransform();
548 522
549 bool hadTransform = m_transform; 523 bool hadTransform = m_transform;
550 if (hasTransform != hadTransform) { 524 if (hasTransform != hadTransform) {
551 if (hasTransform) 525 if (hasTransform)
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 { 725 {
752 for (RenderLayer* layer = this; layer; layer = layer->parent()) { 726 for (RenderLayer* layer = this; layer; layer = layer->parent()) {
753 if (!layer->m_visibleDescendantStatusDirty && layer->hasVisibleDescendan t()) 727 if (!layer->m_visibleDescendantStatusDirty && layer->hasVisibleDescendan t())
754 break; 728 break;
755 729
756 layer->m_hasVisibleDescendant = true; 730 layer->m_hasVisibleDescendant = true;
757 layer->m_visibleDescendantStatusDirty = false; 731 layer->m_visibleDescendantStatusDirty = false;
758 } 732 }
759 } 733 }
760 734
761 void RenderLayer::dirtyAncestorChainBlendedDescendantStatus()
762 {
763 for (RenderLayer* layer = this; layer; layer = layer->parent()) {
764 if (layer->m_childLayerHasBlendModeStatusDirty)
765 break;
766
767 layer->m_childLayerHasBlendModeStatusDirty = true;
768
769 if (layer->stackingNode()->isStackingContext())
770 break;
771 }
772 }
773
774 void RenderLayer::setAncestorChainBlendedDescendant()
775 {
776 for (RenderLayer* layer = this; layer; layer = layer->parent()) {
777 if (!layer->m_childLayerHasBlendModeStatusDirty && layer->childLayerHasB lendMode())
778 break;
779
780 layer->m_childLayerHasBlendMode = true;
781 layer->m_childLayerHasBlendModeStatusDirty = false;
782
783 if (layer->stackingNode()->isStackingContext())
784 break;
785 }
786 }
787
788 void RenderLayer::updateHasUnclippedDescendant() 735 void RenderLayer::updateHasUnclippedDescendant()
789 { 736 {
790 TRACE_EVENT0("blink_rendering", "RenderLayer::updateHasUnclippedDescendant") ; 737 TRACE_EVENT0("blink_rendering", "RenderLayer::updateHasUnclippedDescendant") ;
791 ASSERT(renderer()->isOutOfFlowPositioned()); 738 ASSERT(renderer()->isOutOfFlowPositioned());
792 if (!m_hasVisibleContent && !m_hasVisibleDescendant) 739 if (!m_hasVisibleContent && !m_hasVisibleDescendant)
793 return; 740 return;
794 741
795 FrameView* frameView = renderer()->view()->frameView(); 742 FrameView* frameView = renderer()->view()->frameView();
796 if (!frameView) 743 if (!frameView)
797 return; 744 return;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 798
852 if (m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant && ha sOutOfFlowPositionedDescendant) 799 if (m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant && ha sOutOfFlowPositionedDescendant)
853 break; 800 break;
854 } 801 }
855 802
856 m_visibleDescendantStatusDirty = false; 803 m_visibleDescendantStatusDirty = false;
857 m_hasSelfPaintingLayerDescendantDirty = false; 804 m_hasSelfPaintingLayerDescendantDirty = false;
858 m_hasOutOfFlowPositionedDescendantDirty = false; 805 m_hasOutOfFlowPositionedDescendantDirty = false;
859 } 806 }
860 807
861 if (m_childLayerHasBlendModeStatusDirty) { 808 if (m_blendInfo.childLayerHasBlendModeStatusDirty()) {
862 m_childLayerHasBlendMode = false; 809 m_blendInfo.setChildLayerHasBlendMode(false);
863 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin g()) { 810 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin g()) {
864 if (!child->stackingNode()->isStackingContext()) 811 if (!child->stackingNode()->isStackingContext())
865 child->updateDescendantDependentFlags(); 812 child->updateDescendantDependentFlags();
866 813
867 bool childLayerHasBlendMode = child->paintsWithBlendMode() || (child ->m_childLayerHasBlendMode && !child->stackingNode()->isStackingContext()); 814 bool childLayerHasBlendMode = child->paintsWithBlendMode()
868 m_childLayerHasBlendMode |= childLayerHasBlendMode; 815 || (child->blendInfo().childLayerHasBlendModeWhileDirty() && !ch ild->stackingNode()->isStackingContext());
Julien - ping for review 2013/12/10 00:55:09 We should *never* allow the flag to be queried dir
dsinclair 2013/12/10 16:59:12 The current code does require this at the moment.
869 816
870 if (m_childLayerHasBlendMode) 817 m_blendInfo.updateChildLayerHasBlendMode(childLayerHasBlendMode);
Julien - ping for review 2013/12/10 00:55:09 A better way to handle that would be to store this
dsinclair 2013/12/13 16:53:59 Done.
818
819 if (m_blendInfo.childLayerHasBlendModeWhileDirty())
871 break; 820 break;
872 } 821 }
873 m_childLayerHasBlendModeStatusDirty = false; 822 m_blendInfo.setChildLayerHasBlendModeStatusDirty(false);
874 } 823 }
875 824
876 if (m_visibleContentStatusDirty) { 825 if (m_visibleContentStatusDirty) {
877 if (renderer()->style()->visibility() == VISIBLE) 826 if (renderer()->style()->visibility() == VISIBLE)
878 m_hasVisibleContent = true; 827 m_hasVisibleContent = true;
879 else { 828 else {
880 // layer may be hidden but still have some visible content, check fo r this 829 // layer may be hidden but still have some visible content, check fo r this
881 m_hasVisibleContent = false; 830 m_hasVisibleContent = false;
882 RenderObject* r = renderer()->firstChild(); 831 RenderObject* r = renderer()->firstChild();
883 while (r) { 832 while (r) {
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 return clipRect; 1278 return clipRect;
1330 } 1279 }
1331 1280
1332 LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou tRect& paintDirtyRect, PaintBehavior paintBehavior) 1281 LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou tRect& paintDirtyRect, PaintBehavior paintBehavior)
1333 { 1282 {
1334 return intersection(transparencyClipBox(this, rootLayer, PaintingTransparenc yClipBox, RootOfTransparencyClipBox, paintBehavior), paintDirtyRect); 1283 return intersection(transparencyClipBox(this, rootLayer, PaintingTransparenc yClipBox, RootOfTransparencyClipBox, paintBehavior), paintDirtyRect);
1335 } 1284 }
1336 1285
1337 void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const Render Layer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior) 1286 void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const Render Layer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior)
1338 { 1287 {
1339 bool createTransparencyLayerForBlendMode = m_stackingNode->isStackingContext () && m_childLayerHasBlendMode; 1288 bool createTransparencyLayerForBlendMode = m_stackingNode->isStackingContext () && m_blendInfo.childLayerHasBlendMode();
1340 if (context->paintingDisabled() || ((paintsWithTransparency(paintBehavior) | | paintsWithBlendMode() || createTransparencyLayerForBlendMode) && m_usedTranspa rency)) 1289 if (context->paintingDisabled() || ((paintsWithTransparency(paintBehavior) | | paintsWithBlendMode() || createTransparencyLayerForBlendMode) && m_usedTranspa rency))
1341 return; 1290 return;
1342 1291
1343 RenderLayer* ancestor = transparentPaintingAncestor(); 1292 RenderLayer* ancestor = transparentPaintingAncestor();
1344 if (ancestor) 1293 if (ancestor)
1345 ancestor->beginTransparencyLayers(context, rootLayer, paintDirtyRect, pa intBehavior); 1294 ancestor->beginTransparencyLayers(context, rootLayer, paintDirtyRect, pa intBehavior);
1346 1295
1347 if (paintsWithTransparency(paintBehavior) || paintsWithBlendMode() || create TransparencyLayerForBlendMode) { 1296 if (paintsWithTransparency(paintBehavior) || paintsWithBlendMode() || create TransparencyLayerForBlendMode) {
1348 m_usedTransparency = true; 1297 m_usedTransparency = true;
1349 context->save(); 1298 context->save();
1350 LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, paintBeh avior); 1299 LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, paintBeh avior);
1351 context->clip(clipRect); 1300 context->clip(clipRect);
1352 if (paintsWithBlendMode()) 1301 if (paintsWithBlendMode())
1353 context->setCompositeOperation(context->compositeOperation(), m_blen dMode); 1302 context->setCompositeOperation(context->compositeOperation(), m_blen dInfo.blendMode());
1354 1303
1355 context->beginTransparencyLayer(renderer()->opacity()); 1304 context->beginTransparencyLayer(renderer()->opacity());
1356 #ifdef REVEAL_TRANSPARENCY_LAYERS 1305 #ifdef REVEAL_TRANSPARENCY_LAYERS
1357 context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f)); 1306 context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f));
1358 context->fillRect(clipRect); 1307 context->fillRect(clipRect);
1359 #endif 1308 #endif
1360 } 1309 }
1361 } 1310 }
1362 1311
1363 void* RenderLayer::operator new(size_t sz) 1312 void* RenderLayer::operator new(size_t sz)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 child->stackingNode()->dirtyStackingContainerZOrderLists(); 1348 child->stackingNode()->dirtyStackingContainerZOrderLists();
1400 } 1349 }
1401 1350
1402 child->updateDescendantDependentFlags(); 1351 child->updateDescendantDependentFlags();
1403 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) 1352 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant)
1404 setAncestorChainHasVisibleDescendant(); 1353 setAncestorChainHasVisibleDescendant();
1405 1354
1406 if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant()) 1355 if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant())
1407 setAncestorChainHasSelfPaintingLayerDescendant(); 1356 setAncestorChainHasSelfPaintingLayerDescendant();
1408 1357
1409 if (child->paintsWithBlendMode() || child->childLayerHasBlendMode()) 1358 if (child->paintsWithBlendMode() || child->blendInfo().childLayerHasBlendMod e())
1410 setAncestorChainBlendedDescendant(); 1359 m_blendInfo.setAncestorChainBlendedDescendant();
1411 1360
1412 if (subtreeContainsOutOfFlowPositionedLayer(child)) { 1361 if (subtreeContainsOutOfFlowPositionedLayer(child)) {
1413 // Now that the out of flow positioned descendant is in the tree, we 1362 // Now that the out of flow positioned descendant is in the tree, we
1414 // need to tell the compositor to reevaluate the compositing 1363 // need to tell the compositor to reevaluate the compositing
1415 // requirements since we may be able to mark more layers as having 1364 // requirements since we may be able to mark more layers as having
1416 // an 'unclipped' descendant. 1365 // an 'unclipped' descendant.
1417 compositor()->setNeedsUpdateCompositingRequirementsState(); 1366 compositor()->setNeedsUpdateCompositingRequirementsState();
1418 setAncestorChainHasOutOfFlowPositionedDescendant(); 1367 setAncestorChainHasOutOfFlowPositionedDescendant();
1419 } 1368 }
1420 1369
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 // It may now be the case that a layer no longer has an unclipped 1409 // It may now be the case that a layer no longer has an unclipped
1461 // descendant. Let the compositor know that it needs to reevaluate 1410 // descendant. Let the compositor know that it needs to reevaluate
1462 // its compositing requirements to check this. 1411 // its compositing requirements to check this.
1463 compositor()->setNeedsUpdateCompositingRequirementsState(); 1412 compositor()->setNeedsUpdateCompositingRequirementsState();
1464 dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); 1413 dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
1465 } 1414 }
1466 1415
1467 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant) 1416 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant)
1468 dirtyAncestorChainVisibleDescendantStatus(); 1417 dirtyAncestorChainVisibleDescendantStatus();
1469 1418
1470 if (oldChild->paintsWithBlendMode() || oldChild->childLayerHasBlendMode()) 1419 if (oldChild->paintsWithBlendMode() || oldChild->blendInfo().childLayerHasBl endMode())
1471 dirtyAncestorChainBlendedDescendantStatus(); 1420 m_blendInfo.dirtyAncestorChainBlendedDescendantStatus();
1472 1421
1473 if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescend ant()) 1422 if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescend ant())
1474 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 1423 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
1475 1424
1476 return oldChild; 1425 return oldChild;
1477 } 1426 }
1478 1427
1479 void RenderLayer::removeOnlyThisLayer() 1428 void RenderLayer::removeOnlyThisLayer()
1480 { 1429 {
1481 if (!m_parent) 1430 if (!m_parent)
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
2048 paintingInfo.paintDirtyRect, context, clipperContext)) { 1997 paintingInfo.paintDirtyRect, context, clipperContext)) {
2049 // No need to post-apply the clipper if this failed. 1998 // No need to post-apply the clipper if this failed.
2050 resourceClipper = 0; 1999 resourceClipper = 0;
2051 } 2000 }
2052 } 2001 }
2053 } 2002 }
2054 } 2003 }
2055 2004
2056 // Blending operations must be performed only with the nearest ancestor stac king context. 2005 // Blending operations must be performed only with the nearest ancestor stac king context.
2057 // Note that there is no need to create a transparency layer if we're painti ng the root. 2006 // Note that there is no need to create a transparency layer if we're painti ng the root.
2058 bool createTransparencyLayerForBlendMode = !renderer()->isRoot() && m_stacki ngNode->isStackingContext() && m_childLayerHasBlendMode; 2007 bool createTransparencyLayerForBlendMode = !renderer()->isRoot() && m_stacki ngNode->isStackingContext() && m_blendInfo.childLayerHasBlendMode();
2059 2008
2060 if (createTransparencyLayerForBlendMode) 2009 if (createTransparencyLayerForBlendMode)
2061 beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.pa intDirtyRect, paintingInfo.paintBehavior); 2010 beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.pa intDirtyRect, paintingInfo.paintBehavior);
2062 2011
2063 LayerPaintingInfo localPaintingInfo(paintingInfo); 2012 LayerPaintingInfo localPaintingInfo(paintingInfo);
2064 FilterEffectRendererHelper filterPainter(filterRenderer() && paintsWithFilte rs()); 2013 FilterEffectRendererHelper filterPainter(filterRenderer() && paintsWithFilte rs());
2065 if (filterPainter.haveFilterEffect() && !context->paintingDisabled()) { 2014 if (filterPainter.haveFilterEffect() && !context->paintingDisabled()) {
2066 RenderLayerFilterInfo* filterInfo = this->filterInfo(); 2015 RenderLayerFilterInfo* filterInfo = this->filterInfo();
2067 ASSERT(filterInfo); 2016 ASSERT(filterInfo);
2068 LayoutRect filterRepaintRect = filterInfo->dirtySourceRect(); 2017 LayoutRect filterRepaintRect = filterInfo->dirtySourceRect();
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after
3648 3597
3649 CompositedLayerMappingPtr RenderLayer::ensureCompositedLayerMapping() 3598 CompositedLayerMappingPtr RenderLayer::ensureCompositedLayerMapping()
3650 { 3599 {
3651 if (!m_compositedLayerMapping) { 3600 if (!m_compositedLayerMapping) {
3652 m_compositedLayerMapping = adoptPtr(new CompositedLayerMapping(this)); 3601 m_compositedLayerMapping = adoptPtr(new CompositedLayerMapping(this));
3653 compositor()->layerBecameComposited(this); 3602 compositor()->layerBecameComposited(this);
3654 3603
3655 updateOrRemoveFilterEffectRenderer(); 3604 updateOrRemoveFilterEffectRenderer();
3656 3605
3657 if (RuntimeEnabledFeatures::cssCompositingEnabled()) 3606 if (RuntimeEnabledFeatures::cssCompositingEnabled())
3658 compositedLayerMapping()->setBlendMode(m_blendMode); 3607 compositedLayerMapping()->setBlendMode(m_blendInfo.blendMode());
3659 } 3608 }
3660 return m_compositedLayerMapping.get(); 3609 return m_compositedLayerMapping.get();
3661 } 3610 }
3662 3611
3663 void RenderLayer::clearCompositedLayerMapping(bool layerBeingDestroyed) 3612 void RenderLayer::clearCompositedLayerMapping(bool layerBeingDestroyed)
3664 { 3613 {
3665 if (m_compositedLayerMapping && !renderer()->documentBeingDestroyed()) 3614 if (m_compositedLayerMapping && !renderer()->documentBeingDestroyed())
3666 compositor()->layerBecameNonComposited(this); 3615 compositor()->layerBecameNonComposited(this);
3667 m_compositedLayerMapping.clear(); 3616 m_compositedLayerMapping.clear();
3668 3617
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
3965 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle); 3914 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle);
3966 updateVisibilityAfterStyleChange(oldStyle); 3915 updateVisibilityAfterStyleChange(oldStyle);
3967 // Overlay scrollbars can make this layer self-painting so we need 3916 // Overlay scrollbars can make this layer self-painting so we need
3968 // to recompute the bit once scrollbars have been updated. 3917 // to recompute the bit once scrollbars have been updated.
3969 updateSelfPaintingLayer(); 3918 updateSelfPaintingLayer();
3970 updateOutOfFlowPositioned(oldStyle); 3919 updateOutOfFlowPositioned(oldStyle);
3971 3920
3972 updateReflectionInfo(oldStyle); 3921 updateReflectionInfo(oldStyle);
3973 3922
3974 if (RuntimeEnabledFeatures::cssCompositingEnabled()) 3923 if (RuntimeEnabledFeatures::cssCompositingEnabled())
3975 updateBlendMode(); 3924 m_blendInfo.updateBlendMode();
3976 3925
3977 updateDescendantDependentFlags(); 3926 updateDescendantDependentFlags();
3978 updateTransform(); 3927 updateTransform();
3979 3928
3980 bool didPaintWithFilters = false; 3929 bool didPaintWithFilters = false;
3981 3930
3982 if (paintsWithFilters()) 3931 if (paintsWithFilters())
3983 didPaintWithFilters = true; 3932 didPaintWithFilters = true;
3984 updateFilters(oldStyle, renderer()->style()); 3933 updateFilters(oldStyle, renderer()->style());
3985 3934
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
4160 } 4109 }
4161 } 4110 }
4162 4111
4163 void showLayerTree(const WebCore::RenderObject* renderer) 4112 void showLayerTree(const WebCore::RenderObject* renderer)
4164 { 4113 {
4165 if (!renderer) 4114 if (!renderer)
4166 return; 4115 return;
4167 showLayerTree(renderer->enclosingLayer()); 4116 showLayerTree(renderer->enclosingLayer());
4168 } 4117 }
4169 #endif 4118 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698