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 SVGRenderingContext_h | 25 #ifndef SVGRenderingContext_h |
26 #define SVGRenderingContext_h | 26 #define SVGRenderingContext_h |
27 | 27 |
28 #include "core/rendering/PaintInfo.h" | |
29 #include "core/rendering/svg/RenderSVGResourceClipper.h" | 28 #include "core/rendering/svg/RenderSVGResourceClipper.h" |
30 #include "platform/graphics/ImageBuffer.h" | |
31 #include "platform/transforms/AffineTransform.h" | 29 #include "platform/transforms/AffineTransform.h" |
32 | 30 |
33 namespace blink { | 31 namespace blink { |
34 | 32 |
35 class RenderObject; | 33 class RenderObject; |
36 class FloatRect; | 34 class FloatRect; |
| 35 struct PaintInfo; |
37 class RenderSVGResourceFilter; | 36 class RenderSVGResourceFilter; |
38 class RenderSVGResourceMasker; | 37 class RenderSVGResourceMasker; |
39 | 38 |
40 class SubtreeContentTransformScope { | 39 class SubtreeContentTransformScope { |
41 public: | 40 public: |
42 SubtreeContentTransformScope(const AffineTransform&); | 41 SubtreeContentTransformScope(const AffineTransform&); |
43 ~SubtreeContentTransformScope(); | 42 ~SubtreeContentTransformScope(); |
44 | 43 |
45 private: | 44 private: |
46 AffineTransform m_savedContentTransformation; | 45 AffineTransform m_savedContentTransformation; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 ~SVGRenderingContext(); | 78 ~SVGRenderingContext(); |
80 | 79 |
81 // Used by all SVG renderers who apply clip/filter/etc. resources to the ren
derer content. | 80 // Used by all SVG renderers who apply clip/filter/etc. resources to the ren
derer content. |
82 void prepareToRenderSVGContent(RenderObject*, PaintInfo&); | 81 void prepareToRenderSVGContent(RenderObject*, PaintInfo&); |
83 bool isRenderingPrepared() const { return m_renderingFlags & RenderingPrepar
ed; } | 82 bool isRenderingPrepared() const { return m_renderingFlags & RenderingPrepar
ed; } |
84 | 83 |
85 static void renderSubtree(GraphicsContext*, RenderObject*); | 84 static void renderSubtree(GraphicsContext*, RenderObject*); |
86 | 85 |
87 static float calculateScreenFontSizeScalingFactor(const RenderObject*); | 86 static float calculateScreenFontSizeScalingFactor(const RenderObject*); |
88 | 87 |
89 // Support for the buffered-rendering hint. | |
90 bool bufferForeground(OwnPtr<ImageBuffer>&); | |
91 | |
92 private: | 88 private: |
93 // To properly revert partially successful initializtions in the destructor,
we record all successful steps. | 89 // To properly revert partially successful initializtions in the destructor,
we record all successful steps. |
94 enum RenderingFlags { | 90 enum RenderingFlags { |
95 RenderingPrepared = 1, | 91 RenderingPrepared = 1, |
96 RestoreGraphicsContext = 1 << 1, | 92 RestoreGraphicsContext = 1 << 1, |
97 EndOpacityLayer = 1 << 2, | 93 EndOpacityLayer = 1 << 2, |
98 PostApplyResources = 1 << 3, | 94 PostApplyResources = 1 << 3, |
99 PrepareToRenderSVGContentWasCalled = 1 << 4 | 95 PrepareToRenderSVGContentWasCalled = 1 << 4 |
100 }; | 96 }; |
101 | 97 |
102 // List of those flags which require actions during the destructor. | 98 // List of those flags which require actions during the destructor. |
103 const static int ActionsNeeded = RestoreGraphicsContext | EndOpacityLayer |
PostApplyResources; | 99 const static int ActionsNeeded = RestoreGraphicsContext | EndOpacityLayer |
PostApplyResources; |
104 | 100 |
105 int m_renderingFlags; | 101 int m_renderingFlags; |
106 RenderObject* m_object; | 102 RenderObject* m_object; |
107 PaintInfo* m_paintInfo; | 103 PaintInfo* m_paintInfo; |
108 GraphicsContext* m_savedContext; | 104 GraphicsContext* m_savedContext; |
109 IntRect m_savedPaintRect; | 105 IntRect m_savedPaintRect; |
110 RenderSVGResourceFilter* m_filter; | 106 RenderSVGResourceFilter* m_filter; |
111 RenderSVGResourceClipper* m_clipper; | 107 RenderSVGResourceClipper* m_clipper; |
112 RenderSVGResourceClipper::ClipperState m_clipperState; | 108 RenderSVGResourceClipper::ClipperState m_clipperState; |
113 RenderSVGResourceMasker* m_masker; | 109 RenderSVGResourceMasker* m_masker; |
114 }; | 110 }; |
115 | 111 |
116 } // namespace blink | 112 } // namespace blink |
117 | 113 |
118 #endif // SVGRenderingContext_h | 114 #endif // SVGRenderingContext_h |
OLD | NEW |