| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> |
| 3 * Copyright (C) 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 { | 48 { |
| 49 return adoptRef(new SVGImage(observer)); | 49 return adoptRef(new SVGImage(observer)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 static bool isInSVGImage(const Node*); | 52 static bool isInSVGImage(const Node*); |
| 53 | 53 |
| 54 LayoutBox* embeddedContentBox() const; | 54 LayoutBox* embeddedContentBox() const; |
| 55 | 55 |
| 56 bool isSVGImage() const override { return true; } | 56 bool isSVGImage() const override { return true; } |
| 57 IntSize size() const override { return m_intrinsicSize; } | 57 IntSize size() const override { return m_intrinsicSize; } |
| 58 void setURL(const KURL& url) { m_url = url; } | |
| 59 | 58 |
| 60 bool currentFrameHasSingleSecurityOrigin() const override; | 59 bool currentFrameHasSingleSecurityOrigin() const override; |
| 61 | 60 |
| 62 void startAnimation(CatchUpAnimation = CatchUp) override; | 61 void startAnimation(CatchUpAnimation = CatchUp) override; |
| 63 void stopAnimation() override; | 62 void stopAnimation() override; |
| 64 void resetAnimation() override; | 63 void resetAnimation() override; |
| 65 | 64 |
| 66 PassRefPtr<SkImage> imageForCurrentFrame() override; | 65 PassRefPtr<SkImage> imageForCurrentFrame() override; |
| 67 | 66 |
| 68 // Returns the SVG image document's frame. | 67 // Returns the SVG image document's frame. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 94 | 93 |
| 95 // FIXME: SVGImages are underreporting decoded sizes and will be unable | 94 // FIXME: SVGImages are underreporting decoded sizes and will be unable |
| 96 // to prune because these functions are not implemented yet. | 95 // to prune because these functions are not implemented yet. |
| 97 void destroyDecodedData(bool) override { } | 96 void destroyDecodedData(bool) override { } |
| 98 | 97 |
| 99 // FIXME: Implement this to be less conservative. | 98 // FIXME: Implement this to be less conservative. |
| 100 bool currentFrameKnownToBeOpaque() override { return false; } | 99 bool currentFrameKnownToBeOpaque() override { return false; } |
| 101 | 100 |
| 102 SVGImage(ImageObserver*); | 101 SVGImage(ImageObserver*); |
| 103 void draw(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatR
ect& toRect, RespectImageOrientationEnum, ImageClampingMode) override; | 102 void draw(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatR
ect& toRect, RespectImageOrientationEnum, ImageClampingMode) override; |
| 104 void drawForContainer(SkCanvas*, const SkPaint&, const FloatSize, float, con
st FloatRect&, const FloatRect&); | 103 void drawForContainer(SkCanvas*, const SkPaint&, const FloatSize, float, con
st FloatRect&, const FloatRect&, const KURL& urlWithFragment); |
| 105 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const
FloatRect&, const FloatSize&, const FloatPoint&, | 104 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const
FloatRect&, const FloatSize&, const FloatPoint&, |
| 106 SkXfermode::Mode, const FloatRect&, const IntSize& repeatSpacing); | 105 SkXfermode::Mode, const FloatRect&, const IntSize& repeatSpacing, const
KURL& urlWithFragment); |
| 106 void drawInternal(SkCanvas*, const SkPaint&, const FloatRect& fromRect, cons
t FloatRect& toRect, RespectImageOrientationEnum, ImageClampingMode); |
| 107 | 107 |
| 108 OwnPtrWillBePersistent<SVGImageChromeClient> m_chromeClient; | 108 OwnPtrWillBePersistent<SVGImageChromeClient> m_chromeClient; |
| 109 OwnPtrWillBePersistent<Page> m_page; | 109 OwnPtrWillBePersistent<Page> m_page; |
| 110 IntSize m_intrinsicSize; | 110 IntSize m_intrinsicSize; |
| 111 KURL m_url; | |
| 112 }; | 111 }; |
| 113 | 112 |
| 114 DEFINE_IMAGE_TYPE_CASTS(SVGImage); | 113 DEFINE_IMAGE_TYPE_CASTS(SVGImage); |
| 115 | 114 |
| 116 class ImageObserverDisabler { | 115 class ImageObserverDisabler { |
| 117 STACK_ALLOCATED(); | 116 STACK_ALLOCATED(); |
| 118 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); | 117 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); |
| 119 public: | 118 public: |
| 120 ImageObserverDisabler(Image* image) | 119 ImageObserverDisabler(Image* image) |
| 121 : m_image(image) | 120 : m_image(image) |
| 122 { | 121 { |
| 123 m_observer = m_image->imageObserver(); | 122 m_observer = m_image->imageObserver(); |
| 124 m_image->setImageObserver(0); | 123 m_image->setImageObserver(0); |
| 125 } | 124 } |
| 126 | 125 |
| 127 ~ImageObserverDisabler() | 126 ~ImageObserverDisabler() |
| 128 { | 127 { |
| 129 m_image->setImageObserver(m_observer); | 128 m_image->setImageObserver(m_observer); |
| 130 } | 129 } |
| 131 private: | 130 private: |
| 132 Image* m_image; | 131 Image* m_image; |
| 133 ImageObserver* m_observer; | 132 ImageObserver* m_observer; |
| 134 }; | 133 }; |
| 135 | 134 |
| 136 } | 135 } |
| 137 | 136 |
| 138 #endif // SVGImage_h | 137 #endif // SVGImage_h |
| OLD | NEW |