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 17 matching lines...) Expand all Loading... |
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/GraphicsTypes.h" | 34 #include "platform/graphics/GraphicsTypes.h" |
35 #include "platform/graphics/ImageAnimationPolicy.h" | 35 #include "platform/graphics/ImageAnimationPolicy.h" |
36 #include "platform/graphics/ImageObserver.h" | 36 #include "platform/graphics/ImageObserver.h" |
37 #include "platform/graphics/ImageOrientation.h" | 37 #include "platform/graphics/ImageOrientation.h" |
| 38 #include "third_party/skia/include/core/SkRefCnt.h" |
38 #include "wtf/Assertions.h" | 39 #include "wtf/Assertions.h" |
39 #include "wtf/Noncopyable.h" | 40 #include "wtf/Noncopyable.h" |
40 #include "wtf/PassRefPtr.h" | 41 #include "wtf/PassRefPtr.h" |
41 #include "wtf/RefCounted.h" | 42 #include "wtf/RefCounted.h" |
42 #include "wtf/RefPtr.h" | 43 #include "wtf/RefPtr.h" |
43 #include "wtf/text/WTFString.h" | 44 #include "wtf/text/WTFString.h" |
44 | 45 |
45 class SkBitmap; | 46 class SkBitmap; |
46 class SkCanvas; | 47 class SkCanvas; |
47 class SkImage; | 48 class SkImage; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 virtual void advanceAnimationForTesting() { } | 135 virtual void advanceAnimationForTesting() { } |
135 | 136 |
136 // Typically the ImageResource that owns us. | 137 // Typically the ImageResource that owns us. |
137 ImageObserver* getImageObserver() const { return m_imageObserverDisabled ? n
ullptr : m_imageObserver; } | 138 ImageObserver* getImageObserver() const { return m_imageObserverDisabled ? n
ullptr : m_imageObserver; } |
138 void clearImageObserver() { m_imageObserver = nullptr; } | 139 void clearImageObserver() { m_imageObserver = nullptr; } |
139 // Do not call setImageObserverDisabled() other than from ImageObserverDisab
ler to avoid interleaved accesses to |m_imageObserverDisabled|. | 140 // Do not call setImageObserverDisabled() other than from ImageObserverDisab
ler to avoid interleaved accesses to |m_imageObserverDisabled|. |
140 void setImageObserverDisabled(bool disabled) { m_imageObserverDisabled = dis
abled; } | 141 void setImageObserverDisabled(bool disabled) { m_imageObserverDisabled = dis
abled; } |
141 | 142 |
142 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; | 143 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; |
143 | 144 |
144 virtual PassRefPtr<SkImage> imageForCurrentFrame() = 0; | 145 virtual sk_sp<SkImage> imageForCurrentFrame() = 0; |
145 virtual PassRefPtr<Image> imageForDefaultFrame(); | 146 virtual PassRefPtr<Image> imageForDefaultFrame(); |
146 | 147 |
147 virtual void drawPattern(GraphicsContext&, const FloatRect&, | 148 virtual void drawPattern(GraphicsContext&, const FloatRect&, |
148 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode, | 149 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode, |
149 const FloatRect&, const FloatSize& repeatSpacing = FloatSize()); | 150 const FloatRect&, const FloatSize& repeatSpacing = FloatSize()); |
150 | 151 |
151 enum ImageClampingMode { | 152 enum ImageClampingMode { |
152 ClampImageToSourceRect, | 153 ClampImageToSourceRect, |
153 DoNotClampImageToSourceRect | 154 DoNotClampImageToSourceRect |
154 }; | 155 }; |
(...skipping 30 matching lines...) Expand all Loading... |
185 UntracedMember<ImageObserver> m_imageObserver; | 186 UntracedMember<ImageObserver> m_imageObserver; |
186 bool m_imageObserverDisabled; | 187 bool m_imageObserverDisabled; |
187 }; | 188 }; |
188 | 189 |
189 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 190 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
190 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) | 191 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) |
191 | 192 |
192 } // namespace blink | 193 } // namespace blink |
193 | 194 |
194 #endif | 195 #endif |
OLD | NEW |