OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef ImageBufferSurface_h | 31 #ifndef ImageBufferSurface_h |
32 #define ImageBufferSurface_h | 32 #define ImageBufferSurface_h |
33 | 33 |
34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
35 #include "platform/geometry/IntSize.h" | 35 #include "platform/geometry/IntSize.h" |
| 36 #include "platform/graphics/GraphicsTypes.h" |
36 #include "platform/graphics/GraphicsTypes3D.h" | 37 #include "platform/graphics/GraphicsTypes3D.h" |
37 #include "wtf/FastAllocBase.h" | 38 #include "wtf/FastAllocBase.h" |
38 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
39 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
40 | 41 |
41 class SkBitmap; | 42 class SkBitmap; |
42 class SkCanvas; | 43 class SkCanvas; |
43 class SkImage; | 44 class SkImage; |
44 class SkPicture; | 45 class SkPicture; |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
47 | 48 |
48 class ImageBuffer; | 49 class ImageBuffer; |
49 class WebLayer; | 50 class WebLayer; |
50 class FloatRect; | 51 class FloatRect; |
| 52 class GraphicsContext; |
51 | 53 |
52 enum OpacityMode { | 54 enum OpacityMode { |
53 NonOpaque, | 55 NonOpaque, |
54 Opaque, | 56 Opaque, |
55 }; | 57 }; |
56 | 58 |
57 class PLATFORM_EXPORT ImageBufferSurface { | 59 class PLATFORM_EXPORT ImageBufferSurface { |
58 WTF_MAKE_NONCOPYABLE(ImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; | 60 WTF_MAKE_NONCOPYABLE(ImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; |
59 public: | 61 public: |
60 virtual ~ImageBufferSurface(); | 62 virtual ~ImageBufferSurface(); |
(...skipping 12 matching lines...) Expand all Loading... |
73 virtual const SkBitmap& cachedBitmap() const; | 75 virtual const SkBitmap& cachedBitmap() const; |
74 virtual void invalidateCachedBitmap() { } | 76 virtual void invalidateCachedBitmap() { } |
75 virtual void updateCachedBitmapIfNeeded() { } | 77 virtual void updateCachedBitmapIfNeeded() { } |
76 virtual void setIsHidden(bool) { } | 78 virtual void setIsHidden(bool) { } |
77 virtual void setImageBuffer(ImageBuffer*) { } | 79 virtual void setImageBuffer(ImageBuffer*) { } |
78 virtual PassRefPtr<SkPicture> getPicture(); | 80 virtual PassRefPtr<SkPicture> getPicture(); |
79 virtual void didClearCanvas() { } | 81 virtual void didClearCanvas() { } |
80 virtual void finalizeFrame(const FloatRect &dirtyRect) { } | 82 virtual void finalizeFrame(const FloatRect &dirtyRect) { } |
81 virtual void willDrawVideo() { } | 83 virtual void willDrawVideo() { } |
82 virtual PassRefPtr<SkImage> newImageSnapshot() const; | 84 virtual PassRefPtr<SkImage> newImageSnapshot() const; |
| 85 virtual void draw(GraphicsContext*, const FloatRect& destRect, const FloatRe
ct& srcRect, CompositeOperator, WebBlendMode, bool needsCopy); |
83 | 86 |
84 OpacityMode opacityMode() const { return m_opacityMode; } | 87 OpacityMode opacityMode() const { return m_opacityMode; } |
85 const IntSize& size() const { return m_size; } | 88 const IntSize& size() const { return m_size; } |
86 void notifyIsValidChanged(bool isValid) const; | 89 void notifyIsValidChanged(bool isValid) const; |
87 | 90 |
88 protected: | 91 protected: |
89 ImageBufferSurface(const IntSize&, OpacityMode); | 92 ImageBufferSurface(const IntSize&, OpacityMode); |
90 void clear(); | 93 void clear(); |
91 | 94 |
92 private: | 95 private: |
93 OpacityMode m_opacityMode; | 96 OpacityMode m_opacityMode; |
94 IntSize m_size; | 97 IntSize m_size; |
95 }; | 98 }; |
96 | 99 |
97 } // namespace blink | 100 } // namespace blink |
98 | 101 |
99 #endif | 102 #endif |
OLD | NEW |