OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |