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

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

Issue 666403002: Decouple content transform fiddling from SVGRenderingContext::renderSubtree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/core/rendering/svg/SVGRenderingContext.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // Build up a transformation that maps from the viewport space to the fi lter primitive subregion. 158 // Build up a transformation that maps from the viewport space to the fi lter primitive subregion.
159 if (lengthContext.determineViewport(viewportSize)) 159 if (lengthContext.determineViewport(viewportSize))
160 transform = makeMapBetweenRects(FloatRect(FloatPoint(), viewportSize ), dstRect); 160 transform = makeMapBetweenRects(FloatRect(FloatPoint(), viewportSize ), dstRect);
161 } else { 161 } else {
162 transform.translate(dstRect.x(), dstRect.y()); 162 transform.translate(dstRect.x(), dstRect.y());
163 } 163 }
164 164
165 GraphicsContext* context = builder->context(); 165 GraphicsContext* context = builder->context();
166 if (!context) 166 if (!context)
167 return adoptRef(SkBitmapSource::Create(SkBitmap())); 167 return adoptRef(SkBitmapSource::Create(SkBitmap()));
168 AffineTransform contentTransformation;
169 FloatRect bounds(FloatPoint(), dstRect.size()); 168 FloatRect bounds(FloatPoint(), dstRect.size());
170 context->save(); 169 context->save();
171 context->beginRecording(bounds); 170 context->beginRecording(bounds);
172 context->concatCTM(transform); 171 context->concatCTM(transform);
173 SVGRenderingContext::renderSubtree(context, renderer, contentTransformation) ; 172 SVGRenderingContext::renderSubtree(context, renderer);
174 RefPtr<DisplayList> displayList = context->endRecording(); 173 RefPtr<DisplayList> displayList = context->endRecording();
175 context->restore(); 174 context->restore();
176 RefPtr<SkImageFilter> result = adoptRef(SkPictureImageFilter::Create(display List->picture(), dstRect)); 175 RefPtr<SkImageFilter> result = adoptRef(SkPictureImageFilter::Create(display List->picture(), dstRect));
177 return result.release(); 176 return result.release();
178 } 177 }
179 178
180 PassRefPtr<SkImageFilter> FEImage::createImageFilter(SkiaImageFilterBuilder* bui lder) 179 PassRefPtr<SkImageFilter> FEImage::createImageFilter(SkiaImageFilterBuilder* bui lder)
181 { 180 {
182 RenderObject* renderer = referencedRenderer(); 181 RenderObject* renderer = referencedRenderer();
183 if (!m_image && !renderer) 182 if (!m_image && !renderer)
(...skipping 15 matching lines...) Expand all
199 m_preserveAspectRatio->transformRect(dstRect, srcRect); 198 m_preserveAspectRatio->transformRect(dstRect, srcRect);
200 199
201 if (!m_image->nativeImageForCurrentFrame()) 200 if (!m_image->nativeImageForCurrentFrame())
202 return adoptRef(SkBitmapSource::Create(SkBitmap())); 201 return adoptRef(SkBitmapSource::Create(SkBitmap()));
203 202
204 RefPtr<SkImageFilter> result = adoptRef(SkBitmapSource::Create(m_image->nati veImageForCurrentFrame()->bitmap(), srcRect, dstRect)); 203 RefPtr<SkImageFilter> result = adoptRef(SkBitmapSource::Create(m_image->nati veImageForCurrentFrame()->bitmap(), srcRect, dstRect));
205 return result.release(); 204 return result.release();
206 } 205 }
207 206
208 } // namespace blink 207 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGRenderingContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698