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

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: Rebase to master Created 6 years, 11 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 | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerBlendInfo.h » ('j') | 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 RenderLayer::RenderLayer(RenderLayerModelObject* renderer) 104 RenderLayer::RenderLayer(RenderLayerModelObject* renderer)
105 : m_hasSelfPaintingLayerDescendant(false) 105 : m_hasSelfPaintingLayerDescendant(false)
106 , m_hasSelfPaintingLayerDescendantDirty(false) 106 , m_hasSelfPaintingLayerDescendantDirty(false)
107 , m_hasOutOfFlowPositionedDescendant(false) 107 , m_hasOutOfFlowPositionedDescendant(false)
108 , m_hasOutOfFlowPositionedDescendantDirty(true) 108 , m_hasOutOfFlowPositionedDescendantDirty(true)
109 , m_hasUnclippedDescendant(false) 109 , m_hasUnclippedDescendant(false)
110 , m_isUnclippedDescendant(false) 110 , m_isUnclippedDescendant(false)
111 , m_isRootLayer(renderer->isRenderView()) 111 , m_isRootLayer(renderer->isRenderView())
112 , m_usedTransparency(false) 112 , m_usedTransparency(false)
113 , m_childLayerHasBlendMode(false)
114 , m_childLayerHasBlendModeStatusDirty(false)
115 , m_visibleContentStatusDirty(true) 113 , m_visibleContentStatusDirty(true)
116 , m_hasVisibleContent(false) 114 , m_hasVisibleContent(false)
117 , m_visibleDescendantStatusDirty(false) 115 , m_visibleDescendantStatusDirty(false)
118 , m_hasVisibleDescendant(false) 116 , m_hasVisibleDescendant(false)
119 , m_hasVisibleNonLayerContent(false) 117 , m_hasVisibleNonLayerContent(false)
120 , m_isPaginated(false) 118 , m_isPaginated(false)
121 , m_3DTransformedDescendantStatusDirty(true) 119 , m_3DTransformedDescendantStatusDirty(true)
122 , m_has3DTransformedDescendant(false) 120 , m_has3DTransformedDescendant(false)
123 , m_containsDirtyOverlayScrollbars(false) 121 , m_containsDirtyOverlayScrollbars(false)
124 , m_canSkipRepaintRectsUpdateOnScroll(renderer->isTableCell()) 122 , m_canSkipRepaintRectsUpdateOnScroll(renderer->isTableCell())
125 , m_hasFilterInfo(false) 123 , m_hasFilterInfo(false)
126 , m_blendMode(blink::WebBlendModeNormal)
127 , m_renderer(renderer) 124 , m_renderer(renderer)
128 , m_parent(0) 125 , m_parent(0)
129 , m_previous(0) 126 , m_previous(0)
130 , m_next(0) 127 , m_next(0)
131 , m_first(0) 128 , m_first(0)
132 , m_last(0) 129 , m_last(0)
133 , m_staticInlinePosition(0) 130 , m_staticInlinePosition(0)
134 , m_staticBlockPosition(0) 131 , m_staticBlockPosition(0)
135 , m_enclosingPaginationLayer(0) 132 , m_enclosingPaginationLayer(0)
136 , m_groupedMapping(0) 133 , m_groupedMapping(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->blendInfo().childLayerHasBlendM odeWhileDirty();
868 m_childLayerHasBlendMode |= childLayerHasBlendMode; 815 childLayerHasBlendMode |= child->paintsWithBlendMode()
816 || (childLayerHasBlendMode && !child->stackingNode()->isStacking Context());
869 817
870 if (m_childLayerHasBlendMode) 818 m_blendInfo.setChildLayerHasBlendMode(childLayerHasBlendMode);
819
820 if (childLayerHasBlendMode)
871 break; 821 break;
872 } 822 }
873 m_childLayerHasBlendModeStatusDirty = false; 823 m_blendInfo.setChildLayerHasBlendModeStatusDirty(false);
874 } 824 }
875 825
876 if (m_visibleContentStatusDirty) { 826 if (m_visibleContentStatusDirty) {
877 if (renderer()->style()->visibility() == VISIBLE) 827 if (renderer()->style()->visibility() == VISIBLE)
878 m_hasVisibleContent = true; 828 m_hasVisibleContent = true;
879 else { 829 else {
880 // layer may be hidden but still have some visible content, check fo r this 830 // layer may be hidden but still have some visible content, check fo r this
881 m_hasVisibleContent = false; 831 m_hasVisibleContent = false;
882 RenderObject* r = renderer()->firstChild(); 832 RenderObject* r = renderer()->firstChild();
883 while (r) { 833 while (r) {
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 return clipRect; 1272 return clipRect;
1323 } 1273 }
1324 1274
1325 LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou tRect& paintDirtyRect, PaintBehavior paintBehavior) 1275 LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou tRect& paintDirtyRect, PaintBehavior paintBehavior)
1326 { 1276 {
1327 return intersection(transparencyClipBox(this, rootLayer, PaintingTransparenc yClipBox, RootOfTransparencyClipBox, paintBehavior), paintDirtyRect); 1277 return intersection(transparencyClipBox(this, rootLayer, PaintingTransparenc yClipBox, RootOfTransparencyClipBox, paintBehavior), paintDirtyRect);
1328 } 1278 }
1329 1279
1330 void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const Render Layer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior) 1280 void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const Render Layer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior)
1331 { 1281 {
1332 bool createTransparencyLayerForBlendMode = m_stackingNode->isStackingContext () && m_childLayerHasBlendMode; 1282 bool createTransparencyLayerForBlendMode = m_stackingNode->isStackingContext () && m_blendInfo.childLayerHasBlendMode();
1333 if (context->paintingDisabled() || ((paintsWithTransparency(paintBehavior) | | paintsWithBlendMode() || createTransparencyLayerForBlendMode) && m_usedTranspa rency)) 1283 if (context->paintingDisabled() || ((paintsWithTransparency(paintBehavior) | | paintsWithBlendMode() || createTransparencyLayerForBlendMode) && m_usedTranspa rency))
1334 return; 1284 return;
1335 1285
1336 RenderLayer* ancestor = transparentPaintingAncestor(); 1286 RenderLayer* ancestor = transparentPaintingAncestor();
1337 if (ancestor) 1287 if (ancestor)
1338 ancestor->beginTransparencyLayers(context, rootLayer, paintDirtyRect, pa intBehavior); 1288 ancestor->beginTransparencyLayers(context, rootLayer, paintDirtyRect, pa intBehavior);
1339 1289
1340 if (paintsWithTransparency(paintBehavior) || paintsWithBlendMode() || create TransparencyLayerForBlendMode) { 1290 if (paintsWithTransparency(paintBehavior) || paintsWithBlendMode() || create TransparencyLayerForBlendMode) {
1341 m_usedTransparency = true; 1291 m_usedTransparency = true;
1342 context->save(); 1292 context->save();
1343 LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, paintBeh avior); 1293 LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, paintBeh avior);
1344 context->clip(clipRect); 1294 context->clip(clipRect);
1345 1295
1346 if (paintsWithBlendMode()) 1296 if (paintsWithBlendMode())
1347 context->setCompositeOperation(context->compositeOperation(), m_blen dMode); 1297 context->setCompositeOperation(context->compositeOperation(), m_blen dInfo.blendMode());
1348 1298
1349 context->beginTransparencyLayer(renderer()->opacity()); 1299 context->beginTransparencyLayer(renderer()->opacity());
1350 1300
1351 if (paintsWithBlendMode()) 1301 if (paintsWithBlendMode())
1352 context->setCompositeOperation(context->compositeOperation(), blink: :WebBlendModeNormal); 1302 context->setCompositeOperation(context->compositeOperation(), blink: :WebBlendModeNormal);
1353 #ifdef REVEAL_TRANSPARENCY_LAYERS 1303 #ifdef REVEAL_TRANSPARENCY_LAYERS
1354 context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f)); 1304 context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f));
1355 context->fillRect(clipRect); 1305 context->fillRect(clipRect);
1356 #endif 1306 #endif
1357 } 1307 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 child->stackingNode()->dirtyStackingContainerZOrderLists(); 1346 child->stackingNode()->dirtyStackingContainerZOrderLists();
1397 } 1347 }
1398 1348
1399 child->updateDescendantDependentFlags(); 1349 child->updateDescendantDependentFlags();
1400 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) 1350 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant)
1401 setAncestorChainHasVisibleDescendant(); 1351 setAncestorChainHasVisibleDescendant();
1402 1352
1403 if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant()) 1353 if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant())
1404 setAncestorChainHasSelfPaintingLayerDescendant(); 1354 setAncestorChainHasSelfPaintingLayerDescendant();
1405 1355
1406 if (child->paintsWithBlendMode() || child->childLayerHasBlendMode()) 1356 if (child->paintsWithBlendMode() || child->blendInfo().childLayerHasBlendMod e())
1407 setAncestorChainBlendedDescendant(); 1357 m_blendInfo.setAncestorChainBlendedDescendant();
1408 1358
1409 if (subtreeContainsOutOfFlowPositionedLayer(child)) { 1359 if (subtreeContainsOutOfFlowPositionedLayer(child)) {
1410 // Now that the out of flow positioned descendant is in the tree, we 1360 // Now that the out of flow positioned descendant is in the tree, we
1411 // need to tell the compositor to reevaluate the compositing 1361 // need to tell the compositor to reevaluate the compositing
1412 // requirements since we may be able to mark more layers as having 1362 // requirements since we may be able to mark more layers as having
1413 // an 'unclipped' descendant. 1363 // an 'unclipped' descendant.
1414 compositor()->setNeedsUpdateCompositingRequirementsState(); 1364 compositor()->setNeedsUpdateCompositingRequirementsState();
1415 setAncestorChainHasOutOfFlowPositionedDescendant(); 1365 setAncestorChainHasOutOfFlowPositionedDescendant();
1416 } 1366 }
1417 1367
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 // It may now be the case that a layer no longer has an unclipped 1407 // It may now be the case that a layer no longer has an unclipped
1458 // descendant. Let the compositor know that it needs to reevaluate 1408 // descendant. Let the compositor know that it needs to reevaluate
1459 // its compositing requirements to check this. 1409 // its compositing requirements to check this.
1460 compositor()->setNeedsUpdateCompositingRequirementsState(); 1410 compositor()->setNeedsUpdateCompositingRequirementsState();
1461 dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); 1411 dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
1462 } 1412 }
1463 1413
1464 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant) 1414 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant)
1465 dirtyAncestorChainVisibleDescendantStatus(); 1415 dirtyAncestorChainVisibleDescendantStatus();
1466 1416
1467 if (oldChild->paintsWithBlendMode() || oldChild->childLayerHasBlendMode()) 1417 if (oldChild->paintsWithBlendMode() || oldChild->blendInfo().childLayerHasBl endMode())
1468 dirtyAncestorChainBlendedDescendantStatus(); 1418 m_blendInfo.dirtyAncestorChainBlendedDescendantStatus();
1469 1419
1470 if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescend ant()) 1420 if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescend ant())
1471 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 1421 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
1472 1422
1473 return oldChild; 1423 return oldChild;
1474 } 1424 }
1475 1425
1476 void RenderLayer::removeOnlyThisLayer() 1426 void RenderLayer::removeOnlyThisLayer()
1477 { 1427 {
1478 if (!m_parent) 1428 if (!m_parent)
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
2048 paintingInfo.paintDirtyRect, context, clipperContext)) { 1998 paintingInfo.paintDirtyRect, context, clipperContext)) {
2049 // No need to post-apply the clipper if this failed. 1999 // No need to post-apply the clipper if this failed.
2050 resourceClipper = 0; 2000 resourceClipper = 0;
2051 } 2001 }
2052 } 2002 }
2053 } 2003 }
2054 } 2004 }
2055 2005
2056 // Blending operations must be performed only with the nearest ancestor stac king context. 2006 // 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. 2007 // 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; 2008 bool createTransparencyLayerForBlendMode = !renderer()->isRoot() && m_stacki ngNode->isStackingContext() && m_blendInfo.childLayerHasBlendMode();
2059 2009
2060 if (createTransparencyLayerForBlendMode) 2010 if (createTransparencyLayerForBlendMode)
2061 beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.pa intDirtyRect, paintingInfo.paintBehavior); 2011 beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.pa intDirtyRect, paintingInfo.paintBehavior);
2062 2012
2063 LayerPaintingInfo localPaintingInfo(paintingInfo); 2013 LayerPaintingInfo localPaintingInfo(paintingInfo);
2064 FilterEffectRendererHelper filterPainter(filterRenderer() && paintsWithFilte rs()); 2014 FilterEffectRendererHelper filterPainter(filterRenderer() && paintsWithFilte rs());
2065 if (filterPainter.haveFilterEffect() && !context->paintingDisabled()) { 2015 if (filterPainter.haveFilterEffect() && !context->paintingDisabled()) {
2066 RenderLayerFilterInfo* filterInfo = this->filterInfo(); 2016 RenderLayerFilterInfo* filterInfo = this->filterInfo();
2067 ASSERT(filterInfo); 2017 ASSERT(filterInfo);
2068 LayoutRect filterRepaintRect = filterInfo->dirtySourceRect(); 2018 LayoutRect filterRepaintRect = filterInfo->dirtySourceRect();
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
3508 } 3458 }
3509 3459
3510 CompositedLayerMappingPtr RenderLayer::ensureCompositedLayerMapping() 3460 CompositedLayerMappingPtr RenderLayer::ensureCompositedLayerMapping()
3511 { 3461 {
3512 if (!m_compositedLayerMapping) { 3462 if (!m_compositedLayerMapping) {
3513 m_compositedLayerMapping = adoptPtr(new CompositedLayerMapping(this)); 3463 m_compositedLayerMapping = adoptPtr(new CompositedLayerMapping(this));
3514 3464
3515 updateOrRemoveFilterEffectRenderer(); 3465 updateOrRemoveFilterEffectRenderer();
3516 3466
3517 if (RuntimeEnabledFeatures::cssCompositingEnabled()) 3467 if (RuntimeEnabledFeatures::cssCompositingEnabled())
3518 compositedLayerMapping()->setBlendMode(m_blendMode); 3468 compositedLayerMapping()->setBlendMode(m_blendInfo.blendMode());
3519 } 3469 }
3520 return m_compositedLayerMapping.get(); 3470 return m_compositedLayerMapping.get();
3521 } 3471 }
3522 3472
3523 void RenderLayer::clearCompositedLayerMapping(bool layerBeingDestroyed) 3473 void RenderLayer::clearCompositedLayerMapping(bool layerBeingDestroyed)
3524 { 3474 {
3525 m_compositedLayerMapping.clear(); 3475 m_compositedLayerMapping.clear();
3526 3476
3527 if (!layerBeingDestroyed) 3477 if (!layerBeingDestroyed)
3528 updateOrRemoveFilterEffectRenderer(); 3478 updateOrRemoveFilterEffectRenderer();
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
3832 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle); 3782 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle);
3833 updateVisibilityAfterStyleChange(oldStyle); 3783 updateVisibilityAfterStyleChange(oldStyle);
3834 // Overlay scrollbars can make this layer self-painting so we need 3784 // Overlay scrollbars can make this layer self-painting so we need
3835 // to recompute the bit once scrollbars have been updated. 3785 // to recompute the bit once scrollbars have been updated.
3836 updateSelfPaintingLayer(); 3786 updateSelfPaintingLayer();
3837 updateOutOfFlowPositioned(oldStyle); 3787 updateOutOfFlowPositioned(oldStyle);
3838 3788
3839 updateReflectionInfo(oldStyle); 3789 updateReflectionInfo(oldStyle);
3840 3790
3841 if (RuntimeEnabledFeatures::cssCompositingEnabled()) 3791 if (RuntimeEnabledFeatures::cssCompositingEnabled())
3842 updateBlendMode(); 3792 m_blendInfo.updateBlendMode();
3843 3793
3844 updateDescendantDependentFlags(); 3794 updateDescendantDependentFlags();
3845 updateTransform(); 3795 updateTransform();
3846 3796
3847 bool didPaintWithFilters = false; 3797 bool didPaintWithFilters = false;
3848 3798
3849 if (paintsWithFilters()) 3799 if (paintsWithFilters())
3850 didPaintWithFilters = true; 3800 didPaintWithFilters = true;
3851 updateFilters(oldStyle, renderer()->style()); 3801 updateFilters(oldStyle, renderer()->style());
3852 3802
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
4037 } 3987 }
4038 } 3988 }
4039 3989
4040 void showLayerTree(const WebCore::RenderObject* renderer) 3990 void showLayerTree(const WebCore::RenderObject* renderer)
4041 { 3991 {
4042 if (!renderer) 3992 if (!renderer)
4043 return; 3993 return;
4044 showLayerTree(renderer->enclosingLayer()); 3994 showLayerTree(renderer->enclosingLayer());
4045 } 3995 }
4046 #endif 3996 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerBlendInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698