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 |
(...skipping 10 matching lines...) Expand all Loading... |
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" | 28 #include "core/rendering/PaintInfo.h" |
29 #include "core/rendering/svg/RenderSVGResourceClipper.h" | 29 #include "core/rendering/svg/RenderSVGResourceClipper.h" |
30 #include "platform/graphics/ImageBuffer.h" | 30 #include "platform/graphics/ImageBuffer.h" |
| 31 #include "platform/transforms/AffineTransform.h" |
31 | 32 |
32 namespace blink { | 33 namespace blink { |
33 | 34 |
34 class AffineTransform; | |
35 class RenderObject; | 35 class RenderObject; |
36 class FloatRect; | 36 class FloatRect; |
37 class RenderSVGResourceFilter; | 37 class RenderSVGResourceFilter; |
38 class RenderSVGResourceMasker; | 38 class RenderSVGResourceMasker; |
39 | 39 |
| 40 class SubtreeContentTransformScope { |
| 41 public: |
| 42 SubtreeContentTransformScope(const AffineTransform&); |
| 43 ~SubtreeContentTransformScope(); |
| 44 |
| 45 private: |
| 46 AffineTransform m_savedContentTransformation; |
| 47 }; |
| 48 |
40 // SVGRenderingContext | 49 // SVGRenderingContext |
41 class SVGRenderingContext { | 50 class SVGRenderingContext { |
42 public: | 51 public: |
43 // Does not start rendering. | 52 // Does not start rendering. |
44 SVGRenderingContext() | 53 SVGRenderingContext() |
45 : m_renderingFlags(0) | 54 : m_renderingFlags(0) |
46 , m_object(0) | 55 , m_object(0) |
47 , m_paintInfo(0) | 56 , m_paintInfo(0) |
48 , m_savedContext(0) | 57 , m_savedContext(0) |
49 , m_filter(0) | 58 , m_filter(0) |
(...skipping 16 matching lines...) Expand all Loading... |
66 prepareToRenderSVGContent(object, paintinfo); | 75 prepareToRenderSVGContent(object, paintinfo); |
67 } | 76 } |
68 | 77 |
69 // Automatically finishes context rendering. | 78 // Automatically finishes context rendering. |
70 ~SVGRenderingContext(); | 79 ~SVGRenderingContext(); |
71 | 80 |
72 // Used by all SVG renderers who apply clip/filter/etc. resources to the ren
derer content. | 81 // Used by all SVG renderers who apply clip/filter/etc. resources to the ren
derer content. |
73 void prepareToRenderSVGContent(RenderObject*, PaintInfo&); | 82 void prepareToRenderSVGContent(RenderObject*, PaintInfo&); |
74 bool isRenderingPrepared() const { return m_renderingFlags & RenderingPrepar
ed; } | 83 bool isRenderingPrepared() const { return m_renderingFlags & RenderingPrepar
ed; } |
75 | 84 |
76 static void renderSubtree(GraphicsContext*, RenderObject*, const AffineTrans
form&); | 85 static void renderSubtree(GraphicsContext*, RenderObject*); |
77 | 86 |
78 static float calculateScreenFontSizeScalingFactor(const RenderObject*); | 87 static float calculateScreenFontSizeScalingFactor(const RenderObject*); |
79 static void calculateDeviceSpaceTransformation(const RenderObject*, AffineTr
ansform& absoluteTransform); | 88 static void calculateDeviceSpaceTransformation(const RenderObject*, AffineTr
ansform& absoluteTransform); |
80 static FloatRect clampedAbsoluteTargetRect(const FloatRect& absoluteTargetRe
ct); | 89 static FloatRect clampedAbsoluteTargetRect(const FloatRect& absoluteTargetRe
ct); |
81 static void clear2DRotation(AffineTransform&); | 90 static void clear2DRotation(AffineTransform&); |
82 | 91 |
83 // Support for the buffered-rendering hint. | 92 // Support for the buffered-rendering hint. |
84 bool bufferForeground(OwnPtr<ImageBuffer>&); | 93 bool bufferForeground(OwnPtr<ImageBuffer>&); |
85 | 94 |
86 private: | 95 private: |
(...skipping 16 matching lines...) Expand all Loading... |
103 IntRect m_savedPaintRect; | 112 IntRect m_savedPaintRect; |
104 RenderSVGResourceFilter* m_filter; | 113 RenderSVGResourceFilter* m_filter; |
105 RenderSVGResourceClipper* m_clipper; | 114 RenderSVGResourceClipper* m_clipper; |
106 RenderSVGResourceClipper::ClipperState m_clipperState; | 115 RenderSVGResourceClipper::ClipperState m_clipperState; |
107 RenderSVGResourceMasker* m_masker; | 116 RenderSVGResourceMasker* m_masker; |
108 }; | 117 }; |
109 | 118 |
110 } // namespace blink | 119 } // namespace blink |
111 | 120 |
112 #endif // SVGRenderingContext_h | 121 #endif // SVGRenderingContext_h |
OLD | NEW |