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

Side by Side Diff: Source/core/layout/svg/LayoutSVGResourcePattern.cpp

Issue 921823002: Use SVGLength-references in the SVGLengthContext API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
4 * Copyright 2014 The Chromium Authors. All rights reserved. 4 * Copyright 2014 The Chromium Authors. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 // An empty viewBox disables rendering. 87 // An empty viewBox disables rendering.
88 if (attributes.hasViewBox() && attributes.viewBox().isEmpty()) 88 if (attributes.hasViewBox() && attributes.viewBox().isEmpty())
89 return nullptr; 89 return nullptr;
90 90
91 ASSERT(element()); 91 ASSERT(element());
92 // Compute tile metrics. 92 // Compute tile metrics.
93 FloatRect clientBoundingBox = object.objectBoundingBox(); 93 FloatRect clientBoundingBox = object.objectBoundingBox();
94 FloatRect tileBounds = SVGLengthContext::resolveRectangle(element(), 94 FloatRect tileBounds = SVGLengthContext::resolveRectangle(element(),
95 attributes.patternUnits(), clientBoundingBox, 95 attributes.patternUnits(), clientBoundingBox,
96 attributes.x(), attributes.y(), attributes.width(), attributes.height()) ; 96 *attributes.x(), *attributes.y(), *attributes.width(), *attributes.heigh t());
97 if (tileBounds.isEmpty()) 97 if (tileBounds.isEmpty())
98 return nullptr; 98 return nullptr;
99 99
100 AffineTransform tileTransform; 100 AffineTransform tileTransform;
101 if (attributes.hasViewBox()) { 101 if (attributes.hasViewBox()) {
102 if (attributes.viewBox().isEmpty()) 102 if (attributes.viewBox().isEmpty())
103 return nullptr; 103 return nullptr;
104 tileTransform = SVGFitToViewBox::viewBoxToViewTransform(attributes.viewB ox(), 104 tileTransform = SVGFitToViewBox::viewBoxToViewTransform(attributes.viewB ox(),
105 attributes.preserveAspectRatio(), tileBounds.width(), tileBounds.hei ght()); 105 attributes.preserveAspectRatio(), tileBounds.width(), tileBounds.hei ght());
106 } else { 106 } else {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 for (LayoutObject* child = patternRenderer->firstChild(); child; child = child->nextSibling()) 185 for (LayoutObject* child = patternRenderer->firstChild(); child; child = child->nextSibling())
186 SVGPaintContext::paintSubtree(&recordingContext, child); 186 SVGPaintContext::paintSubtree(&recordingContext, child);
187 } 187 }
188 188
189 if (displayItemList) 189 if (displayItemList)
190 displayItemList->replay(&recordingContext); 190 displayItemList->replay(&recordingContext);
191 return recordingContext.endRecording(); 191 return recordingContext.endRecording();
192 } 192 }
193 193
194 } 194 }
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGResourceLinearGradient.cpp ('k') | Source/core/layout/svg/LayoutSVGResourceRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698