| 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 24 matching lines...) Expand all Loading... |
| 93 bool dataChanged(bool allDataReceived) override; | 92 bool dataChanged(bool allDataReceived) override; |
| 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, const KURL&) overri
de; |
| 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&); |
| 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&); |
| 107 | 106 |
| 108 OwnPtrWillBePersistent<SVGImageChromeClient> m_chromeClient; | 107 OwnPtrWillBePersistent<SVGImageChromeClient> m_chromeClient; |
| 109 OwnPtrWillBePersistent<Page> m_page; | 108 OwnPtrWillBePersistent<Page> m_page; |
| 110 IntSize m_intrinsicSize; | 109 IntSize m_intrinsicSize; |
| 111 KURL m_url; | |
| 112 }; | 110 }; |
| 113 | 111 |
| 114 DEFINE_IMAGE_TYPE_CASTS(SVGImage); | 112 DEFINE_IMAGE_TYPE_CASTS(SVGImage); |
| 115 | 113 |
| 116 class ImageObserverDisabler { | 114 class ImageObserverDisabler { |
| 117 STACK_ALLOCATED(); | 115 STACK_ALLOCATED(); |
| 118 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); | 116 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); |
| 119 public: | 117 public: |
| 120 ImageObserverDisabler(Image* image) | 118 ImageObserverDisabler(Image* image) |
| 121 : m_image(image) | 119 : m_image(image) |
| 122 { | 120 { |
| 123 m_observer = m_image->imageObserver(); | 121 m_observer = m_image->imageObserver(); |
| 124 m_image->setImageObserver(0); | 122 m_image->setImageObserver(0); |
| 125 } | 123 } |
| 126 | 124 |
| 127 ~ImageObserverDisabler() | 125 ~ImageObserverDisabler() |
| 128 { | 126 { |
| 129 m_image->setImageObserver(m_observer); | 127 m_image->setImageObserver(m_observer); |
| 130 } | 128 } |
| 131 private: | 129 private: |
| 132 Image* m_image; | 130 Image* m_image; |
| 133 ImageObserver* m_observer; | 131 ImageObserver* m_observer; |
| 134 }; | 132 }; |
| 135 | 133 |
| 136 } | 134 } |
| 137 | 135 |
| 138 #endif // SVGImage_h | 136 #endif // SVGImage_h |
| OLD | NEW |