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

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.cpp

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: 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) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) 2013 Google Inc. All rights reserved. 6 * Copyright (C) 2013 Google Inc. All rights reserved.
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // Build up a transformation that maps from the viewport space to the fi lter primitive subregion. 170 // Build up a transformation that maps from the viewport space to the fi lter primitive subregion.
171 if (lengthContext.determineViewport(viewportSize)) 171 if (lengthContext.determineViewport(viewportSize))
172 transform = makeMapBetweenRects(FloatRect(FloatPoint(), viewportSize ), dstRect); 172 transform = makeMapBetweenRects(FloatRect(FloatPoint(), viewportSize ), dstRect);
173 } else { 173 } else {
174 transform.translate(dstRect.x(), dstRect.y()); 174 transform.translate(dstRect.x(), dstRect.y());
175 } 175 }
176 176
177 SkPictureBuilder filterPicture(dstRect); 177 SkPictureBuilder filterPicture(dstRect);
178 { 178 {
179 TransformRecorder transformRecorder(filterPicture.context(), layoutObjec t, transform); 179 TransformRecorder transformRecorder(filterPicture.context(), layoutObjec t, transform);
180 SVGPaintContext::paintSubtree(&filterPicture.context(), &layoutObject); 180 SVGPaintContext::paintSubtree(filterPicture.context(), &layoutObject);
181 } 181 }
182 RefPtr<const SkPicture> recording = filterPicture.endRecording(); 182 RefPtr<const SkPicture> recording = filterPicture.endRecording();
183 183
184 RefPtr<SkImageFilter> result = adoptRef(SkPictureImageFilter::Create(recordi ng.get(), dstRect)); 184 RefPtr<SkImageFilter> result = adoptRef(SkPictureImageFilter::Create(recordi ng.get(), dstRect));
185 return result.release(); 185 return result.release();
186 } 186 }
187 187
188 PassRefPtr<SkImageFilter> FEImage::createImageFilter(SkiaImageFilterBuilder& bui lder) 188 PassRefPtr<SkImageFilter> FEImage::createImageFilter(SkiaImageFilterBuilder& bui lder)
189 { 189 {
190 if (auto* layoutObject = referencedLayoutObject()) 190 if (auto* layoutObject = referencedLayoutObject())
(...skipping 10 matching lines...) Expand all
201 201
202 FloatRect srcRect = FloatRect(FloatPoint(), FloatSize(m_image->size())); 202 FloatRect srcRect = FloatRect(FloatPoint(), FloatSize(m_image->size()));
203 FloatRect dstRect = filterPrimitiveSubregion(); 203 FloatRect dstRect = filterPrimitiveSubregion();
204 204
205 m_preserveAspectRatio->transformRect(dstRect, srcRect); 205 m_preserveAspectRatio->transformRect(dstRect, srcRect);
206 206
207 return adoptRef(SkImageSource::Create(image.get(), srcRect, dstRect, kHigh_S kFilterQuality)); 207 return adoptRef(SkImageSource::Create(image.get(), srcRect, dstRect, kHigh_S kFilterQuality));
208 } 208 }
209 209
210 } // namespace blink 210 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.cpp ('k') | third_party/WebKit/Source/platform/Theme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698