OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef FilterDisplayItem_h | 5 #ifndef FilterDisplayItem_h |
6 #define FilterDisplayItem_h | 6 #define FilterDisplayItem_h |
7 | 7 |
8 #include "platform/geometry/LayoutRect.h" | 8 #include "platform/geometry/LayoutRect.h" |
9 #include "platform/graphics/ImageFilter.h" | 9 #include "platform/graphics/ImageFilter.h" |
10 #include "platform/graphics/filters/FilterOperations.h" | 10 #include "platform/graphics/filters/FilterOperations.h" |
11 #include "platform/graphics/paint/DisplayItem.h" | 11 #include "platform/graphics/paint/DisplayItem.h" |
12 #include "public/platform/WebFilterOperations.h" | 12 #include "public/platform/WebFilterOperations.h" |
13 #include "wtf/PassOwnPtr.h" | 13 #include "wtf/PassOwnPtr.h" |
14 #include "wtf/PassRefPtr.h" | 14 #include "wtf/PassRefPtr.h" |
15 #ifndef NDEBUG | 15 #ifndef NDEBUG |
16 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
17 #endif | 17 #endif |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 class PLATFORM_EXPORT BeginFilterDisplayItem : public DisplayItem { | 21 class PLATFORM_EXPORT BeginFilterDisplayItem : public DisplayItem { |
22 WTF_MAKE_FAST_ALLOCATED; | 22 WTF_MAKE_FAST_ALLOCATED; |
23 public: | 23 public: |
24 static PassOwnPtr<BeginFilterDisplayItem> create(DisplayItemClient client, T
ype type, PassRefPtr<ImageFilter> imageFilter, const FilterOperations* filterOpe
rations, const LayoutRect& bounds) | 24 static PassOwnPtr<BeginFilterDisplayItem> create(DisplayItemClient client, T
ype type, PassRefPtr<ImageFilter> imageFilter, const LayoutRect& bounds) |
25 { | 25 { |
26 return adoptPtr(new BeginFilterDisplayItem(client, type, imageFilter, fi
lterOperations, bounds)); | 26 return adoptPtr(new BeginFilterDisplayItem(client, type, imageFilter, bo
unds)); |
27 } | 27 } |
28 | 28 |
29 BeginFilterDisplayItem(DisplayItemClient, Type, PassRefPtr<ImageFilter>, con
st FilterOperations*, const LayoutRect& bounds); | 29 static PassOwnPtr<BeginFilterDisplayItem> create(DisplayItemClient client, T
ype type, PassRefPtr<ImageFilter> imageFilter, const LayoutRect& bounds, const F
ilterOperations& filterOperations) |
| 30 { |
| 31 return adoptPtr(new BeginFilterDisplayItem(client, type, imageFilter, bo
unds, filterOperations)); |
| 32 } |
| 33 |
30 | 34 |
31 virtual void replay(GraphicsContext*) override; | 35 virtual void replay(GraphicsContext*) override; |
32 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 36 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
33 | 37 |
34 private: | 38 private: |
| 39 BeginFilterDisplayItem(DisplayItemClient, Type, PassRefPtr<ImageFilter>, con
st LayoutRect& bounds); |
| 40 BeginFilterDisplayItem(DisplayItemClient, Type, PassRefPtr<ImageFilter>, con
st LayoutRect& bounds, const FilterOperations&); |
| 41 |
35 #ifndef NDEBUG | 42 #ifndef NDEBUG |
36 virtual const char* name() const override { return "BeginFilter"; } | 43 virtual const char* name() const override { return "BeginFilter"; } |
37 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
; | 44 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
; |
38 #endif | 45 #endif |
39 | 46 |
40 // FIXME: m_imageFilter should be replaced with m_webFilterOperations when c
opying data to the compositor. | 47 // FIXME: m_imageFilter should be replaced with m_webFilterOperations when c
opying data to the compositor. |
41 RefPtr<ImageFilter> m_imageFilter; | 48 RefPtr<ImageFilter> m_imageFilter; |
42 OwnPtr<WebFilterOperations> m_webFilterOperations; | 49 OwnPtr<WebFilterOperations> m_webFilterOperations; |
43 const LayoutRect m_bounds; | 50 const LayoutRect m_bounds; |
44 }; | 51 }; |
(...skipping 14 matching lines...) Expand all Loading... |
59 | 66 |
60 private: | 67 private: |
61 #ifndef NDEBUG | 68 #ifndef NDEBUG |
62 virtual const char* name() const override { return "EndFilter"; } | 69 virtual const char* name() const override { return "EndFilter"; } |
63 #endif | 70 #endif |
64 }; | 71 }; |
65 | 72 |
66 } | 73 } |
67 | 74 |
68 #endif // FilterDisplayItem_h | 75 #endif // FilterDisplayItem_h |
OLD | NEW |