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

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

Issue 625903004: [New Multicolumn] Correct paint rectangle calculation for compositing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: code review. Have RenderLayer::location() behave like before for old multicol. Created 6 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
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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 if (positionedParent->renderer()->hasOverflowClip()) { 807 if (positionedParent->renderer()->hasOverflowClip()) {
808 LayoutSize offset = positionedParent->renderBox()->scrolledContentOf fset(); 808 LayoutSize offset = positionedParent->renderBox()->scrolledContentOf fset();
809 localPoint -= offset; 809 localPoint -= offset;
810 } 810 }
811 811
812 if (positionedParent->renderer()->isRelPositioned() && positionedParent- >renderer()->isRenderInline()) { 812 if (positionedParent->renderer()->isRelPositioned() && positionedParent- >renderer()->isRenderInline()) {
813 LayoutSize offset = toRenderInline(positionedParent->renderer())->of fsetForInFlowPositionedInline(*toRenderBox(renderer())); 813 LayoutSize offset = toRenderInline(positionedParent->renderer())->of fsetForInFlowPositionedInline(*toRenderBox(renderer()));
814 localPoint += offset; 814 localPoint += offset;
815 } 815 }
816 } else if (parent()) { 816 } else if (parent()) {
817 // FIXME: This code is very wrong. The compositing system doesn't 817 // FIXME: This code is very wrong, but luckily only needed in the old/cu rrent multicol
818 // understand columns and we're hacking around that fact by faking 818 // implementation. The compositing system doesn't understand columns and we're hacking
819 // the position of the RenderLayers when we think we'll end up being 819 // around that fact by faking the position of the RenderLayers when we t hink we'll end up
820 // composited. Hopefully we'll be able to unwind this hack when we 820 // being composited.
821 // implement multi-column using regions. 821 if (hasStyleDeterminedDirectCompositingReasons() && !useRegionBasedColum ns()) {
822 if (hasStyleDeterminedDirectCompositingReasons()) {
823 // FIXME: Composited layers ignore pagination, so about the best we can do is make sure they're offset into the appropriate column. 822 // FIXME: Composited layers ignore pagination, so about the best we can do is make sure they're offset into the appropriate column.
824 // They won't split across columns properly. 823 // They won't split across columns properly.
825 if (!parent()->renderer()->hasColumns() && parent()->renderer()->isD ocumentElement() && renderer()->view()->hasColumns()) 824 if (!parent()->renderer()->hasColumns() && parent()->renderer()->isD ocumentElement() && renderer()->view()->hasColumns())
826 localPoint += renderer()->view()->columnOffset(localPoint); 825 localPoint += renderer()->view()->columnOffset(localPoint);
827 else 826 else
828 localPoint += parent()->renderer()->columnOffset(localPoint); 827 localPoint += parent()->renderer()->columnOffset(localPoint);
829 } 828 }
830 829
831 if (parent()->renderer()->hasOverflowClip()) { 830 if (parent()->renderer()->hasOverflowClip()) {
832 IntSize scrollOffset = parent()->renderBox()->scrolledContentOffset( ); 831 IntSize scrollOffset = parent()->renderBox()->scrolledContentOffset( );
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 ClipRect backgroundRectInFlowThread; 1481 ClipRect backgroundRectInFlowThread;
1483 ClipRect foregroundRectInFlowThread; 1482 ClipRect foregroundRectInFlowThread;
1484 ClipRect outlineRectInFlowThread; 1483 ClipRect outlineRectInFlowThread;
1485 clipper().calculateRects(paginationClipRectsContext, PaintInfo::infiniteRect (), layerBoundsInFlowThread, backgroundRectInFlowThread, foregroundRectInFlowThr ead, 1484 clipper().calculateRects(paginationClipRectsContext, PaintInfo::infiniteRect (), layerBoundsInFlowThread, backgroundRectInFlowThread, foregroundRectInFlowThr ead,
1486 outlineRectInFlowThread, &offsetWithinPaginatedLayer); 1485 outlineRectInFlowThread, &offsetWithinPaginatedLayer);
1487 1486
1488 // Take our bounding box within the flow thread and clip it. 1487 // Take our bounding box within the flow thread and clip it.
1489 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB ox : physicalBoundingBox(enclosingPaginationLayer(), &offsetWithinPaginatedLayer ); 1488 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB ox : physicalBoundingBox(enclosingPaginationLayer(), &offsetWithinPaginatedLayer );
1490 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); 1489 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect());
1491 1490
1492 // Shift the dirty rect into flow thread coordinates. 1491 // Make the dirty rect relative to the fragmentation context (multicol conta iner, etc.).
1492 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginati onLayer()->renderer());
1493 LayoutPoint offsetOfPaginationLayerFromRoot; 1493 LayoutPoint offsetOfPaginationLayerFromRoot;
1494 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOfPaginati onLayerFromRoot); 1494 // FIXME: more work needed if there are nested pagination layers.
1495 if (rootLayer != enclosingPaginationLayer() && rootLayer->enclosingPaginatio nLayer() == enclosingPaginationLayer()) {
1496 // The root layer is inside the fragmentation context. So we need to loo k inside it and find
1497 // the visual offset from the fragmentation context.
1498 LayoutPoint flowThreadOffset;
1499 rootLayer->convertToLayerCoords(enclosingPaginationLayer(), flowThreadOf fset);
1500 offsetOfPaginationLayerFromRoot = -enclosingFlowThread->flowThreadPointT oVisualPoint(flowThreadOffset);
1501 } else {
1502 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOfPagi nationLayerFromRoot);
1503 }
1495 LayoutRect dirtyRectInFlowThread(dirtyRect); 1504 LayoutRect dirtyRectInFlowThread(dirtyRect);
1496 dirtyRectInFlowThread.moveBy(-offsetOfPaginationLayerFromRoot); 1505 dirtyRectInFlowThread.moveBy(-offsetOfPaginationLayerFromRoot);
1497 1506
1498 // Tell the flow thread to collect the fragments. We pass enough information to create a minimal number of fragments based off the pages/columns 1507 // Tell the flow thread to collect the fragments. We pass enough information to create a minimal number of fragments based off the pages/columns
1499 // that intersect the actual dirtyRect as well as the pages/columns that int ersect our layer's bounding box. 1508 // that intersect the actual dirtyRect as well as the pages/columns that int ersect our layer's bounding box.
1500 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginati onLayer()->renderer());
1501 enclosingFlowThread->collectLayerFragments(fragments, layerBoundingBoxInFlow Thread, dirtyRectInFlowThread); 1509 enclosingFlowThread->collectLayerFragments(fragments, layerBoundingBoxInFlow Thread, dirtyRectInFlowThread);
1502 1510
1503 if (fragments.isEmpty()) 1511 if (fragments.isEmpty())
1504 return; 1512 return;
1505 1513
1506 // Get the parent clip rects of the pagination layer, since we need to inter sect with that when painting column contents. 1514 // Get the parent clip rects of the pagination layer, since we need to inter sect with that when painting column contents.
1507 ClipRect ancestorClipRect = dirtyRect; 1515 ClipRect ancestorClipRect = dirtyRect;
1508 if (enclosingPaginationLayer()->parent()) { 1516 if (enclosingPaginationLayer()->parent()) {
1509 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, inOverl ayScrollbarSizeRelevancy); 1517 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, inOverl ayScrollbarSizeRelevancy);
1510 if (respectOverflowClip == IgnoreOverflowClip) 1518 if (respectOverflowClip == IgnoreOverflowClip)
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
2851 } 2859 }
2852 } 2860 }
2853 2861
2854 void showLayerTree(const blink::RenderObject* renderer) 2862 void showLayerTree(const blink::RenderObject* renderer)
2855 { 2863 {
2856 if (!renderer) 2864 if (!renderer)
2857 return; 2865 return;
2858 showLayerTree(renderer->enclosingLayer()); 2866 showLayerTree(renderer->enclosingLayer());
2859 } 2867 }
2860 #endif 2868 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderFlowThread.h ('k') | Source/core/rendering/RenderMultiColumnSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698