OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
27 * SUCH DAMAGE. | 27 * SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #ifndef PaintLayerFilterInfo_h | 30 #ifndef PaintLayerFilterInfo_h |
31 #define PaintLayerFilterInfo_h | 31 #define PaintLayerFilterInfo_h |
32 | 32 |
33 #include "core/svg/SVGResourceClient.h" | 33 #include "core/svg/SVGResourceClient.h" |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
36 #include "wtf/PassRefPtr.h" | |
37 #include "wtf/RefPtr.h" | |
38 | 36 |
39 namespace blink { | 37 namespace blink { |
40 | 38 |
41 class FilterEffectBuilder; | 39 class FilterEffect; |
42 class FilterOperations; | 40 class FilterOperations; |
43 class PaintLayer; | 41 class PaintLayer; |
44 | 42 |
45 // PaintLayerFilterInfo holds the filter information for painting. | 43 // PaintLayerFilterInfo holds the filter information for painting. |
46 // https://drafts.fxtf.org/filters/ | 44 // https://drafts.fxtf.org/filters/ |
47 // | 45 // |
48 // Because PaintLayer is not allocated for SVG objects, SVG filters (both | 46 // Because PaintLayer is not allocated for SVG objects, SVG filters (both |
49 // software and hardware-accelerated) use a different code path to paint the | 47 // software and hardware-accelerated) use a different code path to paint the |
50 // filters (SVGFilterPainter), but both code paths use the same abstraction for | 48 // filters (SVGFilterPainter), but both code paths use the same abstraction for |
51 // painting non-hardware accelerated filters (FilterEffect). Hardware | 49 // painting non-hardware accelerated filters (FilterEffect). Hardware |
52 // accelerated CSS filters use CompositorFilterOperations, that is backed by cc. | 50 // accelerated CSS filters use CompositorFilterOperations, that is backed by cc. |
53 // | 51 // |
54 class PaintLayerFilterInfo final : public GarbageCollectedFinalized<PaintLayerFi
lterInfo>, public SVGResourceClient { | 52 class PaintLayerFilterInfo final : public GarbageCollectedFinalized<PaintLayerFi
lterInfo>, public SVGResourceClient { |
55 WTF_MAKE_NONCOPYABLE(PaintLayerFilterInfo); | 53 WTF_MAKE_NONCOPYABLE(PaintLayerFilterInfo); |
56 USING_GARBAGE_COLLECTED_MIXIN(PaintLayerFilterInfo); | 54 USING_GARBAGE_COLLECTED_MIXIN(PaintLayerFilterInfo); |
57 public: | 55 public: |
58 explicit PaintLayerFilterInfo(PaintLayer*); | 56 explicit PaintLayerFilterInfo(PaintLayer*); |
59 ~PaintLayerFilterInfo() override; | 57 ~PaintLayerFilterInfo() override; |
60 | 58 |
61 FilterEffectBuilder* builder() const { return m_builder.get(); } | 59 FilterEffect* lastEffect() const { return m_lastEffect; } |
62 void setBuilder(FilterEffectBuilder*); | 60 void setLastEffect(FilterEffect*); |
63 | 61 |
64 void updateReferenceFilterClients(const FilterOperations&); | 62 void updateReferenceFilterClients(const FilterOperations&); |
65 void clearLayer() { m_layer = nullptr; } | 63 void clearLayer() { m_layer = nullptr; } |
66 | 64 |
67 void filterNeedsInvalidation() override; | 65 void filterNeedsInvalidation() override; |
68 | 66 |
69 DECLARE_TRACE(); | 67 DECLARE_TRACE(); |
70 | 68 |
71 private: | 69 private: |
72 // |clearLayer| must be called before *m_layer becomes invalid. | 70 // |clearLayer| must be called before *m_layer becomes invalid. |
73 PaintLayer* m_layer; | 71 PaintLayer* m_layer; |
74 Member<FilterEffectBuilder> m_builder; | 72 Member<FilterEffect> m_lastEffect; |
75 }; | 73 }; |
76 | 74 |
77 } // namespace blink | 75 } // namespace blink |
78 | 76 |
79 | 77 |
80 #endif // PaintLayerFilterInfo_h | 78 #endif // PaintLayerFilterInfo_h |
OLD | NEW |