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

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

Issue 976543002: Fix pixel snapping issue when transforming (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix comments of esprehn 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 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 const DeprecatedPaintLayer* ancestorLayer = rootLayerIsInsidePaginationL ayer ? paginationParentLayer : rootLayer; 1630 const DeprecatedPaintLayer* ancestorLayer = rootLayerIsInsidePaginationL ayer ? paginationParentLayer : rootLayer;
1631 ClipRectsContext clipRectsContext(ancestorLayer, clipRectsCacheSlot, inO verlayScrollbarSizeRelevancy); 1631 ClipRectsContext clipRectsContext(ancestorLayer, clipRectsCacheSlot, inO verlayScrollbarSizeRelevancy);
1632 if (respectOverflowClip == IgnoreOverflowClip) 1632 if (respectOverflowClip == IgnoreOverflowClip)
1633 clipRectsContext.setIgnoreOverflowClip(); 1633 clipRectsContext.setIgnoreOverflowClip();
1634 ancestorClipRect = enclosingPaginationLayer()->clipper().backgroundClipR ect(clipRectsContext); 1634 ancestorClipRect = enclosingPaginationLayer()->clipper().backgroundClipR ect(clipRectsContext);
1635 if (rootLayerIsInsidePaginationLayer) 1635 if (rootLayerIsInsidePaginationLayer)
1636 ancestorClipRect.moveBy(-rootLayer->visualOffsetFromAncestor(ancesto rLayer)); 1636 ancestorClipRect.moveBy(-rootLayer->visualOffsetFromAncestor(ancesto rLayer));
1637 ancestorClipRect.intersect(dirtyRect); 1637 ancestorClipRect.intersect(dirtyRect);
1638 } 1638 }
1639 1639
1640 const LayoutSize subPixelAccumulationIfNeeded = compositingState() == Paints IntoOwnBacking ? LayoutSize() : subPixelAccumulation;
1640 for (size_t i = 0; i < fragments.size(); ++i) { 1641 for (size_t i = 0; i < fragments.size(); ++i) {
1641 DeprecatedPaintLayerFragment& fragment = fragments.at(i); 1642 DeprecatedPaintLayerFragment& fragment = fragments.at(i);
1642 1643
1643 // Set our four rects with all clipping applied that was internal to the flow thread. 1644 // Set our four rects with all clipping applied that was internal to the flow thread.
1644 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f oregroundRectInFlowThread, outlineRectInFlowThread); 1645 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f oregroundRectInFlowThread, outlineRectInFlowThread);
1645 1646
1646 // Shift to the root-relative physical position used when painting the f low thread in this fragment. 1647 // Shift to the root-relative physical position used when painting the f low thread in this fragment.
1647 fragment.moveBy(fragment.paginationOffset + offsetOfPaginationLayerFromR oot); 1648 fragment.moveBy(fragment.paginationOffset + offsetOfPaginationLayerFromR oot + subPixelAccumulationIfNeeded);
1648 1649
1649 // Intersect the fragment with our ancestor's background clip so that e. g., columns in an overflow:hidden block are 1650 // Intersect the fragment with our ancestor's background clip so that e. g., columns in an overflow:hidden block are
1650 // properly clipped by the overflow. 1651 // properly clipped by the overflow.
1651 fragment.intersect(ancestorClipRect.rect()); 1652 fragment.intersect(ancestorClipRect.rect());
1652 1653
1653 // Now intersect with our pagination clip. This will typically mean we'r e just intersecting the dirty rect with the column 1654 // Now intersect with our pagination clip. This will typically mean we'r e just intersecting the dirty rect with the column
1654 // clip, so the column clip ends up being all we apply. 1655 // clip, so the column clip ends up being all we apply.
1655 fragment.intersect(fragment.paginationClip); 1656 fragment.intersect(fragment.paginationClip);
1656 } 1657 }
1657 } 1658 }
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2973 } 2974 }
2974 } 2975 }
2975 2976
2976 void showLayerTree(const blink::LayoutObject* renderer) 2977 void showLayerTree(const blink::LayoutObject* renderer)
2977 { 2978 {
2978 if (!renderer) 2979 if (!renderer)
2979 return; 2980 return;
2980 showLayerTree(renderer->enclosingLayer()); 2981 showLayerTree(renderer->enclosingLayer());
2981 } 2982 }
2982 #endif 2983 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698