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 22 matching lines...) Expand all Loading... |
33 #include "core/svg/SVGURIReference.h" | 33 #include "core/svg/SVGURIReference.h" |
34 #include "platform/graphics/DisplayList.h" | 34 #include "platform/graphics/DisplayList.h" |
35 #include "platform/graphics/GraphicsContext.h" | 35 #include "platform/graphics/GraphicsContext.h" |
36 #include "platform/graphics/filters/Filter.h" | 36 #include "platform/graphics/filters/Filter.h" |
37 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" | 37 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" |
38 #include "platform/text/TextStream.h" | 38 #include "platform/text/TextStream.h" |
39 #include "platform/transforms/AffineTransform.h" | 39 #include "platform/transforms/AffineTransform.h" |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 FEImage::FEImage(Filter* filter, PassRefPtr<Image> image, PassRefPtr<SVGPreserve
AspectRatio> preserveAspectRatio) | 43 FEImage::FEImage(Filter* filter, PassRefPtr<Image> image, PassRefPtrWillBeRawPtr
<SVGPreserveAspectRatio> preserveAspectRatio) |
44 : FilterEffect(filter) | 44 : FilterEffect(filter) |
45 , m_image(image) | 45 , m_image(image) |
46 , m_treeScope(0) | 46 , m_treeScope(0) |
47 , m_preserveAspectRatio(preserveAspectRatio) | 47 , m_preserveAspectRatio(preserveAspectRatio) |
48 { | 48 { |
49 } | 49 } |
50 | 50 |
51 FEImage::FEImage(Filter* filter, TreeScope& treeScope, const String& href, PassR
efPtr<SVGPreserveAspectRatio> preserveAspectRatio) | 51 FEImage::FEImage(Filter* filter, TreeScope& treeScope, const String& href, PassR
efPtrWillBeRawPtr<SVGPreserveAspectRatio> preserveAspectRatio) |
52 : FilterEffect(filter) | 52 : FilterEffect(filter) |
53 , m_treeScope(&treeScope) | 53 , m_treeScope(&treeScope) |
54 , m_href(href) | 54 , m_href(href) |
55 , m_preserveAspectRatio(preserveAspectRatio) | 55 , m_preserveAspectRatio(preserveAspectRatio) |
56 { | 56 { |
57 } | 57 } |
58 | 58 |
59 PassRefPtr<FEImage> FEImage::createWithImage(Filter* filter, PassRefPtr<Image> i
mage, PassRefPtr<SVGPreserveAspectRatio> preserveAspectRatio) | 59 void FEImage::trace(Visitor* visitor) |
60 { | 60 { |
61 return adoptRef(new FEImage(filter, image, preserveAspectRatio)); | 61 visitor->trace(m_preserveAspectRatio); |
| 62 FilterEffect::trace(visitor); |
62 } | 63 } |
63 | 64 |
64 PassRefPtr<FEImage> FEImage::createWithIRIReference(Filter* filter, TreeScope& t
reeScope, const String& href, PassRefPtr<SVGPreserveAspectRatio> preserveAspectR
atio) | 65 PassRefPtrWillBeRawPtr<FEImage> FEImage::createWithImage(Filter* filter, PassRef
Ptr<Image> image, PassRefPtrWillBeRawPtr<SVGPreserveAspectRatio> preserveAspectR
atio) |
65 { | 66 { |
66 return adoptRef(new FEImage(filter, treeScope, href, preserveAspectRatio)); | 67 return adoptRefWillBeNoop(new FEImage(filter, image, preserveAspectRatio)); |
| 68 } |
| 69 |
| 70 PassRefPtrWillBeRawPtr<FEImage> FEImage::createWithIRIReference(Filter* filter,
TreeScope& treeScope, const String& href, PassRefPtrWillBeRawPtr<SVGPreserveAspe
ctRatio> preserveAspectRatio) |
| 71 { |
| 72 return adoptRefWillBeNoop(new FEImage(filter, treeScope, href, preserveAspec
tRatio)); |
67 } | 73 } |
68 | 74 |
69 static FloatRect getRendererRepaintRect(RenderObject* renderer) | 75 static FloatRect getRendererRepaintRect(RenderObject* renderer) |
70 { | 76 { |
71 return renderer->localToParentTransform().mapRect( | 77 return renderer->localToParentTransform().mapRect( |
72 renderer->paintInvalidationRectInLocalCoordinates()); | 78 renderer->paintInvalidationRectInLocalCoordinates()); |
73 } | 79 } |
74 | 80 |
75 AffineTransform makeMapBetweenRects(const FloatRect& source, const FloatRect& de
st) | 81 AffineTransform makeMapBetweenRects(const FloatRect& source, const FloatRect& de
st) |
76 { | 82 { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 m_preserveAspectRatio->transformRect(dstRect, srcRect); | 204 m_preserveAspectRatio->transformRect(dstRect, srcRect); |
199 | 205 |
200 if (!m_image->nativeImageForCurrentFrame()) | 206 if (!m_image->nativeImageForCurrentFrame()) |
201 return adoptRef(SkBitmapSource::Create(SkBitmap())); | 207 return adoptRef(SkBitmapSource::Create(SkBitmap())); |
202 | 208 |
203 RefPtr<SkImageFilter> result = adoptRef(SkBitmapSource::Create(m_image->nati
veImageForCurrentFrame()->bitmap(), srcRect, dstRect)); | 209 RefPtr<SkImageFilter> result = adoptRef(SkBitmapSource::Create(m_image->nati
veImageForCurrentFrame()->bitmap(), srcRect, dstRect)); |
204 return result.release(); | 210 return result.release(); |
205 } | 211 } |
206 | 212 |
207 } // namespace blink | 213 } // namespace blink |
OLD | NEW |