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

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

Issue 2086583004: Common up SVG transform "change detection" (classification) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <buis@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 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 void LayoutSVGContainer::layout() 49 void LayoutSVGContainer::layout()
50 { 50 {
51 ASSERT(needsLayout()); 51 ASSERT(needsLayout());
52 LayoutAnalyzer::Scope analyzer(*this); 52 LayoutAnalyzer::Scope analyzer(*this);
53 53
54 // Allow LayoutSVGViewportContainer to update its viewport. 54 // Allow LayoutSVGViewportContainer to update its viewport.
55 calcViewport(); 55 calcViewport();
56 56
57 // Allow LayoutSVGTransformableContainer to update its transform. 57 // Allow LayoutSVGTransformableContainer to update its transform.
58 TransformChange transformChange = calculateLocalTransform(); 58 SVGTransformChange transformChange = calculateLocalTransform();
59 m_didScreenScaleFactorChange = 59 m_didScreenScaleFactorChange =
60 transformChange == TransformChange::Full || SVGLayoutSupport::screenScal eFactorChanged(parent()); 60 transformChange == SVGTransformChange::Full || SVGLayoutSupport::screenS caleFactorChanged(parent());
61 61
62 // LayoutSVGViewportContainer needs to set the 'layout size changed' flag. 62 // LayoutSVGViewportContainer needs to set the 'layout size changed' flag.
63 determineIfLayoutSizeChanged(); 63 determineIfLayoutSizeChanged();
64 64
65 // When hasRelativeLengths() is false, no descendants have relative lengths 65 // When hasRelativeLengths() is false, no descendants have relative lengths
66 // (hence no one is interested in viewport size changes). 66 // (hence no one is interested in viewport size changes).
67 bool layoutSizeChanged = element()->hasRelativeLengths() 67 bool layoutSizeChanged = element()->hasRelativeLengths()
68 && SVGLayoutSupport::layoutSizeOfNearestViewportChanged(this); 68 && SVGLayoutSupport::layoutSizeOfNearestViewportChanged(this);
69 69
70 SVGLayoutSupport::layoutChildren(firstChild(), false, m_didScreenScaleFactor Change, layoutSizeChanged); 70 SVGLayoutSupport::layoutChildren(firstChild(), false, m_didScreenScaleFactor Change, layoutSizeChanged);
71 71
72 // Invalidate all resources of this client if our layout changed. 72 // Invalidate all resources of this client if our layout changed.
73 if (everHadLayout() && needsLayout()) 73 if (everHadLayout() && needsLayout())
74 SVGResourcesCache::clientLayoutChanged(this); 74 SVGResourcesCache::clientLayoutChanged(this);
75 75
76 if (m_needsBoundariesUpdate || transformChange != TransformChange::None) { 76 if (m_needsBoundariesUpdate || transformChange != SVGTransformChange::None) {
77 updateCachedBoundaries(); 77 updateCachedBoundaries();
78 m_needsBoundariesUpdate = false; 78 m_needsBoundariesUpdate = false;
79 79
80 // If our bounds changed, notify the parents. 80 // If our bounds changed, notify the parents.
81 LayoutSVGModelObject::setNeedsBoundariesUpdate(); 81 LayoutSVGModelObject::setNeedsBoundariesUpdate();
82 } 82 }
83 83
84 ASSERT(!m_needsBoundariesUpdate); 84 ASSERT(!m_needsBoundariesUpdate);
85 clearNeedsLayout(); 85 clearNeedsLayout();
86 } 86 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 const LayoutPoint& localLayoutPoint = roundedLayoutPoint(localPoint) ; 194 const LayoutPoint& localLayoutPoint = roundedLayoutPoint(localPoint) ;
195 updateHitTestResult(result, localLayoutPoint); 195 updateHitTestResult(result, localLayoutPoint);
196 if (result.addNodeToListBasedTestResult(element(), localLayoutPoint) == StopHitTesting) 196 if (result.addNodeToListBasedTestResult(element(), localLayoutPoint) == StopHitTesting)
197 return true; 197 return true;
198 } 198 }
199 } 199 }
200 // 16.4: "If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispat ched." 200 // 16.4: "If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispat ched."
201 return false; 201 return false;
202 } 202 }
203 203
204 SVGTransformChange LayoutSVGContainer::calculateLocalTransform()
205 {
206 return SVGTransformChange::None;
207 }
208
204 } // namespace blink 209 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698