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

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

Issue 58543002: Use a boolean hasCompositedLayerMapping() accessor instead of the pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased 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
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderLayerModelObject.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) 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 295
296 IntRect visibleRect = m_containerLayer ? IntRect(IntPoint(), frameView->cont entsSize()) : frameView->visibleContentRect(); 296 IntRect visibleRect = m_containerLayer ? IntRect(IntPoint(), frameView->cont entsSize()) : frameView->visibleContentRect();
297 if (rootLayer->visibleRectChangeRequiresFlush(visibleRect)) { 297 if (rootLayer->visibleRectChangeRequiresFlush(visibleRect)) {
298 if (Page* page = this->page()) 298 if (Page* page = this->page())
299 page->chrome().client().scheduleCompositingLayerFlush(); 299 page->chrome().client().scheduleCompositingLayerFlush();
300 } 300 }
301 } 301 }
302 302
303 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const 303 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const
304 { 304 {
305 return m_compositedLayerCount > (rootLayer->compositedLayerMapping() ? 1 : 0 ); 305 return m_compositedLayerCount > (rootLayer->hasCompositedLayerMapping() ? 1 : 0);
306 } 306 }
307 307
308 void RenderLayerCompositor::updateCompositingRequirementsState() 308 void RenderLayerCompositor::updateCompositingRequirementsState()
309 { 309 {
310 if (!m_needsUpdateCompositingRequirementsState) 310 if (!m_needsUpdateCompositingRequirementsState)
311 return; 311 return;
312 312
313 TRACE_EVENT0("blink_rendering,comp-scroll", "RenderLayerCompositor::updateCo mpositingRequirementsState"); 313 TRACE_EVENT0("blink_rendering,comp-scroll", "RenderLayerCompositor::updateCo mpositingRequirementsState");
314 314
315 m_needsUpdateCompositingRequirementsState = false; 315 m_needsUpdateCompositingRequirementsState = false;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 // Update the hierarchy of the compositing layers. 446 // Update the hierarchy of the compositing layers.
447 Vector<GraphicsLayer*> childList; 447 Vector<GraphicsLayer*> childList;
448 { 448 {
449 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::rebuildCompo sitingLayerTree"); 449 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::rebuildCompo sitingLayerTree");
450 rebuildCompositingLayerTree(updateRoot, childList, 0); 450 rebuildCompositingLayerTree(updateRoot, childList, 0);
451 } 451 }
452 452
453 // Host the document layer in the RenderView's root layer. 453 // Host the document layer in the RenderView's root layer.
454 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isMainFra me()) { 454 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isMainFra me()) {
455 RenderVideo* video = findFullscreenVideoRenderer(&m_renderView->docu ment()); 455 RenderVideo* video = findFullscreenVideoRenderer(&m_renderView->docu ment());
456 if (video) { 456 if (video && video->hasCompositedLayerMapping()) {
457 CompositedLayerMapping* compositedLayerMapping = video->composit edLayerMapping(); 457 CompositedLayerMapping* compositedLayerMapping = video->composit edLayerMapping();
458 if (compositedLayerMapping) { 458 ASSERT(compositedLayerMapping);
hartmanng 2013/11/04 22:56:09 Personally, I'd just take this out - seems inconsi
459 childList.clear(); 459 childList.clear();
460 childList.append(compositedLayerMapping->mainGraphicsLayer() ); 460 childList.append(compositedLayerMapping->mainGraphicsLayer());
461 }
462 } 461 }
463 } 462 }
464 // Even when childList is empty, don't drop out of compositing mode if t here are 463 // Even when childList is empty, don't drop out of compositing mode if t here are
465 // composited layers that we didn't hit in our traversal (e.g. because o f visibility:hidden). 464 // composited layers that we didn't hit in our traversal (e.g. because o f visibility:hidden).
466 if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(updateRoot) ) 465 if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(updateRoot) )
467 destroyRootLayer(); 466 destroyRootLayer();
468 else 467 else
469 m_rootContentLayer->setChildren(childList); 468 m_rootContentLayer->setChildren(childList);
470 } else if (needGeometryUpdate) { 469 } else if (needGeometryUpdate) {
471 // We just need to do a geometry update. This is only used for position: fixed scrolling; 470 // We just need to do a geometry update. This is only used for position: fixed scrolling;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 bool compositedLayerMappingChanged = false; 513 bool compositedLayerMappingChanged = false;
515 RenderLayer::ViewportConstrainedNotCompositedReason viewportConstrainedNotCo mpositedReason = RenderLayer::NoNotCompositedReason; 514 RenderLayer::ViewportConstrainedNotCompositedReason viewportConstrainedNotCo mpositedReason = RenderLayer::NoNotCompositedReason;
516 requiresCompositingForPosition(layer->renderer(), layer, &viewportConstraine dNotCompositedReason); 515 requiresCompositingForPosition(layer->renderer(), layer, &viewportConstraine dNotCompositedReason);
517 516
518 // FIXME: It would be nice to directly use the layer's compositing reason, 517 // FIXME: It would be nice to directly use the layer's compositing reason,
519 // but allocateOrClearCompositedLayerMapping also gets called without having updated compositing 518 // but allocateOrClearCompositedLayerMapping also gets called without having updated compositing
520 // requirements fully. 519 // requirements fully.
521 if (needsToBeComposited(layer)) { 520 if (needsToBeComposited(layer)) {
522 enableCompositingMode(); 521 enableCompositingMode();
523 522
524 if (!layer->compositedLayerMapping()) { 523 if (!layer->hasCompositedLayerMapping()) {
525 // If we need to repaint, do so before allocating the compositedLaye rMapping 524 // If we need to repaint, do so before allocating the compositedLaye rMapping
526 if (shouldRepaint == CompositingChangeRepaintNow) 525 if (shouldRepaint == CompositingChangeRepaintNow)
527 repaintOnCompositingChange(layer); 526 repaintOnCompositingChange(layer);
528 527
529 layer->ensureCompositedLayerMapping(); 528 layer->ensureCompositedLayerMapping();
530 compositedLayerMappingChanged = true; 529 compositedLayerMappingChanged = true;
531 530
532 // At this time, the ScrollingCooridnator only supports the top-leve l frame. 531 // At this time, the ScrollingCooridnator only supports the top-leve l frame.
533 if (layer->isRootLayer() && !isMainFrame()) { 532 if (layer->isRootLayer() && !isMainFrame()) {
534 if (ScrollingCoordinator* scrollingCoordinator = this->scrolling Coordinator()) 533 if (ScrollingCoordinator* scrollingCoordinator = this->scrolling Coordinator())
535 scrollingCoordinator->frameViewRootLayerDidChange(m_renderVi ew->frameView()); 534 scrollingCoordinator->frameViewRootLayerDidChange(m_renderVi ew->frameView());
536 } 535 }
537 536
538 // This layer and all of its descendants have cached repaints rects that are relative to 537 // This layer and all of its descendants have cached repaints rects that are relative to
539 // the repaint container, so change when compositing changes; we nee d to update them here. 538 // the repaint container, so change when compositing changes; we nee d to update them here.
540 if (layer->parent()) 539 if (layer->parent())
541 layer->repainter().computeRepaintRectsIncludingDescendants(); 540 layer->repainter().computeRepaintRectsIncludingDescendants();
542 } 541 }
543 542
544 if (layer->compositedLayerMapping()->updateRequiresOwnBackingStoreForInt rinsicReasons()) 543 if (layer->compositedLayerMapping()->updateRequiresOwnBackingStoreForInt rinsicReasons())
545 compositedLayerMappingChanged = true; 544 compositedLayerMappingChanged = true;
546 } else { 545 } else {
547 if (layer->compositedLayerMapping()) { 546 if (layer->hasCompositedLayerMapping()) {
548 // If we're removing the compositedLayerMapping from a reflection, c lear the source GraphicsLayer's pointer to 547 // If we're removing the compositedLayerMapping from a reflection, c lear the source GraphicsLayer's pointer to
549 // its replica GraphicsLayer. In practice this should never happen b ecause reflectee and reflection 548 // its replica GraphicsLayer. In practice this should never happen b ecause reflectee and reflection
550 // are both either composited, or not composited. 549 // are both either composited, or not composited.
551 if (layer->isReflection()) { 550 if (layer->isReflection()) {
552 RenderLayer* sourceLayer = toRenderLayerModelObject(layer->rende rer()->parent())->layer(); 551 RenderLayer* sourceLayer = toRenderLayerModelObject(layer->rende rer()->parent())->layer();
553 if (CompositedLayerMapping* compositedLayerMapping = sourceLayer ->compositedLayerMapping()) { 552 if (sourceLayer->hasCompositedLayerMapping()) {
553 CompositedLayerMapping* compositedLayerMapping = sourceLayer ->compositedLayerMapping();
554 ASSERT(compositedLayerMapping->mainGraphicsLayer()->replicaL ayer() == layer->compositedLayerMapping()->mainGraphicsLayer()); 554 ASSERT(compositedLayerMapping->mainGraphicsLayer()->replicaL ayer() == layer->compositedLayerMapping()->mainGraphicsLayer());
555 compositedLayerMapping->mainGraphicsLayer()->setReplicatedBy Layer(0); 555 compositedLayerMapping->mainGraphicsLayer()->setReplicatedBy Layer(0);
556 } 556 }
557 } 557 }
558 558
559 removeViewportConstrainedLayer(layer); 559 removeViewportConstrainedLayer(layer);
560 560
561 layer->clearCompositedLayerMapping(); 561 layer->clearCompositedLayerMapping();
562 compositedLayerMappingChanged = true; 562 compositedLayerMappingChanged = true;
563 563
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 return compositedLayerMappingChanged || nonCompositedReasonChanged; 597 return compositedLayerMappingChanged || nonCompositedReasonChanged;
598 } 598 }
599 599
600 bool RenderLayerCompositor::updateLayerCompositingState(RenderLayer* layer, Comp ositingChangeRepaint shouldRepaint) 600 bool RenderLayerCompositor::updateLayerCompositingState(RenderLayer* layer, Comp ositingChangeRepaint shouldRepaint)
601 { 601 {
602 updateDirectCompositingReasons(layer); 602 updateDirectCompositingReasons(layer);
603 bool layerChanged = allocateOrClearCompositedLayerMapping(layer, shouldRepai nt); 603 bool layerChanged = allocateOrClearCompositedLayerMapping(layer, shouldRepai nt);
604 604
605 // See if we need content or clipping layers. Methods called here should ass ume 605 // See if we need content or clipping layers. Methods called here should ass ume
606 // that the compositing state of descendant layers has not been updated yet. 606 // that the compositing state of descendant layers has not been updated yet.
607 if (layer->compositedLayerMapping() && layer->compositedLayerMapping()->upda teGraphicsLayerConfiguration()) 607 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u pdateGraphicsLayerConfiguration())
608 layerChanged = true; 608 layerChanged = true;
609 609
610 return layerChanged; 610 return layerChanged;
611 } 611 }
612 612
613 void RenderLayerCompositor::repaintOnCompositingChange(RenderLayer* layer) 613 void RenderLayerCompositor::repaintOnCompositingChange(RenderLayer* layer)
614 { 614 {
615 // If the renderer is not attached yet, no need to repaint. 615 // If the renderer is not attached yet, no need to repaint.
616 if (layer->renderer() != m_renderView && !layer->renderer()->parent()) 616 if (layer->renderer() != m_renderView && !layer->renderer()->parent())
617 return; 617 return;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 return layer->calculateLayerBounds(ancestorLayer, 0, flags); 656 return layer->calculateLayerBounds(ancestorLayer, 0, flags);
657 } 657 }
658 658
659 void RenderLayerCompositor::layerWasAdded(RenderLayer* /*parent*/, RenderLayer* /*child*/) 659 void RenderLayerCompositor::layerWasAdded(RenderLayer* /*parent*/, RenderLayer* /*child*/)
660 { 660 {
661 setCompositingLayersNeedRebuild(); 661 setCompositingLayersNeedRebuild();
662 } 662 }
663 663
664 void RenderLayerCompositor::layerWillBeRemoved(RenderLayer* parent, RenderLayer* child) 664 void RenderLayerCompositor::layerWillBeRemoved(RenderLayer* parent, RenderLayer* child)
665 { 665 {
666 if (!child->compositedLayerMapping() || parent->renderer()->documentBeingDes troyed()) 666 if (!child->hasCompositedLayerMapping() || parent->renderer()->documentBeing Destroyed())
667 return; 667 return;
668 668
669 removeViewportConstrainedLayer(child); 669 removeViewportConstrainedLayer(child);
670 repaintInCompositedAncestor(child, child->compositedLayerMapping()->composit edBounds()); 670 repaintInCompositedAncestor(child, child->compositedLayerMapping()->composit edBounds());
671 671
672 setCompositingParent(child, 0); 672 setCompositingParent(child, 0);
673 setCompositingLayersNeedRebuild(); 673 setCompositingLayersNeedRebuild();
674 } 674 }
675 675
676 RenderLayer* RenderLayerCompositor::enclosingNonStackingClippingLayer(const Rend erLayer* layer) const 676 RenderLayer* RenderLayerCompositor::enclosingNonStackingClippingLayer(const Rend erLayer* layer) const
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 973
974 descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DTrans form(); 974 descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DTrans form();
975 975
976 if (overlapMap) 976 if (overlapMap)
977 overlapMap->geometryMap().popMappingsToAncestor(ancestorLayer); 977 overlapMap->geometryMap().popMappingsToAncestor(ancestorLayer);
978 } 978 }
979 979
980 void RenderLayerCompositor::setCompositingParent(RenderLayer* childLayer, Render Layer* parentLayer) 980 void RenderLayerCompositor::setCompositingParent(RenderLayer* childLayer, Render Layer* parentLayer)
981 { 981 {
982 ASSERT(!parentLayer || childLayer->ancestorCompositingLayer() == parentLayer ); 982 ASSERT(!parentLayer || childLayer->ancestorCompositingLayer() == parentLayer );
983 ASSERT(childLayer->compositedLayerMapping()); 983 ASSERT(childLayer->hasCompositedLayerMapping());
984 984
985 // It's possible to be called with a parent that isn't yet composited when w e're doing 985 // It's possible to be called with a parent that isn't yet composited when w e're doing
986 // partial updates as required by painting or hit testing. Just bail in that case; 986 // partial updates as required by painting or hit testing. Just bail in that case;
987 // we'll do a full layer update soon. 987 // we'll do a full layer update soon.
988 if (!parentLayer || !parentLayer->compositedLayerMapping()) 988 if (!parentLayer || !parentLayer->hasCompositedLayerMapping())
989 return; 989 return;
990 990
991 if (parentLayer) { 991 if (parentLayer) {
992 GraphicsLayer* hostingLayer = parentLayer->compositedLayerMapping()->par entForSublayers(); 992 GraphicsLayer* hostingLayer = parentLayer->compositedLayerMapping()->par entForSublayers();
993 GraphicsLayer* hostedLayer = childLayer->compositedLayerMapping()->child ForSuperlayers(); 993 GraphicsLayer* hostedLayer = childLayer->compositedLayerMapping()->child ForSuperlayers();
994 994
995 hostingLayer->addChild(hostedLayer); 995 hostingLayer->addChild(hostedLayer);
996 } else { 996 } else {
997 childLayer->compositedLayerMapping()->childForSuperlayers()->removeFromP arent(); 997 childLayer->compositedLayerMapping()->childForSuperlayers()->removeFromP arent();
998 } 998 }
999 } 999 }
1000 1000
1001 void RenderLayerCompositor::removeCompositedChildren(RenderLayer* layer) 1001 void RenderLayerCompositor::removeCompositedChildren(RenderLayer* layer)
1002 { 1002 {
1003 ASSERT(layer->compositedLayerMapping()); 1003 ASSERT(layer->hasCompositedLayerMapping());
1004 1004
1005 GraphicsLayer* hostingLayer = layer->compositedLayerMapping()->parentForSubl ayers(); 1005 GraphicsLayer* hostingLayer = layer->compositedLayerMapping()->parentForSubl ayers();
1006 hostingLayer->removeAllChildren(); 1006 hostingLayer->removeAllChildren();
1007 } 1007 }
1008 1008
1009 bool RenderLayerCompositor::canAccelerateVideoRendering(RenderVideo* o) const 1009 bool RenderLayerCompositor::canAccelerateVideoRendering(RenderVideo* o) const
1010 { 1010 {
1011 if (!m_hasAcceleratedCompositing) 1011 if (!m_hasAcceleratedCompositing)
1012 return false; 1012 return false;
1013 1013
(...skipping 11 matching lines...) Expand all
1025 // Used for gathering UMA data about the effect on memory usage of promoting all layers 1025 // Used for gathering UMA data about the effect on memory usage of promoting all layers
1026 // that have a webkit-transition on opacity or transform and intersect the v iewport. 1026 // that have a webkit-transition on opacity or transform and intersect the v iewport.
1027 static double pixelsWithoutPromotingAllTransitions = 0.0; 1027 static double pixelsWithoutPromotingAllTransitions = 0.0;
1028 static double pixelsAddedByPromotingAllTransitions = 0.0; 1028 static double pixelsAddedByPromotingAllTransitions = 0.0;
1029 1029
1030 if (!depth) { 1030 if (!depth) {
1031 pixelsWithoutPromotingAllTransitions = 0.0; 1031 pixelsWithoutPromotingAllTransitions = 0.0;
1032 pixelsAddedByPromotingAllTransitions = 0.0; 1032 pixelsAddedByPromotingAllTransitions = 0.0;
1033 } 1033 }
1034 1034
1035 CompositedLayerMapping* currentCompositedLayerMapping = layer->compositedLay erMapping(); 1035 if (layer->hasCompositedLayerMapping()) {
1036 if (currentCompositedLayerMapping) { 1036 CompositedLayerMapping* currentCompositedLayerMapping = layer->composite dLayerMapping();
1037 // The compositing state of all our children has been updated already, s o now 1037 // The compositing state of all our children has been updated already, s o now
1038 // we can compute and cache the composited bounds for this layer. 1038 // we can compute and cache the composited bounds for this layer.
1039 currentCompositedLayerMapping->updateCompositedBounds(); 1039 currentCompositedLayerMapping->updateCompositedBounds();
1040 1040
1041 if (layer->reflectionInfo()) { 1041 if (layer->reflectionInfo()) {
1042 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflectionLa yer(); 1042 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflectionLa yer();
1043 if (reflectionLayer->compositedLayerMapping()) 1043 if (reflectionLayer->hasCompositedLayerMapping())
1044 reflectionLayer->compositedLayerMapping()->updateCompositedBound s(); 1044 reflectionLayer->compositedLayerMapping()->updateCompositedBound s();
1045 } 1045 }
1046 1046
1047 currentCompositedLayerMapping->updateGraphicsLayerConfiguration(); 1047 currentCompositedLayerMapping->updateGraphicsLayerConfiguration();
1048 currentCompositedLayerMapping->updateGraphicsLayerGeometry(); 1048 currentCompositedLayerMapping->updateGraphicsLayerGeometry();
1049 1049
1050 if (!layer->parent()) 1050 if (!layer->parent())
1051 updateRootLayerPosition(); 1051 updateRootLayerPosition();
1052 1052
1053 if (currentCompositedLayerMapping->hasUnpositionedOverflowControlsLayers ()) 1053 if (currentCompositedLayerMapping->hasUnpositionedOverflowControlsLayers ())
1054 layer->scrollableArea()->positionOverflowControls(); 1054 layer->scrollableArea()->positionOverflowControls();
1055 1055
1056 pixelsWithoutPromotingAllTransitions += layer->size().height() * layer-> size().width(); 1056 pixelsWithoutPromotingAllTransitions += layer->size().height() * layer-> size().width();
1057 } else { 1057 } else {
1058 if ((layer->renderer()->style()->transitionForProperty(CSSPropertyOpacit y) || 1058 if ((layer->renderer()->style()->transitionForProperty(CSSPropertyOpacit y) ||
1059 layer->renderer()->style()->transitionForProperty(CSSPropertyWebkit Transform)) && 1059 layer->renderer()->style()->transitionForProperty(CSSPropertyWebkit Transform)) &&
1060 m_renderView->viewRect().intersects(layer->absoluteBoundingBox())) 1060 m_renderView->viewRect().intersects(layer->absoluteBoundingBox()))
1061 pixelsAddedByPromotingAllTransitions += layer->size().height() * lay er->size().width(); 1061 pixelsAddedByPromotingAllTransitions += layer->size().height() * lay er->size().width();
1062 } 1062 }
1063 1063
1064 // If this layer has a compositedLayerMapping, then that is where we place s ubsequent children GraphicsLayers. 1064 // If this layer has a compositedLayerMapping, then that is where we place s ubsequent children GraphicsLayers.
1065 // Otherwise children continue to append to the child list of the enclosing layer. 1065 // Otherwise children continue to append to the child list of the enclosing layer.
1066 Vector<GraphicsLayer*> layerChildren; 1066 Vector<GraphicsLayer*> layerChildren;
1067 Vector<GraphicsLayer*>& childList = currentCompositedLayerMapping ? layerChi ldren : childLayersOfEnclosingLayer; 1067 Vector<GraphicsLayer*>& childList = layer->hasCompositedLayerMapping() ? lay erChildren : childLayersOfEnclosingLayer;
1068 1068
1069 #if !ASSERT_DISABLED 1069 #if !ASSERT_DISABLED
1070 LayerListMutationDetector mutationChecker(layer->stackingNode()); 1070 LayerListMutationDetector mutationChecker(layer->stackingNode());
1071 #endif 1071 #endif
1072 1072
1073 if (layer->stackingNode()->isStackingContainer()) { 1073 if (layer->stackingNode()->isStackingContainer()) {
1074 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), Negativ eZOrderChildren); 1074 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), Negativ eZOrderChildren);
1075 while (RenderLayerStackingNode* curNode = iterator.next()) 1075 while (RenderLayerStackingNode* curNode = iterator.next())
1076 rebuildCompositingLayerTree(curNode->layer(), childList, depth + 1); 1076 rebuildCompositingLayerTree(curNode->layer(), childList, depth + 1);
1077 1077
1078 // If a negative z-order child is compositing, we get a foreground layer which needs to get parented. 1078 // If a negative z-order child is compositing, we get a foreground layer which needs to get parented.
1079 if (currentCompositedLayerMapping && currentCompositedLayerMapping->fore groundLayer()) 1079 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping( )->foregroundLayer())
1080 childList.append(currentCompositedLayerMapping->foregroundLayer()); 1080 childList.append(layer->compositedLayerMapping()->foregroundLayer()) ;
1081 } 1081 }
1082 1082
1083 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC hildren | PositiveZOrderChildren); 1083 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC hildren | PositiveZOrderChildren);
1084 while (RenderLayerStackingNode* curNode = iterator.next()) 1084 while (RenderLayerStackingNode* curNode = iterator.next())
1085 rebuildCompositingLayerTree(curNode->layer(), childList, depth + 1); 1085 rebuildCompositingLayerTree(curNode->layer(), childList, depth + 1);
1086 1086
1087 if (currentCompositedLayerMapping) { 1087 if (layer->hasCompositedLayerMapping()) {
1088 CompositedLayerMapping* currentCompositedLayerMapping = layer->composite dLayerMapping();
1088 bool parented = false; 1089 bool parented = false;
1089 if (layer->renderer()->isRenderPart()) 1090 if (layer->renderer()->isRenderPart())
1090 parented = parentFrameContentLayers(toRenderPart(layer->renderer())) ; 1091 parented = parentFrameContentLayers(toRenderPart(layer->renderer())) ;
1091 1092
1092 if (!parented) 1093 if (!parented)
1093 currentCompositedLayerMapping->parentForSublayers()->setChildren(lay erChildren); 1094 currentCompositedLayerMapping->parentForSublayers()->setChildren(lay erChildren);
1094 1095
1095 // If the layer has a clipping layer the overflow controls layers will b e siblings of the clipping layer. 1096 // If the layer has a clipping layer the overflow controls layers will b e siblings of the clipping layer.
1096 // Otherwise, the overflow control layers are normal children. 1097 // Otherwise, the overflow control layers are normal children.
1097 if (!currentCompositedLayerMapping->hasClippingLayer() && !currentCompos itedLayerMapping->hasScrollingLayer()) { 1098 if (!currentCompositedLayerMapping->hasClippingLayer() && !currentCompos itedLayerMapping->hasScrollingLayer()) {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 return 0; 1261 return 0;
1261 } 1262 }
1262 1263
1263 bool RenderLayerCompositor::parentFrameContentLayers(RenderPart* renderer) 1264 bool RenderLayerCompositor::parentFrameContentLayers(RenderPart* renderer)
1264 { 1265 {
1265 RenderLayerCompositor* innerCompositor = frameContentsCompositor(renderer); 1266 RenderLayerCompositor* innerCompositor = frameContentsCompositor(renderer);
1266 if (!innerCompositor || !innerCompositor->inCompositingMode() || innerCompos itor->rootLayerAttachment() != RootLayerAttachedViaEnclosingFrame) 1267 if (!innerCompositor || !innerCompositor->inCompositingMode() || innerCompos itor->rootLayerAttachment() != RootLayerAttachedViaEnclosingFrame)
1267 return false; 1268 return false;
1268 1269
1269 RenderLayer* layer = renderer->layer(); 1270 RenderLayer* layer = renderer->layer();
1270 if (!layer->compositedLayerMapping()) 1271 if (!layer->hasCompositedLayerMapping())
1271 return false; 1272 return false;
1272 1273
1273 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMappi ng(); 1274 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMappi ng();
1274 GraphicsLayer* hostingLayer = compositedLayerMapping->parentForSublayers(); 1275 GraphicsLayer* hostingLayer = compositedLayerMapping->parentForSublayers();
1275 GraphicsLayer* rootLayer = innerCompositor->rootGraphicsLayer(); 1276 GraphicsLayer* rootLayer = innerCompositor->rootGraphicsLayer();
1276 if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != r ootLayer) { 1277 if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != r ootLayer) {
1277 hostingLayer->removeAllChildren(); 1278 hostingLayer->removeAllChildren();
1278 hostingLayer->addChild(rootLayer); 1279 hostingLayer->addChild(rootLayer);
1279 } 1280 }
1280 return true; 1281 return true;
1281 } 1282 }
1282 1283
1283 // This just updates layer geometry without changing the hierarchy. 1284 // This just updates layer geometry without changing the hierarchy.
1284 void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer* layer) 1285 void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer* layer)
1285 { 1286 {
1286 if (CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerM apping()) { 1287 if (layer->hasCompositedLayerMapping()) {
1288 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerM apping();
1287 // The compositing state of all our children has been updated already, s o now 1289 // The compositing state of all our children has been updated already, s o now
1288 // we can compute and cache the composited bounds for this layer. 1290 // we can compute and cache the composited bounds for this layer.
1289 compositedLayerMapping->updateCompositedBounds(); 1291 compositedLayerMapping->updateCompositedBounds();
1290 1292
1291 if (layer->reflectionInfo()) { 1293 if (layer->reflectionInfo()) {
1292 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflectionLa yer(); 1294 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflectionLa yer();
1293 if (reflectionLayer->compositedLayerMapping()) 1295 if (reflectionLayer->hasCompositedLayerMapping())
1294 reflectionLayer->compositedLayerMapping()->updateCompositedBound s(); 1296 reflectionLayer->compositedLayerMapping()->updateCompositedBound s();
1295 } 1297 }
1296 1298
1297 compositedLayerMapping->updateGraphicsLayerConfiguration(); 1299 compositedLayerMapping->updateGraphicsLayerConfiguration();
1298 compositedLayerMapping->updateGraphicsLayerGeometry(); 1300 compositedLayerMapping->updateGraphicsLayerGeometry();
1299 1301
1300 if (!layer->parent()) 1302 if (!layer->parent())
1301 updateRootLayerPosition(); 1303 updateRootLayerPosition();
1302 } 1304 }
1303 1305
1304 #if !ASSERT_DISABLED 1306 #if !ASSERT_DISABLED
1305 LayerListMutationDetector mutationChecker(layer->stackingNode()); 1307 LayerListMutationDetector mutationChecker(layer->stackingNode());
1306 #endif 1308 #endif
1307 1309
1308 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), AllChildren ); 1310 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), AllChildren );
1309 while (RenderLayerStackingNode* curNode = iterator.next()) 1311 while (RenderLayerStackingNode* curNode = iterator.next())
1310 updateLayerTreeGeometry(curNode->layer()); 1312 updateLayerTreeGeometry(curNode->layer());
1311 } 1313 }
1312 1314
1313 // Recurs down the RenderLayer tree until its finds the compositing descendants of compositingAncestor and updates their geometry. 1315 // Recurs down the RenderLayer tree until its finds the compositing descendants of compositingAncestor and updates their geometry.
1314 void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayerStack ingNode* compositingAncestor, RenderLayer* layer, bool compositedChildrenOnly) 1316 void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayerStack ingNode* compositingAncestor, RenderLayer* layer, bool compositedChildrenOnly)
1315 { 1317 {
1316 if (layer->stackingNode() != compositingAncestor) { 1318 if (layer->stackingNode() != compositingAncestor && layer->hasCompositedLaye rMapping()) {
1317 if (CompositedLayerMapping* compositedLayerMapping = layer->compositedLa yerMapping()) { 1319 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerM apping();
1318 compositedLayerMapping->updateCompositedBounds(); 1320 compositedLayerMapping->updateCompositedBounds();
1319 1321
1320 if (layer->reflectionInfo()) { 1322 if (layer->reflectionInfo()) {
1321 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflecti onLayer(); 1323 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflectionLa yer();
1322 if (reflectionLayer->compositedLayerMapping()) 1324 if (reflectionLayer->hasCompositedLayerMapping())
1323 reflectionLayer->compositedLayerMapping()->updateCompositedB ounds(); 1325 reflectionLayer->compositedLayerMapping()->updateCompositedBound s();
1324 } 1326 }
1325 1327
1326 compositedLayerMapping->updateGraphicsLayerGeometry(); 1328 compositedLayerMapping->updateGraphicsLayerGeometry();
1327 if (compositedChildrenOnly) 1329 if (compositedChildrenOnly)
1328 return; 1330 return;
1329 }
1330 } 1331 }
1331 1332
1332 if (layer->reflectionInfo()) 1333 if (layer->reflectionInfo())
1333 updateCompositingDescendantGeometry(compositingAncestor, layer->reflecti onInfo()->reflectionLayer(), compositedChildrenOnly); 1334 updateCompositingDescendantGeometry(compositingAncestor, layer->reflecti onInfo()->reflectionLayer(), compositedChildrenOnly);
1334 1335
1335 if (!layer->hasCompositingDescendant()) 1336 if (!layer->hasCompositingDescendant())
1336 return; 1337 return;
1337 1338
1338 #if !ASSERT_DISABLED 1339 #if !ASSERT_DISABLED
1339 LayerListMutationDetector mutationChecker(layer->stackingNode()); 1340 LayerListMutationDetector mutationChecker(layer->stackingNode());
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 1414
1414 detachRootLayer(); 1415 detachRootLayer();
1415 } 1416 }
1416 } 1417 }
1417 1418
1418 void RenderLayerCompositor::clearMappingForRenderLayerIncludingDescendants(Rende rLayer* layer) 1419 void RenderLayerCompositor::clearMappingForRenderLayerIncludingDescendants(Rende rLayer* layer)
1419 { 1420 {
1420 if (!layer) 1421 if (!layer)
1421 return; 1422 return;
1422 1423
1423 if (layer->compositedLayerMapping()) { 1424 if (layer->hasCompositedLayerMapping()) {
1424 removeViewportConstrainedLayer(layer); 1425 removeViewportConstrainedLayer(layer);
1425 layer->clearCompositedLayerMapping(); 1426 layer->clearCompositedLayerMapping();
1426 } 1427 }
1427 1428
1428 for (RenderLayer* currLayer = layer->firstChild(); currLayer; currLayer = cu rrLayer->nextSibling()) 1429 for (RenderLayer* currLayer = layer->firstChild(); currLayer; currLayer = cu rrLayer->nextSibling())
1429 clearMappingForRenderLayerIncludingDescendants(currLayer); 1430 clearMappingForRenderLayerIncludingDescendants(currLayer);
1430 } 1431 }
1431 1432
1432 void RenderLayerCompositor::clearMappingForAllRenderLayers() 1433 void RenderLayerCompositor::clearMappingForAllRenderLayers()
1433 { 1434 {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 return directReasons; 1526 return directReasons;
1526 } 1527 }
1527 1528
1528 // Return true if the given layer has some ancestor in the RenderLayer hierarchy that clips, 1529 // Return true if the given layer has some ancestor in the RenderLayer hierarchy that clips,
1529 // up to the enclosing compositing ancestor. This is required because compositin g layers are parented 1530 // up to the enclosing compositing ancestor. This is required because compositin g layers are parented
1530 // according to the z-order hierarchy, yet clipping goes down the renderer hiera rchy. 1531 // according to the z-order hierarchy, yet clipping goes down the renderer hiera rchy.
1531 // Thus, a RenderLayer can be clipped by a RenderLayer that is an ancestor in th e renderer hierarchy, 1532 // Thus, a RenderLayer can be clipped by a RenderLayer that is an ancestor in th e renderer hierarchy,
1532 // but a sibling in the z-order hierarchy. 1533 // but a sibling in the z-order hierarchy.
1533 bool RenderLayerCompositor::clippedByAncestor(const RenderLayer* layer) const 1534 bool RenderLayerCompositor::clippedByAncestor(const RenderLayer* layer) const
1534 { 1535 {
1535 if (!layer->compositedLayerMapping() || !layer->parent()) 1536 if (!layer->hasCompositedLayerMapping() || !layer->parent())
1536 return false; 1537 return false;
1537 1538
1538 const RenderLayer* compositingAncestor = layer->ancestorCompositingLayer(); 1539 const RenderLayer* compositingAncestor = layer->ancestorCompositingLayer();
1539 if (!compositingAncestor) 1540 if (!compositingAncestor)
1540 return false; 1541 return false;
1541 1542
1542 // If the compositingAncestor clips, that will be taken care of by clipsComp ositingDescendants(), 1543 // If the compositingAncestor clips, that will be taken care of by clipsComp ositingDescendants(),
1543 // so we only care about clipping between its first child that is our ancest or (the computeClipRoot), 1544 // so we only care about clipping between its first child that is our ancest or (the computeClipRoot),
1544 // and layer. 1545 // and layer.
1545 const RenderLayer* computeClipRoot = 0; 1546 const RenderLayer* computeClipRoot = 0;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 bool composite = renderer->isEmbeddedObject() && toRenderEmbeddedObject(rend erer)->allowsAcceleratedCompositing(); 1631 bool composite = renderer->isEmbeddedObject() && toRenderEmbeddedObject(rend erer)->allowsAcceleratedCompositing();
1631 if (!composite) 1632 if (!composite)
1632 return false; 1633 return false;
1633 1634
1634 // FIXME: this seems bogus. If we don't know the layout position/size of the plugin yet, would't that be handled elsewhere? 1635 // FIXME: this seems bogus. If we don't know the layout position/size of the plugin yet, would't that be handled elsewhere?
1635 m_needsToRecomputeCompositingRequirements = true; 1636 m_needsToRecomputeCompositingRequirements = true;
1636 1637
1637 RenderWidget* pluginRenderer = toRenderWidget(renderer); 1638 RenderWidget* pluginRenderer = toRenderWidget(renderer);
1638 // If we can't reliably know the size of the plugin yet, don't change compos iting state. 1639 // If we can't reliably know the size of the plugin yet, don't change compos iting state.
1639 if (pluginRenderer->needsLayout()) 1640 if (pluginRenderer->needsLayout())
1640 return pluginRenderer->hasLayer() && pluginRenderer->layer()->composited LayerMapping(); 1641 return pluginRenderer->hasLayer() && pluginRenderer->layer()->hasComposi tedLayerMapping();
1641 1642
1642 // Don't go into compositing mode if height or width are zero, or size is 1x 1. 1643 // Don't go into compositing mode if height or width are zero, or size is 1x 1.
1643 IntRect contentBox = pixelSnappedIntRect(pluginRenderer->contentBoxRect()); 1644 IntRect contentBox = pixelSnappedIntRect(pluginRenderer->contentBoxRect());
1644 return contentBox.height() * contentBox.width() > 1; 1645 return contentBox.height() * contentBox.width() > 1;
1645 } 1646 }
1646 1647
1647 bool RenderLayerCompositor::requiresCompositingForFrame(RenderObject* renderer) const 1648 bool RenderLayerCompositor::requiresCompositingForFrame(RenderObject* renderer) const
1648 { 1649 {
1649 if (!renderer->isRenderPart()) 1650 if (!renderer->isRenderPart())
1650 return false; 1651 return false;
1651 1652
1652 RenderPart* frameRenderer = toRenderPart(renderer); 1653 RenderPart* frameRenderer = toRenderPart(renderer);
1653 1654
1654 if (!frameRenderer->requiresAcceleratedCompositing()) 1655 if (!frameRenderer->requiresAcceleratedCompositing())
1655 return false; 1656 return false;
1656 1657
1657 // FIXME: this seems bogus. If we don't know the layout position/size of the frame yet, wouldn't that be handled elsehwere? 1658 // FIXME: this seems bogus. If we don't know the layout position/size of the frame yet, wouldn't that be handled elsehwere?
1658 m_needsToRecomputeCompositingRequirements = true; 1659 m_needsToRecomputeCompositingRequirements = true;
1659 1660
1660 RenderLayerCompositor* innerCompositor = frameContentsCompositor(frameRender er); 1661 RenderLayerCompositor* innerCompositor = frameContentsCompositor(frameRender er);
1661 if (!innerCompositor) 1662 if (!innerCompositor)
1662 return false; 1663 return false;
1663 1664
1664 // If we can't reliably know the size of the iframe yet, don't change compos iting state. 1665 // If we can't reliably know the size of the iframe yet, don't change compos iting state.
1665 if (renderer->needsLayout()) 1666 if (renderer->needsLayout())
1666 return frameRenderer->hasLayer() && frameRenderer->layer()->compositedLa yerMapping(); 1667 return frameRenderer->hasLayer() && frameRenderer->layer()->hasComposite dLayerMapping();
1667 1668
1668 // Don't go into compositing mode if height or width are zero. 1669 // Don't go into compositing mode if height or width are zero.
1669 IntRect contentBox = pixelSnappedIntRect(frameRenderer->contentBoxRect()); 1670 IntRect contentBox = pixelSnappedIntRect(frameRenderer->contentBoxRect());
1670 return contentBox.height() * contentBox.width() > 0; 1671 return contentBox.height() * contentBox.width() > 0;
1671 } 1672 }
1672 1673
1673 bool RenderLayerCompositor::requiresCompositingForBackfaceVisibilityHidden(Rende rObject* renderer) const 1674 bool RenderLayerCompositor::requiresCompositingForBackfaceVisibilityHidden(Rende rObject* renderer) const
1674 { 1675 {
1675 return canRender3DTransforms() && renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden; 1676 return canRender3DTransforms() && renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden;
1676 } 1677 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 1827
1827 if (!hasScrollableAncestor) { 1828 if (!hasScrollableAncestor) {
1828 if (viewportConstrainedNotCompositedReason) 1829 if (viewportConstrainedNotCompositedReason)
1829 *viewportConstrainedNotCompositedReason = RenderLayer::NotComposited ForUnscrollableAncestors; 1830 *viewportConstrainedNotCompositedReason = RenderLayer::NotComposited ForUnscrollableAncestors;
1830 return false; 1831 return false;
1831 } 1832 }
1832 1833
1833 // Subsequent tests depend on layout. If we can't tell now, just keep things the way they are until layout is done. 1834 // Subsequent tests depend on layout. If we can't tell now, just keep things the way they are until layout is done.
1834 if (!m_inPostLayoutUpdate) { 1835 if (!m_inPostLayoutUpdate) {
1835 m_needsToRecomputeCompositingRequirements = true; 1836 m_needsToRecomputeCompositingRequirements = true;
1836 return layer->compositedLayerMapping(); 1837 return layer->hasCompositedLayerMapping();
1837 } 1838 }
1838 1839
1839 bool paintsContent = layer->isVisuallyNonEmpty() || layer->hasVisibleDescend ant(); 1840 bool paintsContent = layer->isVisuallyNonEmpty() || layer->hasVisibleDescend ant();
1840 if (!paintsContent) { 1841 if (!paintsContent) {
1841 if (viewportConstrainedNotCompositedReason) 1842 if (viewportConstrainedNotCompositedReason)
1842 *viewportConstrainedNotCompositedReason = RenderLayer::NotComposited ForNoVisibleContent; 1843 *viewportConstrainedNotCompositedReason = RenderLayer::NotComposited ForNoVisibleContent;
1843 return false; 1844 return false;
1844 } 1845 }
1845 1846
1846 // Fixed position elements that are invisible in the current view don't get their own layer. 1847 // Fixed position elements that are invisible in the current view don't get their own layer.
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2312 2313
2313 static bool isRootmostFixedOrStickyLayer(RenderLayer* layer) 2314 static bool isRootmostFixedOrStickyLayer(RenderLayer* layer)
2314 { 2315 {
2315 if (layer->renderer()->isStickyPositioned()) 2316 if (layer->renderer()->isStickyPositioned())
2316 return true; 2317 return true;
2317 2318
2318 if (layer->renderer()->style()->position() != FixedPosition) 2319 if (layer->renderer()->style()->position() != FixedPosition)
2319 return false; 2320 return false;
2320 2321
2321 for (RenderLayerStackingNode* stackingContainerNode = layer->stackingNode()- >ancestorStackingContainerNode(); stackingContainerNode; stackingContainerNode = stackingContainerNode->ancestorStackingContainerNode()) { 2322 for (RenderLayerStackingNode* stackingContainerNode = layer->stackingNode()- >ancestorStackingContainerNode(); stackingContainerNode; stackingContainerNode = stackingContainerNode->ancestorStackingContainerNode()) {
2322 if (stackingContainerNode->layer()->compositedLayerMapping() && stacking ContainerNode->layer()->renderer()->style()->position() == FixedPosition) 2323 if (stackingContainerNode->layer()->hasCompositedLayerMapping() && stack ingContainerNode->layer()->renderer()->style()->position() == FixedPosition)
2323 return false; 2324 return false;
2324 } 2325 }
2325 2326
2326 return true; 2327 return true;
2327 } 2328 }
2328 2329
2329 void RenderLayerCompositor::updateViewportConstraintStatus(RenderLayer* layer) 2330 void RenderLayerCompositor::updateViewportConstraintStatus(RenderLayer* layer)
2330 { 2331 {
2331 if (isRootmostFixedOrStickyLayer(layer)) 2332 if (isRootmostFixedOrStickyLayer(layer))
2332 addViewportConstrainedLayer(layer); 2333 addViewportConstrainedLayer(layer);
2333 else 2334 else
2334 removeViewportConstrainedLayer(layer); 2335 removeViewportConstrainedLayer(layer);
2335 } 2336 }
2336 2337
2337 void RenderLayerCompositor::addViewportConstrainedLayer(RenderLayer* layer) 2338 void RenderLayerCompositor::addViewportConstrainedLayer(RenderLayer* layer)
2338 { 2339 {
2339 m_viewportConstrainedLayers.add(layer); 2340 m_viewportConstrainedLayers.add(layer);
2340 } 2341 }
2341 2342
2342 void RenderLayerCompositor::removeViewportConstrainedLayer(RenderLayer* layer) 2343 void RenderLayerCompositor::removeViewportConstrainedLayer(RenderLayer* layer)
2343 { 2344 {
2344 if (!m_viewportConstrainedLayers.contains(layer)) 2345 if (!m_viewportConstrainedLayers.contains(layer))
2345 return; 2346 return;
2346 2347
2347 m_viewportConstrainedLayers.remove(layer); 2348 m_viewportConstrainedLayers.remove(layer);
2348 } 2349 }
2349 2350
2350 FixedPositionViewportConstraints RenderLayerCompositor::computeFixedViewportCons traints(RenderLayer* layer) const 2351 FixedPositionViewportConstraints RenderLayerCompositor::computeFixedViewportCons traints(RenderLayer* layer) const
2351 { 2352 {
2352 ASSERT(layer->compositedLayerMapping()); 2353 ASSERT(layer->hasCompositedLayerMapping());
2353 2354
2354 FrameView* frameView = m_renderView->frameView(); 2355 FrameView* frameView = m_renderView->frameView();
2355 LayoutRect viewportRect = frameView->viewportConstrainedVisibleContentRect() ; 2356 LayoutRect viewportRect = frameView->viewportConstrainedVisibleContentRect() ;
2356 2357
2357 FixedPositionViewportConstraints constraints; 2358 FixedPositionViewportConstraints constraints;
2358 2359
2359 GraphicsLayer* graphicsLayer = layer->compositedLayerMapping()->mainGraphics Layer(); 2360 GraphicsLayer* graphicsLayer = layer->compositedLayerMapping()->mainGraphics Layer();
2360 2361
2361 constraints.setLayerPositionAtLastLayout(graphicsLayer->position()); 2362 constraints.setLayerPositionAtLastLayout(graphicsLayer->position());
2362 constraints.setViewportRectAtLastLayout(viewportRect); 2363 constraints.setViewportRectAtLastLayout(viewportRect);
(...skipping 17 matching lines...) Expand all
2380 2381
2381 // If top and bottom are auto, use top. 2382 // If top and bottom are auto, use top.
2382 if (style->top().isAuto() && style->bottom().isAuto()) 2383 if (style->top().isAuto() && style->bottom().isAuto())
2383 constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeTop); 2384 constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeTop);
2384 2385
2385 return constraints; 2386 return constraints;
2386 } 2387 }
2387 2388
2388 StickyPositionViewportConstraints RenderLayerCompositor::computeStickyViewportCo nstraints(RenderLayer* layer) const 2389 StickyPositionViewportConstraints RenderLayerCompositor::computeStickyViewportCo nstraints(RenderLayer* layer) const
2389 { 2390 {
2390 ASSERT(layer->compositedLayerMapping()); 2391 ASSERT(layer->hasCompositedLayerMapping());
2391 2392
2392 FrameView* frameView = m_renderView->frameView(); 2393 FrameView* frameView = m_renderView->frameView();
2393 LayoutRect viewportRect = frameView->viewportConstrainedVisibleContentRect() ; 2394 LayoutRect viewportRect = frameView->viewportConstrainedVisibleContentRect() ;
2394 2395
2395 StickyPositionViewportConstraints constraints; 2396 StickyPositionViewportConstraints constraints;
2396 2397
2397 RenderBoxModelObject* renderer = toRenderBoxModelObject(layer->renderer()); 2398 RenderBoxModelObject* renderer = toRenderBoxModelObject(layer->renderer());
2398 2399
2399 renderer->computeStickyPositionConstraints(constraints, viewportRect); 2400 renderer->computeStickyPositionConstraints(constraints, viewportRect);
2400 2401
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2448 } else if (graphicsLayer == m_scrollLayer.get()) { 2449 } else if (graphicsLayer == m_scrollLayer.get()) {
2449 name = "Frame Scrolling Layer"; 2450 name = "Frame Scrolling Layer";
2450 } else { 2451 } else {
2451 ASSERT_NOT_REACHED(); 2452 ASSERT_NOT_REACHED();
2452 } 2453 }
2453 2454
2454 return name; 2455 return name;
2455 } 2456 }
2456 2457
2457 } // namespace WebCore 2458 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderLayerModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698