| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 SVGImage(ImageObserver*); | 110 SVGImage(ImageObserver*); |
| 111 void draw(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatR
ect& toRect, RespectImageOrientationEnum, ImageClampingMode) override; | 111 void draw(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatR
ect& toRect, RespectImageOrientationEnum, ImageClampingMode) override; |
| 112 void drawForContainer(SkCanvas*, const SkPaint&, const FloatSize, float, con
st FloatRect&, const FloatRect&, const KURL&); | 112 void drawForContainer(SkCanvas*, const SkPaint&, const FloatSize, float, con
st FloatRect&, const FloatRect&, const KURL&); |
| 113 void drawPatternForContainer(GraphicsContext&, const FloatSize, float, const
FloatRect&, const FloatSize&, const FloatPoint&, | 113 void drawPatternForContainer(GraphicsContext&, const FloatSize, float, const
FloatRect&, const FloatSize&, const FloatPoint&, |
| 114 SkXfermode::Mode, const FloatRect&, const FloatSize& repeatSpacing, cons
t KURL&); | 114 SkXfermode::Mode, const FloatRect&, const FloatSize& repeatSpacing, cons
t KURL&); |
| 115 PassRefPtr<SkImage> imageForCurrentFrameForContainer(const KURL&, const Floa
tSize& containerSize); | 115 PassRefPtr<SkImage> imageForCurrentFrameForContainer(const KURL&, const Floa
tSize& containerSize); |
| 116 void drawInternal(SkCanvas*, const SkPaint&, const FloatRect& fromRect, cons
t FloatRect& toRect, RespectImageOrientationEnum, | 116 void drawInternal(SkCanvas*, const SkPaint&, const FloatRect& fromRect, cons
t FloatRect& toRect, RespectImageOrientationEnum, |
| 117 ImageClampingMode, const KURL&); | 117 ImageClampingMode, const KURL&); |
| 118 | 118 |
| 119 OwnPtrWillBePersistent<SVGImageChromeClient> m_chromeClient; | 119 Persistent<SVGImageChromeClient> m_chromeClient; |
| 120 OwnPtrWillBePersistent<Page> m_page; | 120 Persistent<Page> m_page; |
| 121 | 121 |
| 122 // When an SVG image has no intrinsic size the size depends on the | 122 // When an SVG image has no intrinsic size the size depends on the |
| 123 // default object size, which in turn depends on the | 123 // default object size, which in turn depends on the |
| 124 // container. SVGImage may belong to multiple containers so the | 124 // container. SVGImage may belong to multiple containers so the |
| 125 // final image size can't be known in | 125 // final image size can't be known in |
| 126 // SVGImage. SVGImageForContainer carried the final image size, | 126 // SVGImage. SVGImageForContainer carried the final image size, |
| 127 // also called concrete object size. | 127 // also called concrete object size. |
| 128 IntSize m_intrinsicSize; | 128 IntSize m_intrinsicSize; |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 DEFINE_IMAGE_TYPE_CASTS(SVGImage); | 131 DEFINE_IMAGE_TYPE_CASTS(SVGImage); |
| 132 | 132 |
| 133 class ImageObserverDisabler { | 133 class ImageObserverDisabler { |
| 134 STACK_ALLOCATED(); | 134 STACK_ALLOCATED(); |
| 135 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); | 135 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); |
| 136 public: | 136 public: |
| 137 ImageObserverDisabler(Image* image) | 137 ImageObserverDisabler(Image* image) |
| 138 : m_image(image) | 138 : m_image(image) |
| 139 { | 139 { |
| 140 m_observer = m_image->getImageObserver(); | 140 m_observer = m_image->getImageObserver(); |
| 141 m_image->setImageObserver(0); | 141 m_image->setImageObserver(0); |
| 142 } | 142 } |
| 143 | 143 |
| 144 ~ImageObserverDisabler() | 144 ~ImageObserverDisabler() |
| 145 { | 145 { |
| 146 m_image->setImageObserver(m_observer); | 146 m_image->setImageObserver(m_observer); |
| 147 } | 147 } |
| 148 private: | 148 private: |
| 149 Image* m_image; | 149 Image* m_image; |
| 150 RawPtrWillBeMember<ImageObserver> m_observer; | 150 Member<ImageObserver> m_observer; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace blink | 153 } // namespace blink |
| 154 | 154 |
| 155 #endif // SVGImage_h | 155 #endif // SVGImage_h |
| OLD | NEW |