| 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 14 matching lines...) Expand all Loading... |
| 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/ImageAnimationPolicy.h" |
| 35 #include "platform/graphics/ImageObserver.h" |
| 35 #include "platform/graphics/ImageOrientation.h" | 36 #include "platform/graphics/ImageOrientation.h" |
| 36 #include "third_party/skia/include/core/SkCanvas.h" | 37 #include "third_party/skia/include/core/SkCanvas.h" |
| 37 #include "wtf/Assertions.h" | 38 #include "wtf/Assertions.h" |
| 38 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
| 39 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
| 40 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
| 41 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
| 42 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
| 43 | 44 |
| 44 class SkBitmap; | 45 class SkBitmap; |
| 45 class SkImage; | 46 class SkImage; |
| 46 | 47 |
| 47 namespace blink { | 48 namespace blink { |
| 48 | 49 |
| 49 class FloatPoint; | 50 class FloatPoint; |
| 50 class FloatRect; | 51 class FloatRect; |
| 51 class FloatSize; | 52 class FloatSize; |
| 52 class GraphicsContext; | 53 class GraphicsContext; |
| 53 class Length; | 54 class Length; |
| 54 class SharedBuffer; | 55 class SharedBuffer; |
| 55 class Image; | 56 class Image; |
| 56 | 57 |
| 57 // This class gets notified when an image creates or destroys decoded frames and
when it advances animation frames. | |
| 58 class ImageObserver; | |
| 59 | |
| 60 class PLATFORM_EXPORT Image : public RefCounted<Image> { | 58 class PLATFORM_EXPORT Image : public RefCounted<Image> { |
| 61 friend class GeneratedImage; | 59 friend class GeneratedImage; |
| 62 friend class CrossfadeGeneratedImage; | 60 friend class CrossfadeGeneratedImage; |
| 63 friend class GradientGeneratedImage; | 61 friend class GradientGeneratedImage; |
| 64 friend class GraphicsContext; | 62 friend class GraphicsContext; |
| 65 WTF_MAKE_NONCOPYABLE(Image); | 63 WTF_MAKE_NONCOPYABLE(Image); |
| 66 | 64 |
| 67 public: | 65 public: |
| 68 virtual ~Image(); | 66 virtual ~Image(); |
| 69 | 67 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 156 |
| 159 protected: | 157 protected: |
| 160 Image(ImageObserver* = 0); | 158 Image(ImageObserver* = 0); |
| 161 | 159 |
| 162 void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatPoint&
srcPoint, const FloatSize& tileSize, | 160 void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatPoint&
srcPoint, const FloatSize& tileSize, |
| 163 SkXfermode::Mode, const FloatSize& repeatSpacing); | 161 SkXfermode::Mode, const FloatSize& repeatSpacing); |
| 164 void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatRect&
srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, SkXfe
rmode::Mode); | 162 void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatRect&
srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, SkXfe
rmode::Mode); |
| 165 | 163 |
| 166 private: | 164 private: |
| 167 RefPtr<SharedBuffer> m_encodedImageData; | 165 RefPtr<SharedBuffer> m_encodedImageData; |
| 168 ImageObserver* m_imageObserver; | 166 RawPtrWillBeWeakPersistent<ImageObserver> m_imageObserver; |
| 169 }; | 167 }; |
| 170 | 168 |
| 171 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 169 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
| 172 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) | 170 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) |
| 173 | 171 |
| 174 } // namespace blink | 172 } // namespace blink |
| 175 | 173 |
| 176 #endif | 174 #endif |
| OLD | NEW |