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

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

Issue 2290903002: Change (Pass)RefPtr<SkXxx> into sk_sp<SkXxx>. (Closed)
Patch Set: Rebasing... Created 4 years, 3 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 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 break; 166 break;
167 if (linkedResource == expectedLayoutObject) 167 if (linkedResource == expectedLayoutObject)
168 return expectedLayoutObject; 168 return expectedLayoutObject;
169 contentLayoutObject = linkedResource; 169 contentLayoutObject = linkedResource;
170 } 170 }
171 // There was a cycle, just use this resource as the "content resource" even 171 // There was a cycle, just use this resource as the "content resource" even
172 // though it will be empty (have no children). 172 // though it will be empty (have no children).
173 return this; 173 return this;
174 } 174 }
175 175
176 PassRefPtr<SkPicture> LayoutSVGResourcePattern::asPicture(const FloatRect& tileB ounds, 176 sk_sp<SkPicture> LayoutSVGResourcePattern::asPicture(const FloatRect& tileBounds ,
177 const AffineTransform& tileTransform) const 177 const AffineTransform& tileTransform) const
178 { 178 {
179 ASSERT(!m_shouldCollectPatternAttributes); 179 ASSERT(!m_shouldCollectPatternAttributes);
180 180
181 AffineTransform contentTransform; 181 AffineTransform contentTransform;
182 if (attributes().patternContentUnits() == SVGUnitTypes::kSvgUnitTypeObjectbo undingbox) 182 if (attributes().patternContentUnits() == SVGUnitTypes::kSvgUnitTypeObjectbo undingbox)
183 contentTransform = tileTransform; 183 contentTransform = tileTransform;
184 184
185 FloatRect bounds(FloatPoint(), tileBounds.size()); 185 FloatRect bounds(FloatPoint(), tileBounds.size());
186 SkPictureBuilder pictureBuilder(bounds); 186 SkPictureBuilder pictureBuilder(bounds);
187 187
188 const LayoutSVGResourceContainer* patternLayoutObject = resolveContentElemen t(); 188 const LayoutSVGResourceContainer* patternLayoutObject = resolveContentElemen t();
189 ASSERT(patternLayoutObject && !patternLayoutObject->needsLayout()); 189 ASSERT(patternLayoutObject && !patternLayoutObject->needsLayout());
190 190
191 SubtreeContentTransformScope contentTransformScope(contentTransform); 191 SubtreeContentTransformScope contentTransformScope(contentTransform);
192 192
193 { 193 {
194 TransformRecorder transformRecorder(pictureBuilder.context(), *patternLa youtObject, tileTransform); 194 TransformRecorder transformRecorder(pictureBuilder.context(), *patternLa youtObject, tileTransform);
195 for (LayoutObject* child = patternLayoutObject->firstChild(); child; chi ld = child->nextSibling()) 195 for (LayoutObject* child = patternLayoutObject->firstChild(); child; chi ld = child->nextSibling())
196 SVGPaintContext::paintSubtree(pictureBuilder.context(), child); 196 SVGPaintContext::paintSubtree(pictureBuilder.context(), child);
197 } 197 }
198 198
199 return pictureBuilder.endRecording(); 199 return pictureBuilder.endRecording();
200 } 200 }
201 201
202 } // namespace blink 202 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698