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

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

Issue 21042009: [SVG2] Merge SVGStyledElement into SVGElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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) 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2009, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 17 matching lines...) Expand all
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 32
33 #include "core/rendering/svg/RenderSVGModelObject.h" 33 #include "core/rendering/svg/RenderSVGModelObject.h"
34 34
35 #include "SVGNames.h" 35 #include "SVGNames.h"
36 #include "core/rendering/svg/RenderSVGRoot.h" 36 #include "core/rendering/svg/RenderSVGRoot.h"
37 #include "core/rendering/svg/SVGResourcesCache.h" 37 #include "core/rendering/svg/SVGResourcesCache.h"
38 #include "core/svg/SVGStyledElement.h" 38 #include "core/svg/SVGElement.h"
39 39
40 namespace WebCore { 40 namespace WebCore {
41 41
42 RenderSVGModelObject::RenderSVGModelObject(SVGStyledElement* node) 42 RenderSVGModelObject::RenderSVGModelObject(SVGElement* node)
43 : RenderObject(node) 43 : RenderObject(node)
44 { 44 {
45 } 45 }
46 46
47 LayoutRect RenderSVGModelObject::clippedOverflowRectForRepaint(const RenderLayer ModelObject* repaintContainer) const 47 LayoutRect RenderSVGModelObject::clippedOverflowRectForRepaint(const RenderLayer ModelObject* repaintContainer) const
48 { 48 {
49 return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContaine r); 49 return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContaine r);
50 } 50 }
51 51
52 void RenderSVGModelObject::computeFloatRectForRepaint(const RenderLayerModelObje ct* repaintContainer, FloatRect& repaintRect, bool fixed) const 52 void RenderSVGModelObject::computeFloatRectForRepaint(const RenderLayerModelObje ct* repaintContainer, FloatRect& repaintRect, bool fixed) const
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 element->document()->updateLayoutIgnorePendingStylesheets(); 133 element->document()->updateLayoutIgnorePendingStylesheets();
134 134
135 SVGElement* stopAtElement = SVGLocatable::nearestViewportElement(element); 135 SVGElement* stopAtElement = SVGLocatable::nearestViewportElement(element);
136 ASSERT(stopAtElement); 136 ASSERT(stopAtElement);
137 137
138 AffineTransform localTransform; 138 AffineTransform localTransform;
139 Node* current = element; 139 Node* current = element;
140 140
141 while (current && current->isSVGElement()) { 141 while (current && current->isSVGElement()) {
142 SVGElement* currentElement = toSVGElement(current); 142 SVGElement* currentElement = toSVGElement(current);
143 if (currentElement->isSVGStyledElement()) { 143 localTransform = currentElement->renderer()->localToParentTransform();
144 localTransform = currentElement->renderer()->localToParentTransform( ); 144 transform = localTransform.multiply(transform);
145 transform = localTransform.multiply(transform);
146 }
147 // For getCTM() computation, stop at the nearest viewport element 145 // For getCTM() computation, stop at the nearest viewport element
148 if (currentElement == stopAtElement) 146 if (currentElement == stopAtElement)
149 break; 147 break;
150 148
151 current = current->parentOrShadowHostNode(); 149 current = current->parentOrShadowHostNode();
152 } 150 }
153 } 151 }
154 152
155 // FloatRect::intersects does not consider horizontal or vertical lines (because of isEmpty()). 153 // FloatRect::intersects does not consider horizontal or vertical lines (because of isEmpty()).
156 // So special-case handling of such lines. 154 // So special-case handling of such lines.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 if (!isGraphicsElement(renderer)) 199 if (!isGraphicsElement(renderer))
202 return false; 200 return false;
203 AffineTransform ctm; 201 AffineTransform ctm;
204 SVGElement* svgElement = toSVGElement(renderer->node()); 202 SVGElement* svgElement = toSVGElement(renderer->node());
205 getElementCTM(svgElement, ctm); 203 getElementCTM(svgElement, ctm);
206 ASSERT(svgElement->renderer()); 204 ASSERT(svgElement->renderer());
207 return rect.contains(ctm.mapRect(svgElement->renderer()->repaintRectInLocalC oordinates())); 205 return rect.contains(ctm.mapRect(svgElement->renderer()->repaintRectInLocalC oordinates()));
208 } 206 }
209 207
210 } // namespace WebCore 208 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGModelObject.h ('k') | Source/core/rendering/svg/RenderSVGResourceClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698