| 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 13 matching lines...) Expand all Loading... |
| 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/SharedBuffer.h" | 31 #include "platform/SharedBuffer.h" |
| 32 #include "platform/geometry/IntRect.h" | 32 #include "platform/geometry/IntRect.h" |
| 33 #include "platform/graphics/Color.h" | 33 #include "platform/graphics/Color.h" |
| 34 #include "platform/graphics/ColorBehavior.h" | |
| 35 #include "platform/graphics/GraphicsTypes.h" | 34 #include "platform/graphics/GraphicsTypes.h" |
| 36 #include "platform/graphics/ImageAnimationPolicy.h" | 35 #include "platform/graphics/ImageAnimationPolicy.h" |
| 37 #include "platform/graphics/ImageObserver.h" | 36 #include "platform/graphics/ImageObserver.h" |
| 38 #include "platform/graphics/ImageOrientation.h" | 37 #include "platform/graphics/ImageOrientation.h" |
| 39 #include "platform/graphics/paint/PaintCanvas.h" | 38 #include "platform/graphics/paint/PaintCanvas.h" |
| 40 #include "platform/graphics/paint/PaintFlags.h" | 39 #include "platform/graphics/paint/PaintFlags.h" |
| 41 #include "third_party/skia/include/core/SkRefCnt.h" | 40 #include "third_party/skia/include/core/SkRefCnt.h" |
| 42 #include "wtf/Assertions.h" | 41 #include "wtf/Assertions.h" |
| 43 #include "wtf/Noncopyable.h" | 42 #include "wtf/Noncopyable.h" |
| 44 #include "wtf/PassRefPtr.h" | 43 #include "wtf/PassRefPtr.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 144 } |
| 146 void clearImageObserver() { m_imageObserver = nullptr; } | 145 void clearImageObserver() { m_imageObserver = nullptr; } |
| 147 // To avoid interleaved accesses to |m_imageObserverDisabled|, do not call | 146 // To avoid interleaved accesses to |m_imageObserverDisabled|, do not call |
| 148 // setImageObserverDisabled() other than from ImageObserverDisabler. | 147 // setImageObserverDisabled() other than from ImageObserverDisabler. |
| 149 void setImageObserverDisabled(bool disabled) { | 148 void setImageObserverDisabled(bool disabled) { |
| 150 m_imageObserverDisabled = disabled; | 149 m_imageObserverDisabled = disabled; |
| 151 } | 150 } |
| 152 | 151 |
| 153 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; | 152 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; |
| 154 | 153 |
| 155 virtual sk_sp<SkImage> imageForCurrentFrame(const ColorBehavior&) = 0; | 154 virtual sk_sp<SkImage> imageForCurrentFrame() = 0; |
| 156 virtual PassRefPtr<Image> imageForDefaultFrame(); | 155 virtual PassRefPtr<Image> imageForDefaultFrame(); |
| 157 | 156 |
| 158 enum ImageClampingMode { | 157 enum ImageClampingMode { |
| 159 ClampImageToSourceRect, | 158 ClampImageToSourceRect, |
| 160 DoNotClampImageToSourceRect | 159 DoNotClampImageToSourceRect |
| 161 }; | 160 }; |
| 162 | 161 |
| 163 virtual void draw(PaintCanvas*, | 162 virtual void draw(PaintCanvas*, |
| 164 const PaintFlags&, | 163 const PaintFlags&, |
| 165 const FloatRect& dstRect, | 164 const FloatRect& dstRect, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 bool m_imageObserverDisabled; | 219 bool m_imageObserverDisabled; |
| 221 }; | 220 }; |
| 222 | 221 |
| 223 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 222 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
| 224 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), \ | 223 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), \ |
| 225 image.is##typeName()) | 224 image.is##typeName()) |
| 226 | 225 |
| 227 } // namespace blink | 226 } // namespace blink |
| 228 | 227 |
| 229 #endif | 228 #endif |
| OLD | NEW |