| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 FloatRect bounds(LayoutRect::InfiniteIntRect()); | 184 FloatRect bounds(LayoutRect::InfiniteIntRect()); |
| 185 PaintRecordBuilder builder(bounds); | 185 PaintRecordBuilder builder(bounds); |
| 186 SVGPaintContext::PaintResourceSubtree(builder.Context(), &layout_object); | 186 SVGPaintContext::PaintResourceSubtree(builder.Context(), &layout_object); |
| 187 | 187 |
| 188 PaintRecorder paint_recorder; | 188 PaintRecorder paint_recorder; |
| 189 PaintCanvas* canvas = paint_recorder.beginRecording(dst_rect); | 189 PaintCanvas* canvas = paint_recorder.beginRecording(dst_rect); |
| 190 canvas->concat(AffineTransformToSkMatrix(transform)); | 190 canvas->concat(AffineTransformToSkMatrix(transform)); |
| 191 builder.EndRecording(*canvas); | 191 builder.EndRecording(*canvas); |
| 192 | 192 |
| 193 return SkPictureImageFilter::Make( | 193 return SkPictureImageFilter::Make( |
| 194 ToSkPicture(paint_recorder.finishRecordingAsPicture()), dst_rect); | 194 ToSkPicture(paint_recorder.finishRecordingAsPicture(), dst_rect)); |
| 195 } | 195 } |
| 196 | 196 |
| 197 sk_sp<SkImageFilter> FEImage::CreateImageFilter() { | 197 sk_sp<SkImageFilter> FEImage::CreateImageFilter() { |
| 198 if (auto* layout_object = ReferencedLayoutObject()) | 198 if (auto* layout_object = ReferencedLayoutObject()) |
| 199 return CreateImageFilterForLayoutObject(*layout_object); | 199 return CreateImageFilterForLayoutObject(*layout_object); |
| 200 | 200 |
| 201 sk_sp<SkImage> image = image_ ? image_->ImageForCurrentFrame() : nullptr; | 201 sk_sp<SkImage> image = image_ ? image_->ImageForCurrentFrame() : nullptr; |
| 202 if (!image) { | 202 if (!image) { |
| 203 // "A href reference that is an empty image (zero width or zero height), | 203 // "A href reference that is an empty image (zero width or zero height), |
| 204 // that fails to download, is non-existent, or that cannot be displayed | 204 // that fails to download, is non-existent, or that cannot be displayed |
| 205 // (e.g. because it is not in a supported image format) fills the filter | 205 // (e.g. because it is not in a supported image format) fills the filter |
| 206 // primitive subregion with transparent black." | 206 // primitive subregion with transparent black." |
| 207 return CreateTransparentBlack(); | 207 return CreateTransparentBlack(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 FloatRect src_rect = FloatRect(FloatPoint(), FloatSize(image_->Size())); | 210 FloatRect src_rect = FloatRect(FloatPoint(), FloatSize(image_->Size())); |
| 211 FloatRect dst_rect = FilterPrimitiveSubregion(); | 211 FloatRect dst_rect = FilterPrimitiveSubregion(); |
| 212 | 212 |
| 213 preserve_aspect_ratio_->TransformRect(dst_rect, src_rect); | 213 preserve_aspect_ratio_->TransformRect(dst_rect, src_rect); |
| 214 | 214 |
| 215 return SkImageSource::Make(std::move(image), src_rect, dst_rect, | 215 return SkImageSource::Make(std::move(image), src_rect, dst_rect, |
| 216 kHigh_SkFilterQuality); | 216 kHigh_SkFilterQuality); |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace blink | 219 } // namespace blink |
| OLD | NEW |