| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer;
} | 111 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer;
} |
| 112 | 112 |
| 113 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; | 113 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; |
| 114 | 114 |
| 115 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu
llptr; } | 115 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu
llptr; } |
| 116 | 116 |
| 117 virtual void drawPattern(GraphicsContext*, const FloatRect&, | 117 virtual void drawPattern(GraphicsContext*, const FloatRect&, |
| 118 const FloatSize&, const FloatPoint& phase, CompositeOperator, | 118 const FloatSize&, const FloatPoint& phase, CompositeOperator, |
| 119 const FloatRect&, blink::WebBlendMode = blink::WebBlendModeNormal, const
IntSize& repeatSpacing = IntSize()); | 119 const FloatRect&, blink::WebBlendMode = blink::WebBlendModeNormal, const
IntSize& repeatSpacing = IntSize()); |
| 120 | 120 |
| 121 #if !ASSERT_DISABLED | 121 #if ASSERT_ENABLED |
| 122 virtual bool notSolidColor() { return true; } | 122 virtual bool notSolidColor() { return true; } |
| 123 #endif | 123 #endif |
| 124 | 124 |
| 125 protected: | 125 protected: |
| 126 Image(ImageObserver* = 0); | 126 Image(ImageObserver* = 0); |
| 127 | 127 |
| 128 static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, c
onst Color&, CompositeOperator); | 128 static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, c
onst Color&, CompositeOperator); |
| 129 static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method
for translating negative width and height values. | 129 static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method
for translating negative width and height values. |
| 130 | 130 |
| 131 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec
t& srcRect, CompositeOperator, blink::WebBlendMode) = 0; | 131 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec
t& srcRect, CompositeOperator, blink::WebBlendMode) = 0; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 142 RefPtr<SharedBuffer> m_encodedImageData; | 142 RefPtr<SharedBuffer> m_encodedImageData; |
| 143 ImageObserver* m_imageObserver; | 143 ImageObserver* m_imageObserver; |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 146 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
| 147 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) | 147 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) |
| 148 | 148 |
| 149 } | 149 } |
| 150 | 150 |
| 151 #endif | 151 #endif |
| OLD | NEW |