Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: Source/core/rendering/svg/RenderSVGResourceGradient.cpp

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 20 matching lines...) Expand all
31 { 31 {
32 } 32 }
33 33
34 void RenderSVGResourceGradient::removeAllClientsFromCache(bool markForInvalidati on) 34 void RenderSVGResourceGradient::removeAllClientsFromCache(bool markForInvalidati on)
35 { 35 {
36 m_gradientMap.clear(); 36 m_gradientMap.clear();
37 m_shouldCollectGradientAttributes = true; 37 m_shouldCollectGradientAttributes = true;
38 markAllClientsForInvalidation(markForInvalidation ? PaintInvalidation : Pare ntOnlyInvalidation); 38 markAllClientsForInvalidation(markForInvalidation ? PaintInvalidation : Pare ntOnlyInvalidation);
39 } 39 }
40 40
41 void RenderSVGResourceGradient::removeClientFromCache(RenderObject* client, bool markForInvalidation) 41 void RenderSVGResourceGradient::removeClientFromCache(LayoutObject* client, bool markForInvalidation)
42 { 42 {
43 ASSERT(client); 43 ASSERT(client);
44 m_gradientMap.remove(client); 44 m_gradientMap.remove(client);
45 markClientForInvalidation(client, markForInvalidation ? PaintInvalidation : ParentOnlyInvalidation); 45 markClientForInvalidation(client, markForInvalidation ? PaintInvalidation : ParentOnlyInvalidation);
46 } 46 }
47 47
48 SVGPaintServer RenderSVGResourceGradient::preparePaintServer(const RenderObject& object) 48 SVGPaintServer RenderSVGResourceGradient::preparePaintServer(const LayoutObject& object)
49 { 49 {
50 clearInvalidationMask(); 50 clearInvalidationMask();
51 51
52 // Be sure to synchronize all SVG properties on the gradientElement _before_ processing any further. 52 // Be sure to synchronize all SVG properties on the gradientElement _before_ processing any further.
53 // Otherwhise the call to collectGradientAttributes() in createTileImage(), may cause the SVG DOM property 53 // Otherwhise the call to collectGradientAttributes() in createTileImage(), may cause the SVG DOM property
54 // synchronization to kick in, which causes removeAllClientsFromCache() to b e called, which in turn deletes our 54 // synchronization to kick in, which causes removeAllClientsFromCache() to b e called, which in turn deletes our
55 // GradientData object! Leaving out the line below will cause svg/dynamic-up dates/SVG*GradientElement-svgdom* to crash. 55 // GradientData object! Leaving out the line below will cause svg/dynamic-up dates/SVG*GradientElement-svgdom* to crash.
56 SVGGradientElement* gradientElement = toSVGGradientElement(element()); 56 SVGGradientElement* gradientElement = toSVGGradientElement(element());
57 if (!gradientElement) 57 if (!gradientElement)
58 return SVGPaintServer::invalid(); 58 return SVGPaintServer::invalid();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 92 }
93 93
94 if (!gradientData->gradient) 94 if (!gradientData->gradient)
95 return SVGPaintServer::invalid(); 95 return SVGPaintServer::invalid();
96 96
97 gradientData->gradient->setGradientSpaceTransform(gradientData->userspaceTra nsform); 97 gradientData->gradient->setGradientSpaceTransform(gradientData->userspaceTra nsform);
98 98
99 return SVGPaintServer(gradientData->gradient); 99 return SVGPaintServer(gradientData->gradient);
100 } 100 }
101 101
102 bool RenderSVGResourceGradient::isChildAllowed(RenderObject* child, const Render Style&) const 102 bool RenderSVGResourceGradient::isChildAllowed(LayoutObject* child, const Render Style&) const
103 { 103 {
104 if (child->isSVGGradientStop()) 104 if (child->isSVGGradientStop())
105 return true; 105 return true;
106 106
107 if (!child->isSVGResourceContainer()) 107 if (!child->isSVGResourceContainer())
108 return false; 108 return false;
109 109
110 return toRenderSVGResourceContainer(child)->isSVGPaintServer(); 110 return toRenderSVGResourceContainer(child)->isSVGPaintServer();
111 } 111 }
112 112
(...skipping 16 matching lines...) Expand all
129 return SpreadMethodReflect; 129 return SpreadMethodReflect;
130 case SVGSpreadMethodRepeat: 130 case SVGSpreadMethodRepeat:
131 return SpreadMethodRepeat; 131 return SpreadMethodRepeat;
132 } 132 }
133 133
134 ASSERT_NOT_REACHED(); 134 ASSERT_NOT_REACHED();
135 return SpreadMethodPad; 135 return SpreadMethodPad;
136 } 136 }
137 137
138 } 138 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceGradient.h ('k') | Source/core/rendering/svg/RenderSVGResourceLinearGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698