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

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

Issue 388253004: Drawing an animated image to a canvas now behave as expected (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Correcting bug and moving logic to HTMLImageElenemt Created 6 years, 5 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
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 virtual bool maybeAnimated() { return false; } 107 virtual bool maybeAnimated() { return false; }
108 108
109 // Typically the ImageResource that owns us. 109 // Typically the ImageResource that owns us.
110 ImageObserver* imageObserver() const { return m_imageObserver; } 110 ImageObserver* imageObserver() const { return m_imageObserver; }
111 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; } 111 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; }
112 112
113 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; 113 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
114 114
115 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu llptr; } 115 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu llptr; }
116 116
117 virtual PassRefPtr<Image> imageForDefaultFrame();
118
117 virtual void drawPattern(GraphicsContext*, const FloatRect&, 119 virtual void drawPattern(GraphicsContext*, const FloatRect&,
118 const FloatSize&, const FloatPoint& phase, CompositeOperator, 120 const FloatSize&, const FloatPoint& phase, CompositeOperator,
119 const FloatRect&, blink::WebBlendMode = blink::WebBlendModeNormal, const IntSize& repeatSpacing = IntSize()); 121 const FloatRect&, blink::WebBlendMode = blink::WebBlendModeNormal, const IntSize& repeatSpacing = IntSize());
120 122
121 #if ASSERT_ENABLED 123 #if ASSERT_ENABLED
122 virtual bool notSolidColor() { return true; } 124 virtual bool notSolidColor() { return true; }
123 #endif 125 #endif
124 126
125 protected: 127 protected:
126 Image(ImageObserver* = 0); 128 Image(ImageObserver* = 0);
(...skipping 15 matching lines...) Expand all
142 RefPtr<SharedBuffer> m_encodedImageData; 144 RefPtr<SharedBuffer> m_encodedImageData;
143 ImageObserver* m_imageObserver; 145 ImageObserver* m_imageObserver;
144 }; 146 };
145 147
146 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 148 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
147 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) 149 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName())
148 150
149 } 151 }
150 152
151 #endif 153 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698