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 * Copyright (C) 2008-2009 Torch Mobile, Inc. | 4 * Copyright (C) 2008-2009 Torch Mobile, Inc. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 bool maybeAnimated() override; | 78 bool maybeAnimated() override; |
79 | 79 |
80 void setAnimationPolicy(ImageAnimationPolicy policy) override { m_animationP
olicy = policy; } | 80 void setAnimationPolicy(ImageAnimationPolicy policy) override { m_animationP
olicy = policy; } |
81 ImageAnimationPolicy animationPolicy() override { return m_animationPolicy;
} | 81 ImageAnimationPolicy animationPolicy() override { return m_animationPolicy;
} |
82 void advanceTime(double deltaTimeInSeconds) override; | 82 void advanceTime(double deltaTimeInSeconds) override; |
83 | 83 |
84 PassRefPtr<SkImage> imageForCurrentFrame() override; | 84 PassRefPtr<SkImage> imageForCurrentFrame() override; |
85 PassRefPtr<Image> imageForDefaultFrame() override; | 85 PassRefPtr<Image> imageForDefaultFrame() override; |
86 | 86 |
87 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override
; | 87 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override
; |
88 bool currentFrameIsComplete() override; | 88 bool currentFrameIsFullyReceived() override; |
89 bool currentFrameIsLazyDecoded() override; | 89 bool currentFrameIsLazyDecoded() override; |
90 | 90 |
91 ImageOrientation currentFrameOrientation(); | 91 ImageOrientation currentFrameOrientation(); |
92 | 92 |
93 // Construct a BitmapImage with the given orientation. | 93 // Construct a BitmapImage with the given orientation. |
94 static PassRefPtr<BitmapImage> createWithOrientationForTesting(const SkBitma
p&, ImageOrientation); | 94 static PassRefPtr<BitmapImage> createWithOrientationForTesting(const SkBitma
p&, ImageOrientation); |
95 // Advance the image animation by one frame. | 95 // Advance the image animation by one frame. |
96 void advanceAnimationForTesting() override { internalAdvanceAnimation(false)
; } | 96 void advanceAnimationForTesting() override { internalAdvanceAnimation(false)
; } |
97 | 97 |
98 private: | 98 private: |
(...skipping 11 matching lines...) Expand all Loading... |
110 BitmapImage(const SkBitmap &, ImageObserver* = 0); | 110 BitmapImage(const SkBitmap &, ImageObserver* = 0); |
111 BitmapImage(ImageObserver* = 0); | 111 BitmapImage(ImageObserver* = 0); |
112 | 112 |
113 void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRe
ct& srcRect, RespectImageOrientationEnum, ImageClampingMode) override; | 113 void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRe
ct& srcRect, RespectImageOrientationEnum, ImageClampingMode) override; |
114 | 114 |
115 size_t currentFrame() const { return m_currentFrame; } | 115 size_t currentFrame() const { return m_currentFrame; } |
116 size_t frameCount(); | 116 size_t frameCount(); |
117 | 117 |
118 PassRefPtr<SkImage> frameAtIndex(size_t); | 118 PassRefPtr<SkImage> frameAtIndex(size_t); |
119 | 119 |
120 bool frameIsCompleteAtIndex(size_t); | 120 bool frameIsFullyReceivedAtIndex(size_t); |
121 float frameDurationAtIndex(size_t); | 121 float frameDurationAtIndex(size_t); |
122 bool frameHasAlphaAtIndex(size_t); | 122 bool frameHasAlphaAtIndex(size_t); |
123 ImageOrientation frameOrientationAtIndex(size_t); | 123 ImageOrientation frameOrientationAtIndex(size_t); |
124 | 124 |
125 // Decodes and caches a frame. Never accessed except internally. | 125 // Decodes and caches a frame. Never accessed except internally. |
126 void cacheFrame(size_t index); | 126 void cacheFrame(size_t index); |
127 | 127 |
128 // Called before accessing m_frames[index]. Returns false on index out of bo
unds. | 128 // Called before accessing m_frames[index]. Returns false on index out of bo
unds. |
129 bool ensureFrameIsCached(size_t index); | 129 bool ensureFrameIsCached(size_t index); |
130 | 130 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 bool m_sizeAvailable : 1; // Whether or not we can obtain the size of the fi
rst image frame yet from ImageIO. | 189 bool m_sizeAvailable : 1; // Whether or not we can obtain the size of the fi
rst image frame yet from ImageIO. |
190 mutable bool m_hasUniformFrameSize : 1; | 190 mutable bool m_hasUniformFrameSize : 1; |
191 mutable bool m_haveFrameCount : 1; | 191 mutable bool m_haveFrameCount : 1; |
192 }; | 192 }; |
193 | 193 |
194 DEFINE_IMAGE_TYPE_CASTS(BitmapImage); | 194 DEFINE_IMAGE_TYPE_CASTS(BitmapImage); |
195 | 195 |
196 } // namespace blink | 196 } // namespace blink |
197 | 197 |
198 #endif | 198 #endif |
OLD | NEW |