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

Side by Side Diff: Source/core/layout/Layer.cpp

Issue 976543002: Fix pixel snapping issue when transforming (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 const Layer* ancestorLayer = rootLayerIsInsidePaginationLayer ? paginati onParentLayer : rootLayer; 1621 const Layer* ancestorLayer = rootLayerIsInsidePaginationLayer ? paginati onParentLayer : rootLayer;
1622 ClipRectsContext clipRectsContext(ancestorLayer, clipRectsCacheSlot, inO verlayScrollbarSizeRelevancy); 1622 ClipRectsContext clipRectsContext(ancestorLayer, clipRectsCacheSlot, inO verlayScrollbarSizeRelevancy);
1623 if (respectOverflowClip == IgnoreOverflowClip) 1623 if (respectOverflowClip == IgnoreOverflowClip)
1624 clipRectsContext.setIgnoreOverflowClip(); 1624 clipRectsContext.setIgnoreOverflowClip();
1625 ancestorClipRect = enclosingPaginationLayer()->clipper().backgroundClipR ect(clipRectsContext); 1625 ancestorClipRect = enclosingPaginationLayer()->clipper().backgroundClipR ect(clipRectsContext);
1626 if (rootLayerIsInsidePaginationLayer) 1626 if (rootLayerIsInsidePaginationLayer)
1627 ancestorClipRect.moveBy(-rootLayer->visualOffsetFromAncestor(ancesto rLayer)); 1627 ancestorClipRect.moveBy(-rootLayer->visualOffsetFromAncestor(ancesto rLayer));
1628 ancestorClipRect.intersect(dirtyRect); 1628 ancestorClipRect.intersect(dirtyRect);
1629 } 1629 }
1630 1630
1631 const LayoutSize subPixelAccumulationIfNeeded = compositingState() == Paints IntoOwnBacking ? LayoutSize() : subPixelAccumulation;
1631 for (size_t i = 0; i < fragments.size(); ++i) { 1632 for (size_t i = 0; i < fragments.size(); ++i) {
1632 LayerFragment& fragment = fragments.at(i); 1633 LayerFragment& fragment = fragments.at(i);
1633 1634
1634 // Set our four rects with all clipping applied that was internal to the flow thread. 1635 // Set our four rects with all clipping applied that was internal to the flow thread.
1635 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f oregroundRectInFlowThread, outlineRectInFlowThread); 1636 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f oregroundRectInFlowThread, outlineRectInFlowThread);
1636 1637
1637 // Shift to the root-relative physical position used when painting the f low thread in this fragment. 1638 // Shift to the root-relative physical position used when painting the f low thread in this fragment.
1638 fragment.moveBy(fragment.paginationOffset + offsetOfPaginationLayerFromR oot); 1639 fragment.moveBy(fragment.paginationOffset + offsetOfPaginationLayerFromR oot + subPixelAccumulationIfNeeded);
qiankun 2015/03/10 01:37:00 Hi Chris, this code is what I said fixed the multi
1639 1640
1640 // Intersect the fragment with our ancestor's background clip so that e. g., columns in an overflow:hidden block are 1641 // Intersect the fragment with our ancestor's background clip so that e. g., columns in an overflow:hidden block are
1641 // properly clipped by the overflow. 1642 // properly clipped by the overflow.
1642 fragment.intersect(ancestorClipRect.rect()); 1643 fragment.intersect(ancestorClipRect.rect());
1643 1644
1644 // Now intersect with our pagination clip. This will typically mean we'r e just intersecting the dirty rect with the column 1645 // Now intersect with our pagination clip. This will typically mean we'r e just intersecting the dirty rect with the column
1645 // clip, so the column clip ends up being all we apply. 1646 // clip, so the column clip ends up being all we apply.
1646 fragment.intersect(fragment.paginationClip); 1647 fragment.intersect(fragment.paginationClip);
1647 } 1648 }
1648 } 1649 }
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
2953 } 2954 }
2954 } 2955 }
2955 2956
2956 void showLayerTree(const blink::LayoutObject* renderer) 2957 void showLayerTree(const blink::LayoutObject* renderer)
2957 { 2958 {
2958 if (!renderer) 2959 if (!renderer)
2959 return; 2960 return;
2960 showLayerTree(renderer->enclosingLayer()); 2961 showLayerTree(renderer->enclosingLayer());
2961 } 2962 }
2962 #endif 2963 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/sub-pixel/fractional-border-location-and-size-expected.html ('k') | Source/core/paint/LayerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698