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

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

Issue 24921002: Make compositingState explicit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ready for review Created 7 years, 2 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) 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 m_backing->contentChanged(changeType); 240 m_backing->contentChanged(changeType);
241 } 241 }
242 242
243 bool RenderLayer::canRender3DTransforms() const 243 bool RenderLayer::canRender3DTransforms() const
244 { 244 {
245 return compositor()->canRender3DTransforms(); 245 return compositor()->canRender3DTransforms();
246 } 246 }
247 247
248 bool RenderLayer::paintsWithFilters() const 248 bool RenderLayer::paintsWithFilters() const
249 { 249 {
250 // FIXME: Eventually there will be more factors than isComposited() to decid e whether or not to render the filter
251 if (!renderer()->hasFilter()) 250 if (!renderer()->hasFilter())
252 return false; 251 return false;
253 252
254 if (!isComposited()) 253 // FIXME: shouldn't we return true if this layer has a backing but paints in to its ancestor?
Ian Vollick 2013/10/01 19:46:22 Whatever we decide for paintsWithTransparency, the
shawnsingh 2013/10/03 03:04:04 done.
254 if (!backing())
255 return true; 255 return true;
256 256
257 if (!m_backing || !m_backing->canCompositeFilters()) 257 if (!m_backing || !m_backing->canCompositeFilters())
258 return true; 258 return true;
259 259
260 return false; 260 return false;
261 } 261 }
262 262
263 bool RenderLayer::requiresFullLayerImageForFilters() const 263 bool RenderLayer::requiresFullLayerImageForFilters() const
264 { 264 {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 clearRepaintRects(); 359 clearRepaintRects();
360 360
361 m_repaintStatus = NeedsNormalRepaint; 361 m_repaintStatus = NeedsNormalRepaint;
362 362
363 // Go ahead and update the reflection's position and size. 363 // Go ahead and update the reflection's position and size.
364 if (m_reflection) 364 if (m_reflection)
365 m_reflection->layout(); 365 m_reflection->layout();
366 366
367 // Clear the IsCompositingUpdateRoot flag once we've found the first composi ting layer in this update. 367 // Clear the IsCompositingUpdateRoot flag once we've found the first composi ting layer in this update.
368 bool isUpdateRoot = (flags & IsCompositingUpdateRoot); 368 bool isUpdateRoot = (flags & IsCompositingUpdateRoot);
369 if (isComposited()) 369 if (backing())
370 flags &= ~IsCompositingUpdateRoot; 370 flags &= ~IsCompositingUpdateRoot;
371 371
372 if (useRegionBasedColumns() && renderer()->isInFlowRenderFlowThread()) { 372 if (useRegionBasedColumns() && renderer()->isInFlowRenderFlowThread()) {
373 updatePagination(); 373 updatePagination();
374 flags |= UpdatePagination; 374 flags |= UpdatePagination;
375 } 375 }
376 376
377 if (renderer()->hasColumns()) 377 if (renderer()->hasColumns())
378 flags |= UpdatePagination; 378 flags |= UpdatePagination;
379 379
380 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) 380 for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
381 child->updateLayerPositions(geometryMap, flags); 381 child->updateLayerPositions(geometryMap, flags);
382 382
383 if ((flags & UpdateCompositingLayers) && isComposited()) { 383 if ((flags & UpdateCompositingLayers) && backing()) {
384 RenderLayerBacking::UpdateAfterLayoutFlags updateFlags = RenderLayerBack ing::CompositingChildrenOnly; 384 RenderLayerBacking::UpdateAfterLayoutFlags updateFlags = RenderLayerBack ing::CompositingChildrenOnly;
385 if (flags & NeedsFullRepaintInBacking) 385 if (flags & NeedsFullRepaintInBacking)
386 updateFlags |= RenderLayerBacking::NeedsFullRepaint; 386 updateFlags |= RenderLayerBacking::NeedsFullRepaint;
387 if (isUpdateRoot) 387 if (isUpdateRoot)
388 updateFlags |= RenderLayerBacking::IsUpdateRoot; 388 updateFlags |= RenderLayerBacking::IsUpdateRoot;
389 backing()->updateAfterLayout(updateFlags); 389 backing()->updateAfterLayout(updateFlags);
390 } 390 }
391 391
392 if (geometryMap) 392 if (geometryMap)
393 geometryMap->popMappingsToAncestor(parent()); 393 geometryMap->popMappingsToAncestor(parent());
394 } 394 }
395 395
396 LayoutRect RenderLayer::repaintRectIncludingNonCompositingDescendants() const 396 LayoutRect RenderLayer::repaintRectIncludingNonCompositingDescendants() const
397 { 397 {
398 LayoutRect repaintRect = m_repaintRect; 398 LayoutRect repaintRect = m_repaintRect;
399 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) { 399 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
400 // Don't include repaint rects for composited child layers; they will pa int themselves and have a different origin. 400 // Don't include repaint rects for composited child layers; they will pa int themselves and have a different origin.
401 if (child->isComposited()) 401 if (child->backing())
402 continue; 402 continue;
403 403
404 repaintRect.unite(child->repaintRectIncludingNonCompositingDescendants() ); 404 repaintRect.unite(child->repaintRectIncludingNonCompositingDescendants() );
405 } 405 }
406 return repaintRect; 406 return repaintRect;
407 } 407 }
408 408
409 void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant() 409 void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant()
410 { 410 {
411 for (RenderLayer* layer = this; layer; layer = layer->parent()) { 411 for (RenderLayer* layer = this; layer; layer = layer->parent()) {
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 { 928 {
929 const Settings* settings = renderer()->document().settings(); 929 const Settings* settings = renderer()->document().settings();
930 return settings && settings->regionBasedColumnsEnabled(); 930 return settings && settings->regionBasedColumnsEnabled();
931 } 931 }
932 932
933 void RenderLayer::updatePagination() 933 void RenderLayer::updatePagination()
934 { 934 {
935 m_isPaginated = false; 935 m_isPaginated = false;
936 m_enclosingPaginationLayer = 0; 936 m_enclosingPaginationLayer = 0;
937 937
938 if (isComposited() || !parent()) 938 if (backing() || !parent())
939 return; // FIXME: We will have to deal with paginated compositing layers someday. 939 return; // FIXME: We will have to deal with paginated compositing layers someday.
940 // FIXME: For now the RenderView can't be paginated. Eventually printing will move to a model where it is though. 940 // FIXME: For now the RenderView can't be paginated. Eventually printing will move to a model where it is though.
941 941
942 // The main difference between the paginated booleans for the old column cod e and the new column code 942 // The main difference between the paginated booleans for the old column cod e and the new column code
943 // is that each paginated layer has to paint on its own with the new code. T here is no 943 // is that each paginated layer has to paint on its own with the new code. T here is no
944 // recurring into child layers. This means that the m_isPaginated bits for t he new column code can't just be set on 944 // recurring into child layers. This means that the m_isPaginated bits for t he new column code can't just be set on
945 // "roots" that get split and paint all their descendants. Instead each laye r has to be checked individually and 945 // "roots" that get split and paint all their descendants. Instead each laye r has to be checked individually and
946 // genuinely know if it is going to have to split itself up when painting on ly its contents (and not any other descendant 946 // genuinely know if it is going to have to split itself up when painting on ly its contents (and not any other descendant
947 // layers). We track an enclosingPaginationLayer instead of using a simple b it, since we want to be able to get back 947 // layers). We track an enclosingPaginationLayer instead of using a simple b it, since we want to be able to get back
948 // to that layer easily. 948 // to that layer easily.
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 if (positionedParent->renderer()->hasOverflowClip()) { 1238 if (positionedParent->renderer()->hasOverflowClip()) {
1239 LayoutSize offset = positionedParent->scrolledContentOffset(); 1239 LayoutSize offset = positionedParent->scrolledContentOffset();
1240 localPoint -= offset; 1240 localPoint -= offset;
1241 } 1241 }
1242 1242
1243 if (renderer()->isOutOfFlowPositioned() && positionedParent->renderer()- >isInFlowPositioned() && positionedParent->renderer()->isRenderInline()) { 1243 if (renderer()->isOutOfFlowPositioned() && positionedParent->renderer()- >isInFlowPositioned() && positionedParent->renderer()->isRenderInline()) {
1244 LayoutSize offset = toRenderInline(positionedParent->renderer())->of fsetForInFlowPositionedInline(toRenderBox(renderer())); 1244 LayoutSize offset = toRenderInline(positionedParent->renderer())->of fsetForInFlowPositionedInline(toRenderBox(renderer()));
1245 localPoint += offset; 1245 localPoint += offset;
1246 } 1246 }
1247 } else if (parent()) { 1247 } else if (parent()) {
1248 if (isComposited()) { 1248 if (backing()) {
1249 // FIXME: Composited layers ignore pagination, so about the best we can do is make sure they're offset into the appropriate column. 1249 // FIXME: Composited layers ignore pagination, so about the best we can do is make sure they're offset into the appropriate column.
1250 // They won't split across columns properly. 1250 // They won't split across columns properly.
1251 LayoutSize columnOffset; 1251 LayoutSize columnOffset;
1252 if (!parent()->renderer()->hasColumns() && parent()->renderer()->isR oot() && renderer()->view()->hasColumns()) 1252 if (!parent()->renderer()->hasColumns() && parent()->renderer()->isR oot() && renderer()->view()->hasColumns())
1253 renderer()->view()->adjustForColumns(columnOffset, localPoint); 1253 renderer()->view()->adjustForColumns(columnOffset, localPoint);
1254 else 1254 else
1255 parent()->renderer()->adjustForColumns(columnOffset, localPoint) ; 1255 parent()->renderer()->adjustForColumns(columnOffset, localPoint) ;
1256 1256
1257 localPoint += columnOffset; 1257 localPoint += columnOffset;
1258 } 1258 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 } 1414 }
1415 1415
1416 inline bool RenderLayer::shouldRepaintAfterLayout() const 1416 inline bool RenderLayer::shouldRepaintAfterLayout() const
1417 { 1417 {
1418 if (m_repaintStatus == NeedsNormalRepaint) 1418 if (m_repaintStatus == NeedsNormalRepaint)
1419 return true; 1419 return true;
1420 1420
1421 // Composited layers that were moved during a positioned movement only 1421 // Composited layers that were moved during a positioned movement only
1422 // layout, don't need to be repainted. They just need to be recomposited. 1422 // layout, don't need to be repainted. They just need to be recomposited.
1423 ASSERT(m_repaintStatus == NeedsFullRepaintForPositionedMovementLayout); 1423 ASSERT(m_repaintStatus == NeedsFullRepaintForPositionedMovementLayout);
1424 return !isComposited(); 1424 return !backing();
1425 } 1425 }
1426 1426
1427 // FIXME: having two different functions named enclosingCompositingLayer and enc losingCompositingLayerForRepaint
1428 // is error-prone and misleading for reading code that uses these functio ns - especially compounded with
1429 // the includeSelf option.
1427 RenderLayer* RenderLayer::enclosingCompositingLayer(bool includeSelf) const 1430 RenderLayer* RenderLayer::enclosingCompositingLayer(bool includeSelf) const
1428 { 1431 {
1429 if (includeSelf && isComposited()) 1432 if (includeSelf && backing())
1430 return const_cast<RenderLayer*>(this); 1433 return const_cast<RenderLayer*>(this);
1431 1434
1432 for (const RenderLayer* curr = compositingContainer(this); curr; curr = comp ositingContainer(curr)) { 1435 for (const RenderLayer* curr = compositingContainer(this); curr; curr = comp ositingContainer(curr)) {
1433 if (curr->isComposited()) 1436 if (curr->backing())
1434 return const_cast<RenderLayer*>(curr); 1437 return const_cast<RenderLayer*>(curr);
1435 } 1438 }
1436 1439
1437 return 0; 1440 return 0;
1438 } 1441 }
1439 1442
1440 RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(bool includeSelf) const 1443 RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(bool includeSelf) const
1441 { 1444 {
1442 if (includeSelf && isComposited() && !backing()->paintsIntoCompositedAncesto r()) 1445 if (includeSelf && compositingState() == PaintsIntoOwnBacking)
1443 return const_cast<RenderLayer*>(this); 1446 return const_cast<RenderLayer*>(this);
1444 1447
1445 for (const RenderLayer* curr = compositingContainer(this); curr; curr = comp ositingContainer(curr)) { 1448 for (const RenderLayer* curr = compositingContainer(this); curr; curr = comp ositingContainer(curr)) {
1446 if (curr->isComposited() && !curr->backing()->paintsIntoCompositedAncest or()) 1449 if (curr->compositingState() == PaintsIntoOwnBacking)
1447 return const_cast<RenderLayer*>(curr); 1450 return const_cast<RenderLayer*>(curr);
1448 } 1451 }
1449 1452
1450 return 0; 1453 return 0;
1451 } 1454 }
1452 1455
1453 RenderLayer* RenderLayer::ancestorScrollingLayer() const 1456 RenderLayer* RenderLayer::ancestorScrollingLayer() const
1454 { 1457 {
1455 if (!acceleratedCompositingForOverflowScrollEnabled()) 1458 if (!acceleratedCompositingForOverflowScrollEnabled())
1456 return 0; 1459 return 0;
(...skipping 17 matching lines...) Expand all
1474 if (curr->requiresFullLayerImageForFilters()) 1477 if (curr->requiresFullLayerImageForFilters())
1475 return const_cast<RenderLayer*>(curr); 1478 return const_cast<RenderLayer*>(curr);
1476 } 1479 }
1477 1480
1478 return 0; 1481 return 0;
1479 } 1482 }
1480 1483
1481 RenderLayer* RenderLayer::enclosingFilterRepaintLayer() const 1484 RenderLayer* RenderLayer::enclosingFilterRepaintLayer() const
1482 { 1485 {
1483 for (const RenderLayer* curr = this; curr; curr = curr->parent()) { 1486 for (const RenderLayer* curr = this; curr; curr = curr->parent()) {
1484 if ((curr != this && curr->requiresFullLayerImageForFilters()) || curr-> isComposited() || curr->isRootLayer()) 1487 if ((curr != this && curr->requiresFullLayerImageForFilters()) || curr-> compositingState() == PaintsIntoOwnBacking || curr->isRootLayer())
1485 return const_cast<RenderLayer*>(curr); 1488 return const_cast<RenderLayer*>(curr);
1486 } 1489 }
1487 return 0; 1490 return 0;
1488 } 1491 }
1489 1492
1490 void RenderLayer::setFilterBackendNeedsRepaintingInRect(const LayoutRect& rect) 1493 void RenderLayer::setFilterBackendNeedsRepaintingInRect(const LayoutRect& rect)
1491 { 1494 {
1492 if (rect.isEmpty()) 1495 if (rect.isEmpty())
1493 return; 1496 return;
1494 1497
(...skipping 10 matching lines...) Expand all
1505 // shader can address any ouput pixel. 1508 // shader can address any ouput pixel.
1506 // Note: This is only for output rect, so there's no need to expand the dirty source rect. 1509 // Note: This is only for output rect, so there's no need to expand the dirty source rect.
1507 rectForRepaint.unite(calculateLayerBounds(this)); 1510 rectForRepaint.unite(calculateLayerBounds(this));
1508 } 1511 }
1509 1512
1510 RenderLayer* parentLayer = enclosingFilterRepaintLayer(); 1513 RenderLayer* parentLayer = enclosingFilterRepaintLayer();
1511 ASSERT(parentLayer); 1514 ASSERT(parentLayer);
1512 FloatQuad repaintQuad(rectForRepaint); 1515 FloatQuad repaintQuad(rectForRepaint);
1513 LayoutRect parentLayerRect = renderer()->localToContainerQuad(repaintQuad, p arentLayer->renderer()).enclosingBoundingBox(); 1516 LayoutRect parentLayerRect = renderer()->localToContainerQuad(repaintQuad, p arentLayer->renderer()).enclosingBoundingBox();
1514 1517
1515 if (parentLayer->isComposited()) { 1518 if (parentLayer->backing()) {
1516 parentLayer->setBackingNeedsRepaintInRect(parentLayerRect); 1519 parentLayer->setBackingNeedsRepaintInRect(parentLayerRect);
1517 return; 1520 return;
1518 } 1521 }
1519 1522
1520 if (parentLayer->paintsWithFilters()) { 1523 if (parentLayer->paintsWithFilters()) {
1521 parentLayer->setFilterBackendNeedsRepaintingInRect(parentLayerRect); 1524 parentLayer->setFilterBackendNeedsRepaintingInRect(parentLayerRect);
1522 return; 1525 return;
1523 } 1526 }
1524 1527
1525 if (parentLayer->isRootLayer()) { 1528 if (parentLayer->isRootLayer()) {
(...skipping 10 matching lines...) Expand all
1536 for (const RenderLayer* curr = this; curr; curr = curr->parent()) { 1539 for (const RenderLayer* curr = this; curr; curr = curr->parent()) {
1537 RenderLayerModelObject* renderer = curr->renderer(); 1540 RenderLayerModelObject* renderer = curr->renderer();
1538 if (renderer->style()->hasFilterOutsets()) 1541 if (renderer->style()->hasFilterOutsets())
1539 return true; 1542 return true;
1540 } 1543 }
1541 return false; 1544 return false;
1542 } 1545 }
1543 1546
1544 RenderLayer* RenderLayer::clippingRootForPainting() const 1547 RenderLayer* RenderLayer::clippingRootForPainting() const
1545 { 1548 {
1546 if (isComposited()) 1549 if (backing())
1547 return const_cast<RenderLayer*>(this); 1550 return const_cast<RenderLayer*>(this);
1548 1551
1549 const RenderLayer* current = this; 1552 const RenderLayer* current = this;
1550 while (current) { 1553 while (current) {
1551 if (current->isRootLayer()) 1554 if (current->isRootLayer())
1552 return const_cast<RenderLayer*>(current); 1555 return const_cast<RenderLayer*>(current);
1553 1556
1554 current = compositingContainer(current); 1557 current = compositingContainer(current);
1555 ASSERT(current); 1558 ASSERT(current);
1556 if (current->transform() 1559 if (current->transform()
1557 || (current->isComposited() && !current->backing()->paintsIntoCompos itedAncestor()) 1560 || (current->backing() && !current->backing()->paintsIntoCompositedA ncestor())
1558 ) 1561 )
1559 return const_cast<RenderLayer*>(current); 1562 return const_cast<RenderLayer*>(current);
1560 } 1563 }
1561 1564
1562 ASSERT_NOT_REACHED(); 1565 ASSERT_NOT_REACHED();
1563 return 0; 1566 return 0;
1564 } 1567 }
1565 1568
1566 LayoutPoint RenderLayer::absoluteToContents(const LayoutPoint& absolutePoint) co nst 1569 LayoutPoint RenderLayer::absoluteToContents(const LayoutPoint& absolutePoint) co nst
1567 { 1570 {
(...skipping 14 matching lines...) Expand all
1582 { 1585 {
1583 // FIXME: This seems incorrect; why would SVG layers be opaque? 1586 // FIXME: This seems incorrect; why would SVG layers be opaque?
1584 if (renderer()->node() && renderer()->node()->namespaceURI() == SVGNames::sv gNamespaceURI) 1587 if (renderer()->node() && renderer()->node()->namespaceURI() == SVGNames::sv gNamespaceURI)
1585 return false; 1588 return false;
1586 1589
1587 return renderer()->isTransparent() || renderer()->hasMask(); 1590 return renderer()->isTransparent() || renderer()->hasMask();
1588 } 1591 }
1589 1592
1590 RenderLayer* RenderLayer::transparentPaintingAncestor() 1593 RenderLayer* RenderLayer::transparentPaintingAncestor()
1591 { 1594 {
1592 if (isComposited()) 1595 if (backing())
1593 return 0; 1596 return 0;
1594 1597
1595 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { 1598 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) {
1596 if (curr->isComposited()) 1599 if (curr->backing())
1597 return 0; 1600 return 0;
1598 if (curr->isTransparent()) 1601 if (curr->isTransparent())
1599 return curr; 1602 return curr;
1600 } 1603 }
1601 return 0; 1604 return 0;
1602 } 1605 }
1603 1606
1604 enum TransparencyClipBoxBehavior { 1607 enum TransparencyClipBoxBehavior {
1605 PaintingTransparencyClipBox, 1608 PaintingTransparencyClipBox,
1606 HitTestingTransparencyClipBox 1609 HitTestingTransparencyClipBox
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 } 2028 }
2026 2029
2027 bool RenderLayer::usesCompositedScrolling() const 2030 bool RenderLayer::usesCompositedScrolling() const
2028 { 2031 {
2029 RenderBox* box = renderBox(); 2032 RenderBox* box = renderBox();
2030 2033
2031 // Scroll form controls on the main thread so they exhibit correct touch scr oll event bubbling 2034 // Scroll form controls on the main thread so they exhibit correct touch scr oll event bubbling
2032 if (box && (box->isIntristicallyScrollable(VerticalScrollbar) || box->isIntr isticallyScrollable(HorizontalScrollbar))) 2035 if (box && (box->isIntristicallyScrollable(VerticalScrollbar) || box->isIntr isticallyScrollable(HorizontalScrollbar)))
2033 return false; 2036 return false;
2034 2037
2035 return isComposited() && backing()->scrollingLayer(); 2038 return backing() && backing()->scrollingLayer();
2036 } 2039 }
2037 2040
2038 bool RenderLayer::needsCompositedScrolling() const 2041 bool RenderLayer::needsCompositedScrolling() const
2039 { 2042 {
2040 if (!compositorDrivenAcceleratedScrollingEnabled()) 2043 if (!compositorDrivenAcceleratedScrollingEnabled())
2041 return needsToBeStackingContainer(); 2044 return needsToBeStackingContainer();
2042 if (FrameView* frameView = renderer()->view()->frameView()) 2045 if (FrameView* frameView = renderer()->view()->frameView())
2043 return frameView->containsScrollableArea(scrollableArea()); 2046 return frameView->containsScrollableArea(scrollableArea());
2044 return false; 2047 return false;
2045 } 2048 }
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
2751 RenderBox* box = renderBox(); 2754 RenderBox* box = renderBox();
2752 if (!box) 2755 if (!box)
2753 return; 2756 return;
2754 2757
2755 m_scrollableArea->positionOverflowControls(offsetFromRoot); 2758 m_scrollableArea->positionOverflowControls(offsetFromRoot);
2756 2759
2757 const IntRect borderBox = box->pixelSnappedBorderBoxRect(); 2760 const IntRect borderBox = box->pixelSnappedBorderBoxRect();
2758 if (m_resizer) 2761 if (m_resizer)
2759 m_resizer->setFrameRect(resizerCornerRect(borderBox, ResizerForPointer)) ; 2762 m_resizer->setFrameRect(resizerCornerRect(borderBox, ResizerForPointer)) ;
2760 2763
2761 if (isComposited()) 2764 if (backing())
2762 backing()->positionOverflowControlsLayers(offsetFromRoot); 2765 backing()->positionOverflowControlsLayers(offsetFromRoot);
2763 } 2766 }
2764 2767
2765 int RenderLayer::scrollWidth() const 2768 int RenderLayer::scrollWidth() const
2766 { 2769 {
2767 return m_scrollableArea->scrollWidth(); 2770 return m_scrollableArea->scrollWidth();
2768 } 2771 }
2769 2772
2770 int RenderLayer::scrollHeight() const 2773 int RenderLayer::scrollHeight() const
2771 { 2774 {
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
3043 return false; 3046 return false;
3044 } 3047 }
3045 3048
3046 static bool paintForFixedRootBackground(const RenderLayer* layer, RenderLayer::P aintLayerFlags paintFlags) 3049 static bool paintForFixedRootBackground(const RenderLayer* layer, RenderLayer::P aintLayerFlags paintFlags)
3047 { 3050 {
3048 return layer->renderer()->isRoot() && (paintFlags & RenderLayer::PaintLayerP aintingRootBackgroundOnly); 3051 return layer->renderer()->isRoot() && (paintFlags & RenderLayer::PaintLayerP aintingRootBackgroundOnly);
3049 } 3052 }
3050 3053
3051 void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) 3054 void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
3052 { 3055 {
3053 if (isComposited()) { 3056 if (backing()) {
3054 // The updatingControlTints() painting pass goes through compositing lay ers, 3057 // The updatingControlTints() painting pass goes through compositing lay ers,
3055 // but we need to ensure that we don't cache clip rects computed with th e wrong root in this case. 3058 // but we need to ensure that we don't cache clip rects computed with th e wrong root in this case.
3056 if (context->updatingControlTints() || (paintingInfo.paintBehavior & Pai ntBehaviorFlattenCompositingLayers)) { 3059 if (context->updatingControlTints() || (paintingInfo.paintBehavior & Pai ntBehaviorFlattenCompositingLayers)) {
3057 paintFlags |= PaintLayerTemporaryClipRects; 3060 paintFlags |= PaintLayerTemporaryClipRects;
3058 } else if (!backing()->paintsIntoCompositedAncestor() 3061 } else if (!backing()->paintsIntoCompositedAncestor()
3059 && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingRefle ction) 3062 && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingRefle ction)
3060 && !paintForFixedRootBackground(this, paintFlags)) { 3063 && !paintForFixedRootBackground(this, paintFlags)) {
3061 // If this RenderLayer should paint into its backing, that will be d one via RenderLayerBacking::paintIntoLayer(). 3064 // If this RenderLayer should paint into its backing, that will be d one via RenderLayerBacking::paintIntoLayer().
3062 return; 3065 return;
3063 } 3066 }
(...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after
4855 return pixelSnappedIntRect(localClipRect); 4858 return pixelSnappedIntRect(localClipRect);
4856 } 4859 }
4857 } 4860 }
4858 4861
4859 // FIXME: should probably just pass 'flags' down to descendants. 4862 // FIXME: should probably just pass 'flags' down to descendants.
4860 CalculateLayerBoundsFlags descendantFlags = DefaultCalculateLayerBoundsFlags | (flags & ExcludeHiddenDescendants) | (flags & IncludeCompositedDescendants); 4863 CalculateLayerBoundsFlags descendantFlags = DefaultCalculateLayerBoundsFlags | (flags & ExcludeHiddenDescendants) | (flags & IncludeCompositedDescendants);
4861 4864
4862 const_cast<RenderLayer*>(this)->updateLayerListsIfNeeded(); 4865 const_cast<RenderLayer*>(this)->updateLayerListsIfNeeded();
4863 4866
4864 if (RenderLayer* reflection = reflectionLayer()) { 4867 if (RenderLayer* reflection = reflectionLayer()) {
4865 if (!reflection->isComposited()) { 4868 if (!reflection->backing()) {
4866 IntRect childUnionBounds = reflection->calculateLayerBounds(this, 0, descendantFlags); 4869 IntRect childUnionBounds = reflection->calculateLayerBounds(this, 0, descendantFlags);
4867 unionBounds.unite(childUnionBounds); 4870 unionBounds.unite(childUnionBounds);
4868 } 4871 }
4869 } 4872 }
4870 4873
4871 ASSERT(isStackingContainer() || (!posZOrderList() || !posZOrderList()->size( ))); 4874 ASSERT(isStackingContainer() || (!posZOrderList() || !posZOrderList()->size( )));
4872 4875
4873 #if !ASSERT_DISABLED 4876 #if !ASSERT_DISABLED
4874 LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(this)); 4877 LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(this));
4875 #endif 4878 #endif
4876 4879
4877 if (Vector<RenderLayer*>* negZOrderList = this->negZOrderList()) { 4880 if (Vector<RenderLayer*>* negZOrderList = this->negZOrderList()) {
4878 size_t listSize = negZOrderList->size(); 4881 size_t listSize = negZOrderList->size();
4879 for (size_t i = 0; i < listSize; ++i) { 4882 for (size_t i = 0; i < listSize; ++i) {
4880 RenderLayer* curLayer = negZOrderList->at(i); 4883 RenderLayer* curLayer = negZOrderList->at(i);
4881 if (flags & IncludeCompositedDescendants || !curLayer->isComposited( )) { 4884 if (flags & IncludeCompositedDescendants || !curLayer->backing()) {
4882 IntRect childUnionBounds = curLayer->calculateLayerBounds(this, 0, descendantFlags); 4885 IntRect childUnionBounds = curLayer->calculateLayerBounds(this, 0, descendantFlags);
4883 unionBounds.unite(childUnionBounds); 4886 unionBounds.unite(childUnionBounds);
4884 } 4887 }
4885 } 4888 }
4886 } 4889 }
4887 4890
4888 if (Vector<RenderLayer*>* posZOrderList = this->posZOrderList()) { 4891 if (Vector<RenderLayer*>* posZOrderList = this->posZOrderList()) {
4889 size_t listSize = posZOrderList->size(); 4892 size_t listSize = posZOrderList->size();
4890 for (size_t i = 0; i < listSize; ++i) { 4893 for (size_t i = 0; i < listSize; ++i) {
4891 RenderLayer* curLayer = posZOrderList->at(i); 4894 RenderLayer* curLayer = posZOrderList->at(i);
4892 if (flags & IncludeCompositedDescendants || !curLayer->isComposited( )) { 4895 if (flags & IncludeCompositedDescendants || !curLayer->backing()) {
4893 IntRect childUnionBounds = curLayer->calculateLayerBounds(this, 0, descendantFlags); 4896 IntRect childUnionBounds = curLayer->calculateLayerBounds(this, 0, descendantFlags);
4894 unionBounds.unite(childUnionBounds); 4897 unionBounds.unite(childUnionBounds);
4895 } 4898 }
4896 } 4899 }
4897 } 4900 }
4898 4901
4899 if (Vector<RenderLayer*>* normalFlowList = this->normalFlowList()) { 4902 if (Vector<RenderLayer*>* normalFlowList = this->normalFlowList()) {
4900 size_t listSize = normalFlowList->size(); 4903 size_t listSize = normalFlowList->size();
4901 for (size_t i = 0; i < listSize; ++i) { 4904 for (size_t i = 0; i < listSize; ++i) {
4902 RenderLayer* curLayer = normalFlowList->at(i); 4905 RenderLayer* curLayer = normalFlowList->at(i);
4903 if (flags & IncludeCompositedDescendants || !curLayer->isComposited( )) { 4906 if (flags & IncludeCompositedDescendants || !curLayer->backing()) {
4904 IntRect curAbsBounds = curLayer->calculateLayerBounds(this, 0, d escendantFlags); 4907 IntRect curAbsBounds = curLayer->calculateLayerBounds(this, 0, d escendantFlags);
4905 unionBounds.unite(curAbsBounds); 4908 unionBounds.unite(curAbsBounds);
4906 } 4909 }
4907 } 4910 }
4908 } 4911 }
4909 4912
4910 // FIXME: We can optimize the size of the composited layers, by not enlargin g 4913 // FIXME: We can optimize the size of the composited layers, by not enlargin g
4911 // filtered areas with the outsets if we know that the filter is going to re nder in hardware. 4914 // filtered areas with the outsets if we know that the filter is going to re nder in hardware.
4912 // https://bugs.webkit.org/show_bug.cgi?id=81239 4915 // https://bugs.webkit.org/show_bug.cgi?id=81239
4913 if (flags & IncludeLayerFilterOutsets) 4916 if (flags & IncludeLayerFilterOutsets)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4946 if (typeToClear == AllClipRectTypes) 4949 if (typeToClear == AllClipRectTypes)
4947 m_clipRectsCache = nullptr; 4950 m_clipRectsCache = nullptr;
4948 else { 4951 else {
4949 ASSERT(typeToClear < NumCachedClipRectsTypes); 4952 ASSERT(typeToClear < NumCachedClipRectsTypes);
4950 RefPtr<ClipRects> dummy; 4953 RefPtr<ClipRects> dummy;
4951 m_clipRectsCache->setClipRects(typeToClear, RespectOverflowClip, dummy); 4954 m_clipRectsCache->setClipRects(typeToClear, RespectOverflowClip, dummy);
4952 m_clipRectsCache->setClipRects(typeToClear, IgnoreOverflowClip, dummy); 4955 m_clipRectsCache->setClipRects(typeToClear, IgnoreOverflowClip, dummy);
4953 } 4956 }
4954 } 4957 }
4955 4958
4959 CompositingState RenderLayer::compositingState() const
4960 {
4961 // This is computed procedurally so there is no redundant state variable tha t
4962 // can get out of sync from the real actual compositing state.
4963
4964 if (!m_backing)
4965 return NotComposited;
4966
4967 if (m_backing && backing()->paintsIntoCompositedAncestor())
4968 return HasOwnBackingButPaintsIntoAncestor;
4969
4970 ASSERT(m_backing);
4971 return PaintsIntoOwnBacking;
4972 }
4973
4956 RenderLayerBacking* RenderLayer::ensureBacking() 4974 RenderLayerBacking* RenderLayer::ensureBacking()
4957 { 4975 {
4958 if (!m_backing) { 4976 if (!m_backing) {
4959 m_backing = adoptPtr(new RenderLayerBacking(this)); 4977 m_backing = adoptPtr(new RenderLayerBacking(this));
4960 compositor()->layerBecameComposited(this); 4978 compositor()->layerBecameComposited(this);
4961 4979
4962 updateOrRemoveFilterEffectRenderer(); 4980 updateOrRemoveFilterEffectRenderer();
4963 4981
4964 if (RuntimeEnabledFeatures::cssCompositingEnabled()) 4982 if (RuntimeEnabledFeatures::cssCompositingEnabled())
4965 backing()->setBlendMode(m_blendMode); 4983 backing()->setBlendMode(m_blendMode);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
5007 return m_backing ? m_backing->layerForVerticalScrollbar() : 0; 5025 return m_backing ? m_backing->layerForVerticalScrollbar() : 0;
5008 } 5026 }
5009 5027
5010 GraphicsLayer* RenderLayer::layerForScrollCorner() const 5028 GraphicsLayer* RenderLayer::layerForScrollCorner() const
5011 { 5029 {
5012 return m_backing ? m_backing->layerForScrollCorner() : 0; 5030 return m_backing ? m_backing->layerForScrollCorner() : 0;
5013 } 5031 }
5014 5032
5015 bool RenderLayer::paintsWithTransform(PaintBehavior paintBehavior) const 5033 bool RenderLayer::paintsWithTransform(PaintBehavior paintBehavior) const
5016 { 5034 {
5017 return transform() && ((paintBehavior & PaintBehaviorFlattenCompositingLayer s) || !isComposited()); 5035 // FIXME: shouldn't we return true if this layer has a backing but paints in to its ancestor?
5036 return transform() && ((paintBehavior & PaintBehaviorFlattenCompositingLayer s) || !backing());
5018 } 5037 }
5019 5038
5020 bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const 5039 bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const
5021 { 5040 {
5022 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) 5041 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant())
5023 return false; 5042 return false;
5024 5043
5025 if (paintsWithTransparency(PaintBehaviorNormal)) 5044 if (paintsWithTransparency(PaintBehaviorNormal))
5026 return false; 5045 return false;
5027 5046
(...skipping 30 matching lines...) Expand all
5058 || listBackgroundIsKnownToBeOpaqueInRect(normalFlowList(), localRect); 5077 || listBackgroundIsKnownToBeOpaqueInRect(normalFlowList(), localRect);
5059 } 5078 }
5060 5079
5061 bool RenderLayer::listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer *>* list, const LayoutRect& localRect) const 5080 bool RenderLayer::listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer *>* list, const LayoutRect& localRect) const
5062 { 5081 {
5063 if (!list || list->isEmpty()) 5082 if (!list || list->isEmpty())
5064 return false; 5083 return false;
5065 5084
5066 for (Vector<RenderLayer*>::const_reverse_iterator iter = list->rbegin(); ite r != list->rend(); ++iter) { 5085 for (Vector<RenderLayer*>::const_reverse_iterator iter = list->rbegin(); ite r != list->rend(); ++iter) {
5067 const RenderLayer* childLayer = *iter; 5086 const RenderLayer* childLayer = *iter;
5068 if (childLayer->isComposited()) 5087 if (childLayer->backing())
5069 continue; 5088 continue;
5070 5089
5071 if (!childLayer->canUseConvertToLayerCoords()) 5090 if (!childLayer->canUseConvertToLayerCoords())
5072 continue; 5091 continue;
5073 5092
5074 LayoutPoint childOffset; 5093 LayoutPoint childOffset;
5075 LayoutRect childLocalRect(localRect); 5094 LayoutRect childLocalRect(localRect);
5076 childLayer->convertToLayerCoords(this, childOffset); 5095 childLayer->convertToLayerCoords(this, childOffset);
5077 childLocalRect.moveBy(-childOffset); 5096 childLocalRect.moveBy(-childOffset);
5078 5097
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
5315 5334
5316 void RenderLayer::repaintIncludingDescendants() 5335 void RenderLayer::repaintIncludingDescendants()
5317 { 5336 {
5318 renderer()->repaint(); 5337 renderer()->repaint();
5319 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) 5338 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling())
5320 curr->repaintIncludingDescendants(); 5339 curr->repaintIncludingDescendants();
5321 } 5340 }
5322 5341
5323 void RenderLayer::setBackingNeedsRepaint() 5342 void RenderLayer::setBackingNeedsRepaint()
5324 { 5343 {
5325 ASSERT(isComposited()); 5344 ASSERT(backing());
5326 backing()->setContentsNeedDisplay(); 5345 backing()->setContentsNeedDisplay();
5327 } 5346 }
5328 5347
5329 void RenderLayer::setBackingNeedsRepaintInRect(const LayoutRect& r) 5348 void RenderLayer::setBackingNeedsRepaintInRect(const LayoutRect& r)
5330 { 5349 {
5331 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, 5350 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here,
5332 // so assert but check that the layer is composited. 5351 // so assert but check that the layer is composited.
5333 ASSERT(isComposited()); 5352 ASSERT(backing());
5334 if (!isComposited()) { 5353 if (!backing()) {
5335 // If we're trying to repaint the placeholder document layer, propagate the 5354 // If we're trying to repaint the placeholder document layer, propagate the
5336 // repaint to the native view system. 5355 // repaint to the native view system.
5337 LayoutRect absRect(r); 5356 LayoutRect absRect(r);
5338 LayoutPoint delta; 5357 LayoutPoint delta;
5339 convertToLayerCoords(root(), delta); 5358 convertToLayerCoords(root(), delta);
5340 absRect.moveBy(delta); 5359 absRect.moveBy(delta);
5341 5360
5342 RenderView* view = renderer()->view(); 5361 RenderView* view = renderer()->view();
5343 if (view) 5362 if (view)
5344 view->repaintViewRectangle(absRect); 5363 view->repaintViewRectangle(absRect);
5345 } else 5364 } else
5346 backing()->setContentsNeedDisplayInRect(pixelSnappedIntRect(r)); 5365 backing()->setContentsNeedDisplayInRect(pixelSnappedIntRect(r));
5347 } 5366 }
5348 5367
5349 // Since we're only painting non-composited layers, we know that they all share the same repaintContainer. 5368 // Since we're only painting non-composited layers, we know that they all share the same repaintContainer.
5350 void RenderLayer::repaintIncludingNonCompositingDescendants(RenderLayerModelObje ct* repaintContainer) 5369 void RenderLayer::repaintIncludingNonCompositingDescendants(RenderLayerModelObje ct* repaintContainer)
5351 { 5370 {
5352 renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(rend erer()->clippedOverflowRectForRepaint(repaintContainer))); 5371 renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(rend erer()->clippedOverflowRectForRepaint(repaintContainer)));
5353 5372
5354 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) { 5373 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) {
5355 if (!curr->isComposited()) 5374 if (!curr->backing())
5356 curr->repaintIncludingNonCompositingDescendants(repaintContainer); 5375 curr->repaintIncludingNonCompositingDescendants(repaintContainer);
5357 } 5376 }
5358 } 5377 }
5359 5378
5360 bool RenderLayer::shouldBeNormalFlowOnly() const 5379 bool RenderLayer::shouldBeNormalFlowOnly() const
5361 { 5380 {
5362 return shouldBeNormalFlowOnlyIgnoringCompositedScrolling() && !needsComposit edScrolling(); 5381 return shouldBeNormalFlowOnlyIgnoringCompositedScrolling() && !needsComposit edScrolling();
5363 } 5382 }
5364 5383
5365 bool RenderLayer::shouldBeNormalFlowOnlyIgnoringCompositedScrolling() const 5384 bool RenderLayer::shouldBeNormalFlowOnlyIgnoringCompositedScrolling() const
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
5551 5570
5552 inline bool RenderLayer::needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const 5571 inline bool RenderLayer::needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const
5553 { 5572 {
5554 ASSERT(newStyle); 5573 ASSERT(newStyle);
5555 return oldStyle && (oldStyle->clip() != newStyle->clip() || oldStyle->hasCli p() != newStyle->hasClip()); 5574 return oldStyle && (oldStyle->clip() != newStyle->clip() || oldStyle->hasCli p() != newStyle->hasClip());
5556 } 5575 }
5557 5576
5558 inline bool RenderLayer::needsCompositingLayersRebuiltForOverflow(const RenderSt yle* oldStyle, const RenderStyle* newStyle) const 5577 inline bool RenderLayer::needsCompositingLayersRebuiltForOverflow(const RenderSt yle* oldStyle, const RenderStyle* newStyle) const
5559 { 5578 {
5560 ASSERT(newStyle); 5579 ASSERT(newStyle);
5561 return !isComposited() && oldStyle && (oldStyle->overflowX() != newStyle->ov erflowX()) && ancestorStackingContainer()->hasCompositingDescendant(); 5580 return !backing() && oldStyle && (oldStyle->overflowX() != newStyle->overflo wX()) && ancestorStackingContainer()->hasCompositingDescendant();
5562 } 5581 }
5563 5582
5564 inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderSty le* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const 5583 inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderSty le* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const
5565 { 5584 {
5566 if (!hasOrHadFilters(oldStyle, newStyle)) 5585 if (!hasOrHadFilters(oldStyle, newStyle))
5567 return false; 5586 return false;
5568 5587
5569 if (renderer()->animation()->isRunningAcceleratedAnimationOnRenderer(rendere r(), CSSPropertyWebkitFilter)) { 5588 if (renderer()->animation()->isRunningAcceleratedAnimationOnRenderer(rendere r(), CSSPropertyWebkitFilter)) {
5570 // When the compositor is performing the filter animation, we shouldn't touch the compositing layers. 5589 // When the compositor is performing the filter animation, we shouldn't touch the compositing layers.
5571 // All of the layers above us should have been promoted to compositing l ayers already. 5590 // All of the layers above us should have been promoted to compositing l ayers already.
(...skipping 23 matching lines...) Expand all
5595 } 5614 }
5596 5615
5597 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle) 5616 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle)
5598 { 5617 {
5599 if (!hasOrHadFilters(oldStyle, newStyle)) 5618 if (!hasOrHadFilters(oldStyle, newStyle))
5600 return; 5619 return;
5601 5620
5602 updateOrRemoveFilterClients(); 5621 updateOrRemoveFilterClients();
5603 // During an accelerated animation, both WebKit and the compositor animate p roperties. 5622 // During an accelerated animation, both WebKit and the compositor animate p roperties.
5604 // However, WebKit shouldn't ask the compositor to update its filters if the compositor is performing the animation. 5623 // However, WebKit shouldn't ask the compositor to update its filters if the compositor is performing the animation.
5605 bool shouldUpdateFilters = isComposited() && !renderer()->animation()->isRun ningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyWebkitFilter); 5624 bool shouldUpdateFilters = backing() && !renderer()->animation()->isRunningA cceleratedAnimationOnRenderer(renderer(), CSSPropertyWebkitFilter);
5606 if (shouldUpdateFilters) 5625 if (shouldUpdateFilters)
5607 backing()->updateFilters(renderer()->style()); 5626 backing()->updateFilters(renderer()->style());
5608 updateOrRemoveFilterEffectRenderer(); 5627 updateOrRemoveFilterEffectRenderer();
5609 } 5628 }
5610 5629
5611 void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle) 5630 void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle)
5612 { 5631 {
5613 updateIsNormalFlowOnly(); 5632 updateIsNormalFlowOnly();
5614 5633
5615 updateResizerAreaSet(); 5634 updateResizerAreaSet();
(...skipping 27 matching lines...) Expand all
5643 if (paintsWithFilters()) 5662 if (paintsWithFilters())
5644 didPaintWithFilters = true; 5663 didPaintWithFilters = true;
5645 updateFilters(oldStyle, renderer()->style()); 5664 updateFilters(oldStyle, renderer()->style());
5646 5665
5647 const RenderStyle* newStyle = renderer()->style(); 5666 const RenderStyle* newStyle = renderer()->style();
5648 if (compositor()->updateLayerCompositingState(this) 5667 if (compositor()->updateLayerCompositingState(this)
5649 || needsCompositingLayersRebuiltForClip(oldStyle, newStyle) 5668 || needsCompositingLayersRebuiltForClip(oldStyle, newStyle)
5650 || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle) 5669 || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle)
5651 || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintW ithFilters)) 5670 || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintW ithFilters))
5652 compositor()->setCompositingLayersNeedRebuild(); 5671 compositor()->setCompositingLayersNeedRebuild();
5653 else if (isComposited()) 5672 else if (backing())
5654 backing()->updateGraphicsLayerGeometry(); 5673 backing()->updateGraphicsLayerGeometry();
5655 } 5674 }
5656 5675
5657 void RenderLayer::updateResizerAreaSet() { 5676 void RenderLayer::updateResizerAreaSet() {
5658 Frame* frame = renderer()->frame(); 5677 Frame* frame = renderer()->frame();
5659 if (!frame) 5678 if (!frame)
5660 return; 5679 return;
5661 FrameView* frameView = frame->view(); 5680 FrameView* frameView = frame->view();
5662 if (!frameView) 5681 if (!frameView)
5663 return; 5682 return;
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
6005 } 6024 }
6006 } 6025 }
6007 6026
6008 void showLayerTree(const WebCore::RenderObject* renderer) 6027 void showLayerTree(const WebCore::RenderObject* renderer)
6009 { 6028 {
6010 if (!renderer) 6029 if (!renderer)
6011 return; 6030 return;
6012 showLayerTree(renderer->enclosingLayer()); 6031 showLayerTree(renderer->enclosingLayer());
6013 } 6032 }
6014 #endif 6033 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698