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

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

Issue 1516683002: Introducing LayoutObject::mapToVisibleRectInContainerSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix flipping logic Created 5 years 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) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // Offset by SVG root paint offset and apply clipping as needed. 91 // Offset by SVG root paint offset and apply clipping as needed.
92 rect.move(paintInvalidationState->paintOffset()); 92 rect.move(paintInvalidationState->paintOffset());
93 if (paintInvalidationState->isClipped()) 93 if (paintInvalidationState->isClipped())
94 rect.intersect(paintInvalidationState->clipRect()); 94 rect.intersect(paintInvalidationState->clipRect());
95 return rect; 95 return rect;
96 } 96 }
97 97
98 LayoutRect rect; 98 LayoutRect rect;
99 const LayoutSVGRoot& svgRoot = mapRectToSVGRootForPaintInvalidation(object, 99 const LayoutSVGRoot& svgRoot = mapRectToSVGRootForPaintInvalidation(object,
100 paintInvalidationRect, rect, strokeWidthForHairlinePadding); 100 paintInvalidationRect, rect, strokeWidthForHairlinePadding);
101 svgRoot.mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paintInvalidationState); 101 svgRoot.mapToVisibleRectInContainerSpace(paintInvalidationContainer, rect, p aintInvalidationState);
102 return rect; 102 return rect;
103 } 103 }
104 104
105 const LayoutSVGRoot& SVGLayoutSupport::mapRectToSVGRootForPaintInvalidation(cons t LayoutObject& object, 105 const LayoutSVGRoot& SVGLayoutSupport::mapRectToSVGRootForPaintInvalidation(cons t LayoutObject& object,
106 const FloatRect& localPaintInvalidationRect, LayoutRect& rect, float strokeW idthForHairlinePadding) 106 const FloatRect& localPaintInvalidationRect, LayoutRect& rect, float strokeW idthForHairlinePadding)
107 { 107 {
108 ASSERT(object.isSVG() && !object.isSVGRoot()); 108 ASSERT(object.isSVG() && !object.isSVGRoot());
109 109
110 const LayoutObject* parent; 110 const LayoutObject* parent;
111 AffineTransform rootBorderBoxTransform; 111 AffineTransform rootBorderBoxTransform;
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 475
476 // FIXME: trying to compute a device space transform at record time is wrong . All clients 476 // FIXME: trying to compute a device space transform at record time is wrong . All clients
477 // should be updated to avoid relying on this information, and the method sh ould be removed. 477 // should be updated to avoid relying on this information, and the method sh ould be removed.
478 AffineTransform ctm = deprecatedCalculateTransformToLayer(layoutObject) * cu rrentContentTransformation(); 478 AffineTransform ctm = deprecatedCalculateTransformToLayer(layoutObject) * cu rrentContentTransformation();
479 ctm.scale(layoutObject->document().frameHost()->deviceScaleFactor()); 479 ctm.scale(layoutObject->document().frameHost()->deviceScaleFactor());
480 480
481 return narrowPrecisionToFloat(sqrt((pow(ctm.xScale(), 2) + pow(ctm.yScale(), 2)) / 2)); 481 return narrowPrecisionToFloat(sqrt((pow(ctm.xScale(), 2) + pow(ctm.yScale(), 2)) / 2));
482 } 482 }
483 483
484 } 484 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698