OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * Copyright (C) 2012 Zoltan Herczeg <zherczeg@webkit.org>. | 7 * Copyright (C) 2012 Zoltan Herczeg <zherczeg@webkit.org>. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
11 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
12 * version 2 of the License, or (at your option) any later version. | 12 * version 2 of the License, or (at your option) any later version. |
13 * | 13 * |
14 * This library is distributed in the hope that it will be useful, | 14 * This library is distributed in the hope that it will be useful, |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 * Library General Public License for more details. | 17 * Library General Public License for more details. |
18 * | 18 * |
19 * You should have received a copy of the GNU Library General Public License | 19 * You should have received a copy of the GNU Library General Public License |
20 * along with this library; see the file COPYING.LIB. If not, write to | 20 * along with this library; see the file COPYING.LIB. If not, write to |
21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
23 */ | 23 */ |
24 | 24 |
25 #ifndef SVGPaintContext_h | 25 #ifndef SVGPaintContext_h |
26 #define SVGPaintContext_h | 26 #define SVGPaintContext_h |
27 | 27 |
| 28 #include <memory> |
28 #include "core/layout/svg/LayoutSVGResourcePaintServer.h" | 29 #include "core/layout/svg/LayoutSVGResourcePaintServer.h" |
29 #include "core/paint/ClipPathClipper.h" | 30 #include "core/paint/ClipPathClipper.h" |
30 #include "core/paint/ObjectPaintProperties.h" | 31 #include "core/paint/ObjectPaintProperties.h" |
31 #include "core/paint/PaintInfo.h" | 32 #include "core/paint/PaintInfo.h" |
32 #include "core/paint/SVGFilterPainter.h" | 33 #include "core/paint/SVGFilterPainter.h" |
33 #include "core/paint/TransformRecorder.h" | 34 #include "core/paint/TransformRecorder.h" |
34 #include "platform/graphics/paint/CompositingRecorder.h" | 35 #include "platform/graphics/paint/CompositingRecorder.h" |
35 #include "platform/graphics/paint/ScopedPaintChunkProperties.h" | 36 #include "platform/graphics/paint/ScopedPaintChunkProperties.h" |
36 #include "platform/transforms/AffineTransform.h" | 37 #include "platform/transforms/AffineTransform.h" |
37 #include <memory> | |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 class LayoutObject; | 41 class LayoutObject; |
42 class LayoutSVGResourceFilter; | 42 class LayoutSVGResourceFilter; |
43 class LayoutSVGResourceMasker; | 43 class LayoutSVGResourceMasker; |
44 class SVGResources; | 44 class SVGResources; |
45 | 45 |
46 // This class hooks up the correct paint property transform node when spv2 is | 46 // This class hooks up the correct paint property transform node when spv2 is |
47 // enabled, and otherwise works like a TransformRecorder which emits Transform | 47 // enabled, and otherwise works like a TransformRecorder which emits Transform |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 }; | 96 }; |
97 | 97 |
98 class SVGPaintContext { | 98 class SVGPaintContext { |
99 STACK_ALLOCATED(); | 99 STACK_ALLOCATED(); |
100 | 100 |
101 public: | 101 public: |
102 SVGPaintContext(const LayoutObject& object, const PaintInfo& paintInfo) | 102 SVGPaintContext(const LayoutObject& object, const PaintInfo& paintInfo) |
103 : m_object(object), | 103 : m_object(object), |
104 m_paintInfo(paintInfo), | 104 m_paintInfo(paintInfo), |
105 m_filter(nullptr), | 105 m_filter(nullptr), |
106 m_masker(nullptr) | 106 m_masker(nullptr) {} |
107 { | |
108 } | |
109 | 107 |
110 ~SVGPaintContext(); | 108 ~SVGPaintContext(); |
111 | 109 |
112 PaintInfo& paintInfo() { | 110 PaintInfo& paintInfo() { |
113 return m_filterPaintInfo ? *m_filterPaintInfo : m_paintInfo; | 111 return m_filterPaintInfo ? *m_filterPaintInfo : m_paintInfo; |
114 } | 112 } |
115 | 113 |
116 // Return true if these operations aren't necessary or if they are | 114 // Return true if these operations aren't necessary or if they are |
117 // successfully applied. | 115 // successfully applied. |
118 bool applyClipMaskAndFilterIfNecessary(); | 116 bool applyClipMaskAndFilterIfNecessary(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 std::unique_ptr<SVGFilterRecordingContext> m_filterRecordingContext; | 152 std::unique_ptr<SVGFilterRecordingContext> m_filterRecordingContext; |
155 Optional<ScopedPaintChunkProperties> m_scopedPaintChunkProperties; | 153 Optional<ScopedPaintChunkProperties> m_scopedPaintChunkProperties; |
156 #if DCHECK_IS_ON() | 154 #if DCHECK_IS_ON() |
157 bool m_applyClipMaskAndFilterIfNecessaryCalled = false; | 155 bool m_applyClipMaskAndFilterIfNecessaryCalled = false; |
158 #endif | 156 #endif |
159 }; | 157 }; |
160 | 158 |
161 } // namespace blink | 159 } // namespace blink |
162 | 160 |
163 #endif // SVGPaintContext_h | 161 #endif // SVGPaintContext_h |
OLD | NEW |