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 16 matching lines...) Expand all Loading... | |
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/ImageOrientation.h" | 34 #include "platform/graphics/ImageOrientation.h" |
35 #include "platform/graphics/skia/NativeImageSkia.h" | 35 #include "platform/graphics/skia/NativeImageSkia.h" |
36 #include "third_party/skia/include/core/SkXfermode.h" | 36 #include "third_party/skia/include/core/SkXfermode.h" |
37 #include "wtf/Assertions.h" | |
Ken Russell (switch to Gerrit)
2014/07/15 23:25:35
I'm pretty sure that based on compile failures see
| |
37 #include "wtf/PassRefPtr.h" | 38 #include "wtf/PassRefPtr.h" |
38 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
39 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
40 #include "wtf/RetainPtr.h" | 41 #include "wtf/RetainPtr.h" |
41 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
42 | 43 |
43 namespace WebCore { | 44 namespace WebCore { |
44 | 45 |
45 class FloatPoint; | 46 class FloatPoint; |
46 class FloatRect; | 47 class FloatRect; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; } | 112 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; } |
112 | 113 |
113 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; | 114 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; |
114 | 115 |
115 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu llptr; } | 116 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu llptr; } |
116 | 117 |
117 virtual void drawPattern(GraphicsContext*, const FloatRect&, | 118 virtual void drawPattern(GraphicsContext*, const FloatRect&, |
118 const FloatSize&, const FloatPoint& phase, CompositeOperator, | 119 const FloatSize&, const FloatPoint& phase, CompositeOperator, |
119 const FloatRect&, blink::WebBlendMode = blink::WebBlendModeNormal, const IntSize& repeatSpacing = IntSize()); | 120 const FloatRect&, blink::WebBlendMode = blink::WebBlendModeNormal, const IntSize& repeatSpacing = IntSize()); |
120 | 121 |
121 #if ASSERT_ENABLED | 122 #if ENABLE(ASSERT) |
122 virtual bool notSolidColor() { return true; } | 123 virtual bool notSolidColor() { return true; } |
123 #endif | 124 #endif |
124 | 125 |
125 protected: | 126 protected: |
126 Image(ImageObserver* = 0); | 127 Image(ImageObserver* = 0); |
127 | 128 |
128 static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, c onst Color&, CompositeOperator); | 129 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. | 130 static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method for translating negative width and height values. |
130 | 131 |
131 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec t& srcRect, CompositeOperator, blink::WebBlendMode) = 0; | 132 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; | 143 RefPtr<SharedBuffer> m_encodedImageData; |
143 ImageObserver* m_imageObserver; | 144 ImageObserver* m_imageObserver; |
144 }; | 145 }; |
145 | 146 |
146 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 147 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
147 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) | 148 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) |
148 | 149 |
149 } | 150 } |
150 | 151 |
151 #endif | 152 #endif |
OLD | NEW |