OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 virtual ImageAnimationPolicy animationPolicy() { | 132 virtual ImageAnimationPolicy animationPolicy() { |
133 return ImageAnimationPolicyAllowed; | 133 return ImageAnimationPolicyAllowed; |
134 } | 134 } |
135 virtual void advanceTime(double deltaTimeInSeconds) {} | 135 virtual void advanceTime(double deltaTimeInSeconds) {} |
136 | 136 |
137 // Advances an animated image. For BitmapImage (e.g., animated gifs) this | 137 // Advances an animated image. For BitmapImage (e.g., animated gifs) this |
138 // will advance to the next frame. For SVGImage, this will trigger an | 138 // will advance to the next frame. For SVGImage, this will trigger an |
139 // animation update for CSS and advance the SMIL timeline by one frame. | 139 // animation update for CSS and advance the SMIL timeline by one frame. |
140 virtual void advanceAnimationForTesting() {} | 140 virtual void advanceAnimationForTesting() {} |
141 | 141 |
142 // Typically the ImageResource that owns us. | 142 // Typically the ImageResourceContent that owns us. |
143 ImageObserver* getImageObserver() const { | 143 ImageObserver* getImageObserver() const { |
144 return m_imageObserverDisabled ? nullptr : m_imageObserver; | 144 return m_imageObserverDisabled ? nullptr : m_imageObserver; |
145 } | 145 } |
146 void clearImageObserver() { m_imageObserver = nullptr; } | 146 void clearImageObserver() { m_imageObserver = nullptr; } |
147 // To avoid interleaved accesses to |m_imageObserverDisabled|, do not call | 147 // To avoid interleaved accesses to |m_imageObserverDisabled|, do not call |
148 // setImageObserverDisabled() other than from ImageObserverDisabler. | 148 // setImageObserverDisabled() other than from ImageObserverDisabler. |
149 void setImageObserverDisabled(bool disabled) { | 149 void setImageObserverDisabled(bool disabled) { |
150 m_imageObserverDisabled = disabled; | 150 m_imageObserverDisabled = disabled; |
151 } | 151 } |
152 | 152 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 const FloatSize& tileScaleFactor, | 207 const FloatSize& tileScaleFactor, |
208 TileRule hRule, | 208 TileRule hRule, |
209 TileRule vRule, | 209 TileRule vRule, |
210 SkBlendMode); | 210 SkBlendMode); |
211 | 211 |
212 private: | 212 private: |
213 RefPtr<SharedBuffer> m_encodedImageData; | 213 RefPtr<SharedBuffer> m_encodedImageData; |
214 // TODO(Oilpan): consider having Image on the Oilpan heap and | 214 // TODO(Oilpan): consider having Image on the Oilpan heap and |
215 // turn this into a Member<>. | 215 // turn this into a Member<>. |
216 // | 216 // |
217 // The observer (an ImageResource) is an untraced member, with the | 217 // The observer (an ImageResourceContent) is an untraced member, with the |
218 // ImageResource being responsible for clearing itself out. | 218 // ImageResourceContent being responsible for clearing itself out. |
219 UntracedMember<ImageObserver> m_imageObserver; | 219 UntracedMember<ImageObserver> m_imageObserver; |
220 bool m_imageObserverDisabled; | 220 bool m_imageObserverDisabled; |
221 }; | 221 }; |
222 | 222 |
223 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 223 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
224 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), \ | 224 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), \ |
225 image.is##typeName()) | 225 image.is##typeName()) |
226 | 226 |
227 } // namespace blink | 227 } // namespace blink |
228 | 228 |
229 #endif | 229 #endif |
OLD | NEW |