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

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

Issue 270633003: Remove RenderLayerCompositor::m_viewportConstrainedLayers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 // its replica GraphicsLayer. In practice this should never happen b ecause reflectee and reflection 539 // its replica GraphicsLayer. In practice this should never happen b ecause reflectee and reflection
540 // are both either composited, or not composited. 540 // are both either composited, or not composited.
541 if (layer->isReflection()) { 541 if (layer->isReflection()) {
542 RenderLayer* sourceLayer = toRenderLayerModelObject(layer->rende rer()->parent())->layer(); 542 RenderLayer* sourceLayer = toRenderLayerModelObject(layer->rende rer()->parent())->layer();
543 if (sourceLayer->hasCompositedLayerMapping()) { 543 if (sourceLayer->hasCompositedLayerMapping()) {
544 ASSERT(sourceLayer->compositedLayerMapping()->mainGraphicsLa yer()->replicaLayer() == layer->compositedLayerMapping()->mainGraphicsLayer()); 544 ASSERT(sourceLayer->compositedLayerMapping()->mainGraphicsLa yer()->replicaLayer() == layer->compositedLayerMapping()->mainGraphicsLayer());
545 sourceLayer->compositedLayerMapping()->mainGraphicsLayer()-> setReplicatedByLayer(0); 545 sourceLayer->compositedLayerMapping()->mainGraphicsLayer()-> setReplicatedByLayer(0);
546 } 546 }
547 } 547 }
548 548
549 removeViewportConstrainedLayer(layer);
550
551 layer->clearCompositedLayerMapping(); 549 layer->clearCompositedLayerMapping();
552 compositedLayerMappingChanged = true; 550 compositedLayerMappingChanged = true;
553 551
554 // This layer and all of its descendants have cached repaints rects that are relative to 552 // This layer and all of its descendants have cached repaints rects that are relative to
555 // the repaint container, so change when compositing changes; we nee d to update them here. 553 // the repaint container, so change when compositing changes; we nee d to update them here.
556 layer->repainter().computeRepaintRectsIncludingDescendants(); 554 layer->repainter().computeRepaintRectsIncludingDescendants();
557 555
558 // If we need to repaint, do so now that we've removed the composite dLayerMapping 556 // If we need to repaint, do so now that we've removed the composite dLayerMapping
559 repaintOnCompositingChange(layer); 557 repaintOnCompositingChange(layer);
560 } 558 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 void RenderLayerCompositor::layerWasAdded(RenderLayer* /*parent*/, RenderLayer* /*child*/) 650 void RenderLayerCompositor::layerWasAdded(RenderLayer* /*parent*/, RenderLayer* /*child*/)
653 { 651 {
654 setCompositingLayersNeedRebuild(); 652 setCompositingLayersNeedRebuild();
655 } 653 }
656 654
657 void RenderLayerCompositor::layerWillBeRemoved(RenderLayer* parent, RenderLayer* child) 655 void RenderLayerCompositor::layerWillBeRemoved(RenderLayer* parent, RenderLayer* child)
658 { 656 {
659 if (!child->hasCompositedLayerMapping() || parent->renderer()->documentBeing Destroyed()) 657 if (!child->hasCompositedLayerMapping() || parent->renderer()->documentBeing Destroyed())
660 return; 658 return;
661 659
662 removeViewportConstrainedLayer(child);
663
664 { 660 {
665 // FIXME: This is called from within RenderLayer::removeChild, which is called from RenderObject::RemoveChild. 661 // FIXME: This is called from within RenderLayer::removeChild, which is called from RenderObject::RemoveChild.
666 // There's no guarantee that compositor state is up to date. 662 // There's no guarantee that compositor state is up to date.
667 DisableCompositingQueryAsserts disabler; 663 DisableCompositingQueryAsserts disabler;
668 repaintInCompositedAncestor(child, child->compositedLayerMapping()->comp ositedBounds()); 664 repaintInCompositedAncestor(child, child->compositedLayerMapping()->comp ositedBounds());
669 } 665 }
670 666
671 setCompositingParent(child, 0); 667 setCompositingParent(child, 0);
672 setCompositingLayersNeedRebuild(); 668 setCompositingLayersNeedRebuild();
673 } 669 }
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 1394
1399 // Compositing also affects the answer to RenderIFrame::requiresAcceleratedC ompositing(), so 1395 // Compositing also affects the answer to RenderIFrame::requiresAcceleratedC ompositing(), so
1400 // we need to schedule a style recalc in our parent document. 1396 // we need to schedule a style recalc in our parent document.
1401 if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerEleme nt()) { 1397 if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerEleme nt()) {
1402 ownerElement->document().renderView()->compositor()->setNeedsToRecompute CompositingRequirements(); 1398 ownerElement->document().renderView()->compositor()->setNeedsToRecompute CompositingRequirements();
1403 DeprecatedScheduleStyleRecalcDuringCompositingUpdate marker(ownerElement ->document().lifecycle()); 1399 DeprecatedScheduleStyleRecalcDuringCompositingUpdate marker(ownerElement ->document().lifecycle());
1404 ownerElement->scheduleLayerUpdate(); 1400 ownerElement->scheduleLayerUpdate();
1405 } 1401 }
1406 } 1402 }
1407 1403
1408 void RenderLayerCompositor::updateViewportConstraintStatus(RenderLayer* layer)
1409 {
1410 if (CompositingReasonFinder::isViewportConstrainedFixedOrStickyLayer(layer))
1411 addViewportConstrainedLayer(layer);
1412 else
1413 removeViewportConstrainedLayer(layer);
1414 }
1415
1416 void RenderLayerCompositor::addViewportConstrainedLayer(RenderLayer* layer)
1417 {
1418 m_viewportConstrainedLayers.add(layer);
1419 }
1420
1421 void RenderLayerCompositor::removeViewportConstrainedLayer(RenderLayer* layer)
1422 {
1423 m_viewportConstrainedLayers.remove(layer);
1424 }
1425
1426 ScrollingCoordinator* RenderLayerCompositor::scrollingCoordinator() const 1404 ScrollingCoordinator* RenderLayerCompositor::scrollingCoordinator() const
1427 { 1405 {
1428 if (Page* page = this->page()) 1406 if (Page* page = this->page())
1429 return page->scrollingCoordinator(); 1407 return page->scrollingCoordinator();
1430 1408
1431 return 0; 1409 return 0;
1432 } 1410 }
1433 1411
1434 GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const 1412 GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const
1435 { 1413 {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 } else if (graphicsLayer == m_scrollLayer.get()) { 1450 } else if (graphicsLayer == m_scrollLayer.get()) {
1473 name = "LocalFrame Scrolling Layer"; 1451 name = "LocalFrame Scrolling Layer";
1474 } else { 1452 } else {
1475 ASSERT_NOT_REACHED(); 1453 ASSERT_NOT_REACHED();
1476 } 1454 }
1477 1455
1478 return name; 1456 return name;
1479 } 1457 }
1480 1458
1481 } // namespace WebCore 1459 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698