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

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

Issue 622393002: Introduce new entry-points for non-paint-server RenderSVGResources (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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) Research In Motion Limited 2009-2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 m_maskContentBoundaries = FloatRect(); 48 m_maskContentBoundaries = FloatRect();
49 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval idation : ParentOnlyInvalidation); 49 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval idation : ParentOnlyInvalidation);
50 } 50 }
51 51
52 void RenderSVGResourceMasker::removeClientFromCache(RenderObject* client, bool m arkForInvalidation) 52 void RenderSVGResourceMasker::removeClientFromCache(RenderObject* client, bool m arkForInvalidation)
53 { 53 {
54 ASSERT(client); 54 ASSERT(client);
55 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati on : ParentOnlyInvalidation); 55 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati on : ParentOnlyInvalidation);
56 } 56 }
57 57
58 bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*, 58 bool RenderSVGResourceMasker::prepareEffect(RenderObject* object, RenderStyle*, GraphicsContext*& context)
59 GraphicsContext*& context, unsigned short resourceMode)
60 { 59 {
61 ASSERT(object); 60 ASSERT(object);
62 ASSERT(context); 61 ASSERT(context);
63 ASSERT(style()); 62 ASSERT(style());
64 ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode);
65 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout()); 63 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout());
66 64
67 clearInvalidationMask(); 65 clearInvalidationMask();
68 66
69 FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordi nates(); 67 FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordi nates();
70 if (paintInvalidationRect.isEmpty() || !element()->hasChildren()) 68 if (paintInvalidationRect.isEmpty() || !element()->hasChildren())
71 return false; 69 return false;
72 70
73 // Content layer start. 71 // Content layer start.
74 context->beginTransparencyLayer(1, &paintInvalidationRect); 72 context->beginTransparencyLayer(1, &paintInvalidationRect);
75 73
76 return true; 74 return true;
77 } 75 }
78 76
79 void RenderSVGResourceMasker::postApplyResource(RenderObject* object, GraphicsCo ntext*& context) 77 void RenderSVGResourceMasker::finishEffect(RenderObject* object, GraphicsContext *& context)
80 { 78 {
81 ASSERT(object); 79 ASSERT(object);
82 ASSERT(context); 80 ASSERT(context);
83 ASSERT(style()); 81 ASSERT(style());
84 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout()); 82 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout());
85 83
86 FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordi nates(); 84 FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordi nates();
87 85
88 const SVGRenderStyle& svgStyle = style()->svgStyle(); 86 const SVGRenderStyle& svgStyle = style()->svgStyle();
89 ColorFilter maskLayerFilter = svgStyle.maskType() == MT_LUMINANCE 87 ColorFilter maskLayerFilter = svgStyle.maskType() == MT_LUMINANCE
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 180 transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
183 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight()); 181 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight());
184 maskRect = transform.mapRect(maskRect); 182 maskRect = transform.mapRect(maskRect);
185 } 183 }
186 184
187 maskRect.intersect(maskBoundaries); 185 maskRect.intersect(maskBoundaries);
188 return maskRect; 186 return maskRect;
189 } 187 }
190 188
191 } 189 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceMasker.h ('k') | Source/core/rendering/svg/RenderSVGResourcePattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698