| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "core/paint/CompositingRecorder.h" | 28 #include "core/paint/CompositingRecorder.h" |
| 29 #include "core/paint/FloatClipRecorder.h" | 29 #include "core/paint/FloatClipRecorder.h" |
| 30 #include "core/rendering/PaintInfo.h" | 30 #include "core/rendering/PaintInfo.h" |
| 31 #include "core/rendering/svg/RenderSVGResourceClipper.h" | 31 #include "core/rendering/svg/RenderSVGResourceClipper.h" |
| 32 #include "platform/graphics/paint/ClipPathRecorder.h" | 32 #include "platform/graphics/paint/ClipPathRecorder.h" |
| 33 #include "platform/transforms/AffineTransform.h" | 33 #include "platform/transforms/AffineTransform.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class RenderObject; | 37 class LayoutObject; |
| 38 class RenderSVGResourceFilter; | 38 class RenderSVGResourceFilter; |
| 39 class RenderSVGResourceMasker; | 39 class RenderSVGResourceMasker; |
| 40 class SVGResources; | 40 class SVGResources; |
| 41 | 41 |
| 42 class SubtreeContentTransformScope { | 42 class SubtreeContentTransformScope { |
| 43 public: | 43 public: |
| 44 SubtreeContentTransformScope(const AffineTransform&); | 44 SubtreeContentTransformScope(const AffineTransform&); |
| 45 ~SubtreeContentTransformScope(); | 45 ~SubtreeContentTransformScope(); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 AffineTransform m_savedContentTransformation; | 48 AffineTransform m_savedContentTransformation; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class SVGRenderingContext { | 51 class SVGRenderingContext { |
| 52 STACK_ALLOCATED(); | 52 STACK_ALLOCATED(); |
| 53 public: | 53 public: |
| 54 SVGRenderingContext(RenderObject& object, const PaintInfo& paintInfo) | 54 SVGRenderingContext(LayoutObject& object, const PaintInfo& paintInfo) |
| 55 : m_object(&object) | 55 : m_object(&object) |
| 56 , m_paintInfo(paintInfo) | 56 , m_paintInfo(paintInfo) |
| 57 , m_originalPaintInfo(&paintInfo) | 57 , m_originalPaintInfo(&paintInfo) |
| 58 , m_filter(nullptr) | 58 , m_filter(nullptr) |
| 59 , m_clipper(nullptr) | 59 , m_clipper(nullptr) |
| 60 , m_clipperState(RenderSVGResourceClipper::ClipperNotApplied) | 60 , m_clipperState(RenderSVGResourceClipper::ClipperNotApplied) |
| 61 , m_masker(nullptr) | 61 , m_masker(nullptr) |
| 62 #if ENABLE(ASSERT) | 62 #if ENABLE(ASSERT) |
| 63 , m_applyClipMaskAndFilterIfNecessaryCalled(false) | 63 , m_applyClipMaskAndFilterIfNecessaryCalled(false) |
| 64 #endif | 64 #endif |
| 65 { } | 65 { } |
| 66 | 66 |
| 67 ~SVGRenderingContext(); | 67 ~SVGRenderingContext(); |
| 68 | 68 |
| 69 PaintInfo& paintInfo() { return m_paintInfo; } | 69 PaintInfo& paintInfo() { return m_paintInfo; } |
| 70 | 70 |
| 71 // Return true if these operations aren't necessary or if they are successfu
lly applied. | 71 // Return true if these operations aren't necessary or if they are successfu
lly applied. |
| 72 bool applyClipMaskAndFilterIfNecessary(); | 72 bool applyClipMaskAndFilterIfNecessary(); |
| 73 | 73 |
| 74 static void renderSubtree(GraphicsContext*, RenderObject*); | 74 static void renderSubtree(GraphicsContext*, LayoutObject*); |
| 75 | 75 |
| 76 static float calculateScreenFontSizeScalingFactor(const RenderObject*); | 76 static float calculateScreenFontSizeScalingFactor(const LayoutObject*); |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 void applyCompositingIfNecessary(); | 79 void applyCompositingIfNecessary(); |
| 80 | 80 |
| 81 // Return true if no clipping is necessary or if the clip is successfully ap
plied. | 81 // Return true if no clipping is necessary or if the clip is successfully ap
plied. |
| 82 bool applyClipIfNecessary(SVGResources*); | 82 bool applyClipIfNecessary(SVGResources*); |
| 83 | 83 |
| 84 // Return true if no masking is necessary or if the mask is successfully app
lied. | 84 // Return true if no masking is necessary or if the mask is successfully app
lied. |
| 85 bool applyMaskIfNecessary(SVGResources*); | 85 bool applyMaskIfNecessary(SVGResources*); |
| 86 | 86 |
| 87 // Return true if no filtering is necessary or if the filter is successfully
applied. | 87 // Return true if no filtering is necessary or if the filter is successfully
applied. |
| 88 bool applyFilterIfNecessary(SVGResources*); | 88 bool applyFilterIfNecessary(SVGResources*); |
| 89 | 89 |
| 90 bool isIsolationInstalled() const; | 90 bool isIsolationInstalled() const; |
| 91 | 91 |
| 92 RawPtrWillBeMember<RenderObject> m_object; | 92 RawPtrWillBeMember<LayoutObject> m_object; |
| 93 PaintInfo m_paintInfo; | 93 PaintInfo m_paintInfo; |
| 94 const PaintInfo* m_originalPaintInfo; | 94 const PaintInfo* m_originalPaintInfo; |
| 95 RawPtrWillBeMember<RenderSVGResourceFilter> m_filter; | 95 RawPtrWillBeMember<RenderSVGResourceFilter> m_filter; |
| 96 RawPtrWillBeMember<RenderSVGResourceClipper> m_clipper; | 96 RawPtrWillBeMember<RenderSVGResourceClipper> m_clipper; |
| 97 RenderSVGResourceClipper::ClipperState m_clipperState; | 97 RenderSVGResourceClipper::ClipperState m_clipperState; |
| 98 RawPtrWillBeMember<RenderSVGResourceMasker> m_masker; | 98 RawPtrWillBeMember<RenderSVGResourceMasker> m_masker; |
| 99 OwnPtr<CompositingRecorder> m_compositingRecorder; | 99 OwnPtr<CompositingRecorder> m_compositingRecorder; |
| 100 OwnPtr<FloatClipRecorder> m_clipRecorder; | 100 OwnPtr<FloatClipRecorder> m_clipRecorder; |
| 101 OwnPtr<ClipPathRecorder> m_clipPathRecorder; | 101 OwnPtr<ClipPathRecorder> m_clipPathRecorder; |
| 102 #if ENABLE(ASSERT) | 102 #if ENABLE(ASSERT) |
| 103 bool m_applyClipMaskAndFilterIfNecessaryCalled; | 103 bool m_applyClipMaskAndFilterIfNecessaryCalled; |
| 104 #endif | 104 #endif |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| 108 | 108 |
| 109 #endif // SVGRenderingContext_h | 109 #endif // SVGRenderingContext_h |
| OLD | NEW |