| 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 19 matching lines...) Expand all Loading... |
| 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 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class FilterEffect; | 39 class FilterEffect; |
| 40 class FilterOperations; | |
| 41 class PaintLayer; | 40 class PaintLayer; |
| 42 | 41 |
| 43 // PaintLayerFilterInfo holds the filter information for painting. | 42 // PaintLayerFilterInfo holds the filter information for painting. |
| 44 // https://drafts.fxtf.org/filters/ | 43 // https://drafts.fxtf.org/filters/ |
| 45 // | 44 // |
| 46 // Because PaintLayer is not allocated for SVG objects, SVG filters (both | 45 // Because PaintLayer is not allocated for SVG objects, SVG filters (both |
| 47 // software and hardware-accelerated) use a different code path to paint the | 46 // software and hardware-accelerated) use a different code path to paint the |
| 48 // filters (SVGFilterPainter), but both code paths use the same abstraction for | 47 // filters (SVGFilterPainter), but both code paths use the same abstraction for |
| 49 // painting non-hardware accelerated filters (FilterEffect). Hardware | 48 // painting non-hardware accelerated filters (FilterEffect). Hardware |
| 50 // accelerated CSS filters use CompositorFilterOperations, that is backed by cc. | 49 // accelerated CSS filters use CompositorFilterOperations, that is backed by cc. |
| 51 // | 50 // |
| 52 class PaintLayerFilterInfo final | 51 class PaintLayerFilterInfo final |
| 53 : public GarbageCollectedFinalized<PaintLayerFilterInfo>, | 52 : public GarbageCollectedFinalized<PaintLayerFilterInfo>, |
| 54 public SVGResourceClient { | 53 public SVGResourceClient { |
| 55 WTF_MAKE_NONCOPYABLE(PaintLayerFilterInfo); | 54 WTF_MAKE_NONCOPYABLE(PaintLayerFilterInfo); |
| 56 USING_GARBAGE_COLLECTED_MIXIN(PaintLayerFilterInfo); | 55 USING_GARBAGE_COLLECTED_MIXIN(PaintLayerFilterInfo); |
| 57 | 56 |
| 58 public: | 57 public: |
| 59 explicit PaintLayerFilterInfo(PaintLayer*); | 58 explicit PaintLayerFilterInfo(PaintLayer*); |
| 60 ~PaintLayerFilterInfo() override; | 59 ~PaintLayerFilterInfo() override; |
| 61 | 60 |
| 62 FilterEffect* lastEffect() const { return m_lastEffect; } | |
| 63 void setLastEffect(FilterEffect*); | 61 void setLastEffect(FilterEffect*); |
| 62 FilterEffect* lastEffect() const; |
| 63 void invalidateFilterChain(); |
| 64 | 64 |
| 65 void updateReferenceFilterClients(const FilterOperations&); | |
| 66 void clearLayer() { m_layer = nullptr; } | 65 void clearLayer() { m_layer = nullptr; } |
| 67 | 66 |
| 68 void filterNeedsInvalidation() override; | 67 TreeScope* treeScope() override; |
| 68 |
| 69 void resourceContentChanged() override; |
| 70 void resourceElementChanged() override; |
| 69 | 71 |
| 70 DECLARE_TRACE(); | 72 DECLARE_TRACE(); |
| 71 | 73 |
| 72 private: | 74 private: |
| 73 // |clearLayer| must be called before *m_layer becomes invalid. | 75 // |clearLayer| must be called before *m_layer becomes invalid. |
| 74 PaintLayer* m_layer; | 76 PaintLayer* m_layer; |
| 75 Member<FilterEffect> m_lastEffect; | 77 Member<FilterEffect> m_lastEffect; |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 } // namespace blink | 80 } // namespace blink |
| 79 | 81 |
| 80 #endif // PaintLayerFilterInfo_h | 82 #endif // PaintLayerFilterInfo_h |
| OLD | NEW |