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

Side by Side Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1235133004: Use LayoutObject to locate the flow thread. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review. Kill the fast path that almost nobody treads. Created 5 years, 5 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 448 }
449 449
450 void DeprecatedPaintLayer::updatePaginationRecursive(bool needsPaginationUpdate) 450 void DeprecatedPaintLayer::updatePaginationRecursive(bool needsPaginationUpdate)
451 { 451 {
452 m_enclosingPaginationLayer = 0; 452 m_enclosingPaginationLayer = 0;
453 453
454 if (layoutObject()->isLayoutFlowThread()) 454 if (layoutObject()->isLayoutFlowThread())
455 needsPaginationUpdate = true; 455 needsPaginationUpdate = true;
456 456
457 if (needsPaginationUpdate) 457 if (needsPaginationUpdate)
458 updatePagination(); 458 updatePagination();
chrishtr 2015/07/14 20:11:08 I think you can blow away DeprecatedPaintLayer::up
459 459
460 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling()) 460 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling())
461 child->updatePaginationRecursive(needsPaginationUpdate); 461 child->updatePaginationRecursive(needsPaginationUpdate);
462 } 462 }
463 463
464 void DeprecatedPaintLayer::updatePagination() 464 void DeprecatedPaintLayer::updatePagination()
465 { 465 {
466 if (!parent()) 466 if (!parent())
467 return; // FIXME: For now the LayoutView can't be paginated. Eventually printing will move to a model where it is though. 467 return; // FIXME: For now the LayoutView can't be paginated. Eventually printing will move to a model where it is though.
468 468
469 // Each paginated layer has to paint on its own. There is no recurring into child layers. Each 469 // Each paginated layer has to paint on its own. There is no recurring into child layers. Each
470 // layer has to be checked individually and genuinely know if it is going to have to split 470 // layer has to be checked individually and genuinely know if it is going to have to split
471 // itself up when painting only its contents (and not any other descendant l ayers). We track an 471 // itself up when painting only its contents (and not any other descendant l ayers). We track an
472 // enclosingPaginationLayer instead of using a simple bit, since we want to be able to get back 472 // enclosingPaginationLayer instead of using a simple bit, since we want to be able to get back
473 // to that layer easily. 473 // to that layer easily.
474 if (layoutObject()->isLayoutFlowThread()) { 474 if (layoutObject()->isLayoutFlowThread()) {
475 m_enclosingPaginationLayer = this; 475 m_enclosingPaginationLayer = this;
476 return; 476 return;
477 } 477 }
478 478
479 if (!m_stackingNode->isTreatedAsStackingContextForPainting()) { 479 // Use the layout tree to find our enclosing pagination layer.
480 // We cannot take the fast path for spanners, as they do not have their nearest ancestor 480 if (LayoutFlowThread* containingFlowThread = layoutObject()->flowThreadConta iningBlock())
481 // pagination layer (flow thread) in their containing block chain. 481 m_enclosingPaginationLayer = containingFlowThread->layer();
chrishtr 2015/07/14 19:57:43 Should there be code that nulls out m_enclosingPag
mstensho (USE GERRIT) 2015/07/14 20:05:31 That shouldn't be necessary, since updatePaginatio
482 if (!layoutObject()->isColumnSpanAll()) {
483 // Content inside a transform is not considered to be paginated, sin ce we simply
484 // paint the transform multiple times in each column, so we don't ha ve to use
485 // fragments for the transformed content.
486 m_enclosingPaginationLayer = parent()->enclosingPaginationLayer();
487 if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTra nsformRelatedProperty())
488 m_enclosingPaginationLayer = 0;
489 return;
490 }
491 }
492
493 // Walk up our containing block chain looking for an enclosing layer. Once w e find one, then we
494 // just check its pagination status.
495 LayoutView* view = layoutObject()->view();
496 LayoutBlock* containingBlock;
497 for (containingBlock = layoutObject()->containingBlock();
498 containingBlock && containingBlock != view;
499 containingBlock = containingBlock->containingBlock()) {
500 if (containingBlock->hasLayer()) {
501 // Content inside a transform is not considered to be paginated, sin ce we simply
502 // paint the transform multiple times in each column, so we don't ha ve to use
503 // fragments for the transformed content.
504 m_enclosingPaginationLayer = containingBlock->layer()->enclosingPagi nationLayer();
505 if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTra nsformRelatedProperty())
506 m_enclosingPaginationLayer = 0;
507 return;
508 }
509 }
510 } 482 }
511 483
512 void DeprecatedPaintLayer::clearPaginationRecursive() 484 void DeprecatedPaintLayer::clearPaginationRecursive()
513 { 485 {
514 m_enclosingPaginationLayer = 0; 486 m_enclosingPaginationLayer = 0;
515 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling()) 487 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling())
516 child->clearPaginationRecursive(); 488 child->clearPaginationRecursive();
517 } 489 }
518 490
519 LayoutPoint DeprecatedPaintLayer::positionFromPaintInvalidationBacking(const Lay outObject* layoutObject, const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) 491 LayoutPoint DeprecatedPaintLayer::positionFromPaintInvalidationBacking(const Lay outObject* layoutObject, const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState)
(...skipping 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after
2741 2713
2742 void showLayerTree(const blink::LayoutObject* layoutObject) 2714 void showLayerTree(const blink::LayoutObject* layoutObject)
2743 { 2715 {
2744 if (!layoutObject) { 2716 if (!layoutObject) {
2745 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2717 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2746 return; 2718 return;
2747 } 2719 }
2748 showLayerTree(layoutObject->enclosingLayer()); 2720 showLayerTree(layoutObject->enclosingLayer());
2749 } 2721 }
2750 #endif 2722 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/dynamic/multicol-with-abspos-svg-with-foreignobject-with-multicol-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698