Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: Source/platform/graphics/Image.h

Issue 892783003: Check the condition for animation policy of bitmapImage on notifyFinished. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move updating policy to ImageLoader Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/graphics/BitmapImageTest.cpp ('k') | Source/platform/graphics/ImageObserver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #ifndef Image_h 27 #ifndef Image_h
28 #define Image_h 28 #define Image_h
29 29
30 #include "platform/PlatformExport.h" 30 #include "platform/PlatformExport.h"
31 #include "platform/geometry/IntRect.h" 31 #include "platform/geometry/IntRect.h"
32 #include "platform/graphics/Color.h" 32 #include "platform/graphics/Color.h"
33 #include "platform/graphics/GraphicsTypes.h" 33 #include "platform/graphics/GraphicsTypes.h"
34 #include "platform/graphics/ImageAnimationPolicy.h"
34 #include "platform/graphics/ImageOrientation.h" 35 #include "platform/graphics/ImageOrientation.h"
35 #include "platform/graphics/skia/NativeImageSkia.h" 36 #include "platform/graphics/skia/NativeImageSkia.h"
36 #include "third_party/skia/include/core/SkXfermode.h" 37 #include "third_party/skia/include/core/SkXfermode.h"
37 #include "wtf/Assertions.h" 38 #include "wtf/Assertions.h"
38 #include "wtf/PassRefPtr.h" 39 #include "wtf/PassRefPtr.h"
39 #include "wtf/RefCounted.h" 40 #include "wtf/RefCounted.h"
40 #include "wtf/RefPtr.h" 41 #include "wtf/RefPtr.h"
41 #include "wtf/RetainPtr.h" 42 #include "wtf/RetainPtr.h"
42 #include "wtf/text/WTFString.h" 43 #include "wtf/text/WTFString.h"
43 44
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // Animation begins whenever someone draws the image, so startAnimation() is not normally called. 109 // Animation begins whenever someone draws the image, so startAnimation() is not normally called.
109 // It will automatically pause once all observers no longer want to render t he image anywhere. 110 // It will automatically pause once all observers no longer want to render t he image anywhere.
110 enum CatchUpAnimation { DoNotCatchUp, CatchUp }; 111 enum CatchUpAnimation { DoNotCatchUp, CatchUp };
111 virtual void startAnimation(CatchUpAnimation = CatchUp) { } 112 virtual void startAnimation(CatchUpAnimation = CatchUp) { }
112 virtual void stopAnimation() {} 113 virtual void stopAnimation() {}
113 virtual void resetAnimation() {} 114 virtual void resetAnimation() {}
114 115
115 // True if this image can potentially animate. 116 // True if this image can potentially animate.
116 virtual bool maybeAnimated() { return false; } 117 virtual bool maybeAnimated() { return false; }
117 118
119 // Set animationPolicy
120 virtual void setAnimationPolicy(ImageAnimationPolicy) { }
121 virtual ImageAnimationPolicy animationPolicy() { return ImageAnimationPolicy Allowed; }
122
118 // Typically the ImageResource that owns us. 123 // Typically the ImageResource that owns us.
119 ImageObserver* imageObserver() const { return m_imageObserver; } 124 ImageObserver* imageObserver() const { return m_imageObserver; }
120 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; } 125 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; }
121 126
122 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; 127 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
123 128
124 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu llptr; } 129 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu llptr; }
125 130
126 virtual PassRefPtr<Image> imageForDefaultFrame(); 131 virtual PassRefPtr<Image> imageForDefaultFrame();
127 132
(...skipping 24 matching lines...) Expand all
152 RefPtr<SharedBuffer> m_encodedImageData; 157 RefPtr<SharedBuffer> m_encodedImageData;
153 ImageObserver* m_imageObserver; 158 ImageObserver* m_imageObserver;
154 }; 159 };
155 160
156 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 161 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
157 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) 162 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName())
158 163
159 } // namespace blink 164 } // namespace blink
160 165
161 #endif 166 #endif
OLDNEW
« no previous file with comments | « Source/platform/graphics/BitmapImageTest.cpp ('k') | Source/platform/graphics/ImageObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698