| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 ImageObserver* imageObserver() const { return m_imageObserver; } | 119 ImageObserver* imageObserver() const { return m_imageObserver; } |
| 120 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer;
} | 120 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer;
} |
| 121 | 121 |
| 122 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; | 122 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; |
| 123 | 123 |
| 124 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu
llptr; } | 124 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu
llptr; } |
| 125 | 125 |
| 126 virtual PassRefPtr<Image> imageForDefaultFrame(); | 126 virtual PassRefPtr<Image> imageForDefaultFrame(); |
| 127 | 127 |
| 128 virtual void drawPattern(GraphicsContext*, const FloatRect&, | 128 virtual void drawPattern(GraphicsContext*, const FloatRect&, |
| 129 const FloatSize&, const FloatPoint& phase, CompositeOperator, | 129 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode, |
| 130 const FloatRect&, WebBlendMode = WebBlendModeNormal, const IntSize& repe
atSpacing = IntSize()); | 130 const FloatRect&, const IntSize& repeatSpacing = IntSize()); |
| 131 | 131 |
| 132 #if ENABLE(ASSERT) | 132 #if ENABLE(ASSERT) |
| 133 virtual bool notSolidColor() { return true; } | 133 virtual bool notSolidColor() { return true; } |
| 134 #endif | 134 #endif |
| 135 | 135 |
| 136 protected: | 136 protected: |
| 137 Image(ImageObserver* = 0); | 137 Image(ImageObserver* = 0); |
| 138 | 138 |
| 139 static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, c
onst Color&, CompositeOperator); | 139 static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, c
onst Color&, SkXfermode::Mode); |
| 140 static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method
for translating negative width and height values. | 140 static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method
for translating negative width and height values. |
| 141 | 141 |
| 142 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec
t& srcRect, CompositeOperator, WebBlendMode, RespectImageOrientationEnum) = 0; | 142 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec
t& srcRect, SkXfermode::Mode, RespectImageOrientationEnum) = 0; |
| 143 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint&
srcPoint, const FloatSize& tileSize, | 143 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint&
srcPoint, const FloatSize& tileSize, |
| 144 CompositeOperator, WebBlendMode, const IntSize& repeatSpacing); | 144 SkXfermode::Mode, const IntSize& repeatSpacing); |
| 145 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect&
srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, Compo
siteOperator); | 145 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect&
srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, SkXfe
rmode::Mode); |
| 146 | 146 |
| 147 // Supporting tiled drawing | 147 // Supporting tiled drawing |
| 148 virtual bool mayFillWithSolidColor() { return false; } | 148 virtual bool mayFillWithSolidColor() { return false; } |
| 149 virtual Color solidColor() const { return Color(); } | 149 virtual Color solidColor() const { return Color(); } |
| 150 | 150 |
| 151 private: | 151 private: |
| 152 RefPtr<SharedBuffer> m_encodedImageData; | 152 RefPtr<SharedBuffer> m_encodedImageData; |
| 153 ImageObserver* m_imageObserver; | 153 ImageObserver* m_imageObserver; |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 156 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
| 157 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) | 157 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) |
| 158 | 158 |
| 159 } // namespace blink | 159 } // namespace blink |
| 160 | 160 |
| 161 #endif | 161 #endif |
| OLD | NEW |