| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 ImageObserver* imageObserver() const { return m_imageObserver; } | 139 ImageObserver* imageObserver() const { return m_imageObserver; } |
| 140 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer;
} | 140 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer;
} |
| 141 | 141 |
| 142 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; | 142 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; |
| 143 | 143 |
| 144 virtual PassRefPtr<SkImage> imageForCurrentFrame() = 0; | 144 virtual PassRefPtr<SkImage> imageForCurrentFrame() = 0; |
| 145 virtual PassRefPtr<Image> imageForDefaultFrame(); | 145 virtual PassRefPtr<Image> imageForDefaultFrame(); |
| 146 | 146 |
| 147 virtual void drawPattern(GraphicsContext*, const FloatRect&, | 147 virtual void drawPattern(GraphicsContext*, const FloatRect&, |
| 148 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode, | 148 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode, |
| 149 const FloatRect&, const IntSize& repeatSpacing = IntSize()); | 149 const FloatRect&, const FloatSize& repeatSpacing = FloatSize()); |
| 150 | 150 |
| 151 enum ImageClampingMode { | 151 enum ImageClampingMode { |
| 152 ClampImageToSourceRect, | 152 ClampImageToSourceRect, |
| 153 DoNotClampImageToSourceRect | 153 DoNotClampImageToSourceRect |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 virtual void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const
FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) = 0; | 156 virtual void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const
FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) = 0; |
| 157 | 157 |
| 158 protected: | 158 protected: |
| 159 Image(ImageObserver* = 0); | 159 Image(ImageObserver* = 0); |
| 160 | 160 |
| 161 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint&
srcPoint, const FloatSize& tileSize, | 161 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint&
srcPoint, const FloatSize& tileSize, |
| 162 SkXfermode::Mode, const IntSize& repeatSpacing); | 162 SkXfermode::Mode, const FloatSize& repeatSpacing); |
| 163 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect&
srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, SkXfe
rmode::Mode); | 163 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect&
srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, SkXfe
rmode::Mode); |
| 164 | 164 |
| 165 private: | 165 private: |
| 166 RefPtr<SharedBuffer> m_encodedImageData; | 166 RefPtr<SharedBuffer> m_encodedImageData; |
| 167 ImageObserver* m_imageObserver; | 167 ImageObserver* m_imageObserver; |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 170 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
| 171 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) | 171 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) |
| 172 | 172 |
| 173 } // namespace blink | 173 } // namespace blink |
| 174 | 174 |
| 175 #endif | 175 #endif |
| OLD | NEW |