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

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: 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Unless we're a spanner or establish a stacking context, we can take the f ast path: Just use
480 // We cannot take the fast path for spanners, as they do not have their nearest ancestor 480 // the same pagination layer as our parent. Spanners cannot do this, because they don't have
481 // pagination layer (flow thread) in their containing block chain. 481 // that pagination layer in their containing block chain.
482 if (!layoutObject()->isColumnSpanAll()) { 482 if (!m_stackingNode->isTreatedAsStackingContextForPainting() && !layoutObjec t()->isColumnSpanAll()) {
chrishtr 2015/07/14 18:54:01 Is this fast path needed for correctness? Also, y
mstensho (USE GERRIT) 2015/07/14 19:13:39 No, I don't think so. I really hope not. :) I real
chrishtr 2015/07/14 19:46:44 Let's kill it.
mstensho (USE GERRIT) 2015/07/14 19:52:34 Done.
483 // Content inside a transform is not considered to be paginated, sin ce we simply 483 m_enclosingPaginationLayer = parent()->enclosingPaginationLayer();
484 // paint the transform multiple times in each column, so we don't ha ve to use 484 return;
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 } 485 }
492 486
493 // Walk up our containing block chain looking for an enclosing layer. Once w e find one, then we 487 // Use the layout tree to find our enclosing pagination layer.
494 // just check its pagination status. 488 if (LayoutFlowThread* containingFlowThread = layoutObject()->flowThreadConta iningBlock())
495 LayoutView* view = layoutObject()->view(); 489 m_enclosingPaginationLayer = containingFlowThread->layer();
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 } 490 }
511 491
512 void DeprecatedPaintLayer::clearPaginationRecursive() 492 void DeprecatedPaintLayer::clearPaginationRecursive()
513 { 493 {
514 m_enclosingPaginationLayer = 0; 494 m_enclosingPaginationLayer = 0;
515 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling()) 495 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling())
516 child->clearPaginationRecursive(); 496 child->clearPaginationRecursive();
517 } 497 }
518 498
519 LayoutPoint DeprecatedPaintLayer::positionFromPaintInvalidationBacking(const Lay outObject* layoutObject, const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) 499 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 2721
2742 void showLayerTree(const blink::LayoutObject* layoutObject) 2722 void showLayerTree(const blink::LayoutObject* layoutObject)
2743 { 2723 {
2744 if (!layoutObject) { 2724 if (!layoutObject) {
2745 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2725 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2746 return; 2726 return;
2747 } 2727 }
2748 showLayerTree(layoutObject->enclosingLayer()); 2728 showLayerTree(layoutObject->enclosingLayer());
2749 } 2729 }
2750 #endif 2730 #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