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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2098683003: Use enclosingIntRect when computing paint invalidations across transforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: none Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/invalidation/invalidation-with-scale-transform-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 if (container->styleRef().isFlippedBlocksWritingMode()) 2070 if (container->styleRef().isFlippedBlocksWritingMode())
2071 rect.setX(m_frameRect.width() - rect.maxX()); 2071 rect.setX(m_frameRect.width() - rect.maxX());
2072 } 2072 }
2073 2073
2074 LayoutPoint topLeft = rect.location(); 2074 LayoutPoint topLeft = rect.location();
2075 topLeft.move(locationOffset()); 2075 topLeft.move(locationOffset());
2076 2076
2077 // We are now in our parent container's coordinate space. Apply our transfo rm to obtain a bounding box 2077 // We are now in our parent container's coordinate space. Apply our transfo rm to obtain a bounding box
2078 // in the parent's coordinate space that encloses us. 2078 // in the parent's coordinate space that encloses us.
2079 if (hasLayer() && layer()->transform()) { 2079 if (hasLayer() && layer()->transform()) {
2080 rect = LayoutRect(layer()->transform()->mapRect(pixelSnappedIntRect(rect ))); 2080 // Use enclosingIntRect because we cannot properly compute pixel snappin g for painted elements within
2081 // the transform since we don't know the desired subpixel accumulation a t this point, and the transform may
2082 // include a scale.
2083 rect = LayoutRect(layer()->transform()->mapRect(enclosingIntRect(rect))) ;
2081 topLeft = rect.location(); 2084 topLeft = rect.location();
2082 topLeft.move(locationOffset()); 2085 topLeft.move(locationOffset());
2083 } 2086 }
2084 2087
2085 const ComputedStyle& styleToUse = styleRef(); 2088 const ComputedStyle& styleToUse = styleRef();
2086 EPosition position = styleToUse.position(); 2089 EPosition position = styleToUse.position();
2087 if (position == AbsolutePosition && container->isInFlowPositioned() && conta iner->isLayoutInline()) { 2090 if (position == AbsolutePosition && container->isInFlowPositioned() && conta iner->isLayoutInline()) {
2088 topLeft += toLayoutInline(container)->offsetForInFlowPositionedInline(*t his); 2091 topLeft += toLayoutInline(container)->offsetForInFlowPositionedInline(*t his);
2089 } else if (styleToUse.hasInFlowPosition() && layer()) { 2092 } else if (styleToUse.hasInFlowPosition() && layer()) {
2090 // Apply the relative position offset when invalidating a rectangle. Th e layer 2093 // Apply the relative position offset when invalidating a rectangle. Th e layer
(...skipping 2834 matching lines...) Expand 10 before | Expand all | Expand 10 after
4925 m_rareData->m_snapAreas->remove(&snapArea); 4928 m_rareData->m_snapAreas->remove(&snapArea);
4926 } 4929 }
4927 } 4930 }
4928 4931
4929 SnapAreaSet* LayoutBox::snapAreas() const 4932 SnapAreaSet* LayoutBox::snapAreas() const
4930 { 4933 {
4931 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4934 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4932 } 4935 }
4933 4936
4934 } // namespace blink 4937 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/invalidation/invalidation-with-scale-transform-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698