Changeset 121513 in webkit
- Timestamp:
- Jun 28, 2012 7:50:27 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 16 added
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r121506 r121513 1 2012-06-28 Stephen White <senorblanco@chromium.org> 2 3 Add tests for the url() filter function. 4 https://bugs.webkit.org/show_bug.cgi?id=72443 5 6 Reviewed by Dean Jackson. 7 8 * css3/filters/effect-reference-external.html: Added. 9 * css3/filters/effect-reference-hw.html: Added. 10 * css3/filters/effect-reference-ordering.html: Added. 11 * css3/filters/effect-reference.html: Added. 12 * css3/filters/resources/hueRotate.svg: Added. 13 * platform/chromium-linux/css3/filters/effect-reference-expected.png: Added. 14 * platform/chromium-linux/css3/filters/effect-reference-expected.txt: Added. 15 * platform/chromium-linux/css3/filters/effect-reference-external-expected.png: Added. 16 * platform/chromium-linux/css3/filters/effect-reference-external-expected.txt: Added. 17 * platform/chromium-linux/css3/filters/effect-reference-hw-expected.png: Added. 18 * platform/chromium-linux/css3/filters/effect-reference-hw-expected.txt: Added. 19 * platform/chromium-linux/css3/filters/effect-reference-ordering-expected.png: Added. 20 * platform/chromium-linux/css3/filters/effect-reference-ordering-expected.txt: Added. 21 * platform/chromium/TestExpectations: 22 1 23 2012-06-28 Mike Lawther <mikelawther@chromium.org> 2 24 -
trunk/LayoutTests/platform/chromium/TestExpectations
r121506 r121513 1290 1290 BUGWK83199 : svg/filters/big-sized-filter.svg = IMAGE PASS 1291 1291 1292 // This will need to be rebaselined after 1293 // https://bugs.webkit.org/show_bug.cgi?id=72443 lands. 1294 BUG_SENORBLANCO WIN MAC : css3/filters/effect-reference.html = IMAGE IMAGE+TEXT TEXT 1295 BUG_SENORBLANCO WIN MAC : css3/filters/effect-reference-hw.html = IMAGE IMAGE+TEXT TEXT 1296 BUG_SENORBLANCO WIN MAC : css3/filters/effect-reference-external.html = IMAGE IMAGE+TEXT TEXT 1297 BUG_SENORBLANCO WIN MAC : css3/filters/effect-reference-ordering.html = IMAGE IMAGE+TEXT TEXT 1298 1292 1299 // Many WIN and Linux SVG tests containing text are flaky. It seems different fonts are used at different times. 1293 1300 BUGWK83303 WIN LINUX : svg/zoom/text/zoom-hixie-mixed-009.xml = PASS IMAGE -
trunk/Source/WebCore/CMakeLists.txt
r121164 r121513 540 540 css/WebKitCSSMatrix.cpp 541 541 css/WebKitCSSRegionRule.cpp 542 css/WebKitCSSSVGDocumentValue.cpp 542 543 css/WebKitCSSTransformValue.cpp 543 544 -
trunk/Source/WebCore/ChangeLog
r121510 r121513 1 2012-06-28 Stephen White <senorblanco@chromium.org> 2 3 Implement filter url() function. 4 https://bugs.webkit.org/show_bug.cgi?id=72443 5 6 url() references can be internal, in which case the DOM nodes are 7 retrieved directly from the current document, or external, in which 8 case a CachedSVGDocument request is made, and the filter node build is 9 deferred until the document is loaded. WebKitSVGDocumentValue 10 holds the CachedSVGDocument (if any) and the URL as a CSSValue, 11 and is stored in the CSSValue chain as the argument to the reference 12 filter. 13 14 One notable difference between internal and external references is 15 that internal references will automatically update on an SVG filter node 16 attribute change, while external references will not, since they live 17 in a separate document. This is consistent with the Mozilla 18 implementation. In order to make this work, the RenderLayer is made a 19 client of the RenderSVGResourceContainer, and calls 20 filterNeedsRepaint() when the SVG nodes are invalidated. 21 22 Some plumbing: The CSS StyleResolver was refactored to load all 23 all external resources (images, shaders and (now) SVG filters) in a 24 single function, loadPendingResources(). The PlatformLayer typedef 25 was moved out into its own file, in order to break a cyclic 26 dependency. SVGFilterBuilder was modified to accept the SourceGraphic 27 and SourceAlpha FilterEffects in its constructor and factory function, 28 rather than extracting them from the parent Filter. (This is necessary 29 so that the url() filter can correctly hook up its inputs from 30 previous CSS filters.) 31 32 Reviewed by Dean Jackson. 33 34 Tests: css3/filters/effect-reference-external.html 35 css3/filters/effect-reference-hw.html 36 css3/filters/effect-reference-ordering.html 37 css3/filters/effect-reference.html 38 39 * CMakeLists.txt: 40 * GNUmakefile.list.am: 41 * Target.pri: 42 * WebCore.gypi: 43 * WebCore.vcproj/WebCore.vcproj: 44 * WebCore.xcodeproj/project.pbxproj: 45 Add WebKitCSSSVGDocumentValue to the various build files. 46 * css/CSSComputedStyleDeclaration.cpp: 47 (WebCore::CSSComputedStyleDeclaration::valueForFilter): 48 Use the reference filter's url when getting the computed style for 49 a reference filter. 50 * css/CSSParser.cpp: 51 (WebCore::CSSParser::parseFilter): 52 Create the referenceFilterValue's argument as a 53 WebKitCSSSVGDocumentValue instead of a CSS string. 54 * css/CSSValue.cpp: 55 (WebCore::CSSValue::cssText): 56 Add support for WebKitCSSSVGDocumentValue. 57 (WebCore::CSSValue::destroy): 58 Add support for WebKitCSSSVGDocumentValue. 59 * css/CSSValue.h: 60 (WebCore::CSSValue::isWebKitCSSSVGDocumentValue): 61 Add support for WebKitCSSSVGDocumentValue. 62 * css/StyleResolver.cpp: 63 (WebCore::StyleResolver::collectMatchingRulesForList): 64 Keep track of pending SVG document references, and load them when 65 necessary. 66 * css/StyleResolver.h: 67 * css/WebKitCSSSVGDocumentValue.cpp: Added. 68 New CSSValue subclass for holding SVG document references. 69 (WebCore::WebKitCSSSVGDocumentValue::WebKitCSSSVGDocumentValue): 70 (WebCore::WebKitCSSSVGDocumentValue::~WebKitCSSSVGDocumentValue): 71 (WebCore::WebKitCSSSVGDocumentValue::load): 72 (WebCore::WebKitCSSSVGDocumentValue::customCssText): 73 * css/WebKitCSSSVGDocumentValue.h: Added. 74 (WebCore::WebKitCSSSVGDocumentValue::create): 75 (WebCore::WebKitCSSSVGDocumentValue::cachedSVGDocument): 76 (WebCore::WebKitCSSSVGDocumentValue::url): 77 (WebCore::WebKitCSSSVGDocumentValue::loadRequested): 78 * platform/graphics/GraphicsLayer.h: 79 Refactor PlatformLayer out into its own file, to avoid circular 80 includes. 81 * platform/graphics/ImageBuffer.h: 82 Include PlatformLayer.h instead of GraphicsLayer.h. 83 * platform/graphics/PlatformLayer.h: Added. 84 Refactor PlatformLayer out into its own file, to avoid circular 85 includes. 86 * platform/graphics/filters/FilterOperation.h: 87 (WebCore::ReferenceFilterOperation::create): 88 (WebCore::ReferenceFilterOperation::clone): 89 (WebCore::ReferenceFilterOperation::url): 90 (WebCore::ReferenceFilterOperation::fragment): 91 (ReferenceFilterOperation): 92 (WebCore::ReferenceFilterOperation::data): 93 (WebCore::ReferenceFilterOperation::setData): 94 (WebCore::ReferenceFilterOperation::operator==): 95 (WebCore::ReferenceFilterOperation::ReferenceFilterOperation): 96 Augment ReferenceFilterOperation to maintain a data pointer, 97 in order to preserve context while loading external SVG documents. 98 Replace "reference" with "url" and "fragment" members, in order to 99 ease retrieval of the appropriate DOM objects. 100 * platform/graphics/filters/FilterOperations.cpp: 101 (WebCore::FilterOperations::hasReferenceFilter): 102 Convenience function for finding reference filters. 103 * platform/graphics/filters/FilterOperations.h: 104 (FilterOperations): 105 * platform/mac/ScrollbarThemeMac.mm: 106 Include GraphicsLayer.h explicitly, since ImageBuffer.h no longer 107 includes it (and only includes PlatformLayer.h). 108 * rendering/FilterEffectRenderer.cpp: 109 (WebCore::FilterEffectRenderer::buildReferenceFilter): 110 Utility function to build a FilterEffect node graph for a 111 ReferenceFilterOperation. 112 (WebCore::FilterEffectRenderer::build): 113 Call the above builder function for ReferenceFilterOperations. 114 * rendering/FilterEffectRenderer.h: 115 * rendering/RenderLayer.cpp: 116 (WebCore::RenderLayer::updateOrRemoveFilterEffect): 117 If we have reference filters, update them along with other filters. 118 (WebCore::RenderLayer::filterNeedsRepaint): 119 * rendering/RenderLayerFilterInfo.cpp: 120 (WebCore::RenderLayerFilterInfo::~RenderLayerFilterInfo): 121 (WebCore::RenderLayerFilterInfo::notifyFinished): 122 Implement callback function when external SVGDocuments are loaded. 123 (WebCore::RenderLayerFilterInfo::updateReferenceFilterClients): 124 Add the FilterInfo as a client to be called when SVGDocuments are 125 loaded. 126 (WebCore::RenderLayerFilterInfo::removeReferenceFilterClients): 127 Remove this from the list of notified clients. 128 * rendering/RenderLayerFilterInfo.h: 129 Add new member vars for tracking internal and external SVG 130 references, so we can remove ourselves as a client when done. 131 * rendering/svg/RenderSVGResourceContainer.cpp: 132 (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation): 133 When marking client DOM nodes for repaint, also mark any RenderLayers 134 referring to this DOM tree via filters as needing repaint. 135 (WebCore::RenderSVGResourceContainer::addClientRenderLayer): 136 (WebCore::RenderSVGResourceContainer::removeClientRenderLayer): 137 * rendering/svg/RenderSVGResourceContainer.h: 138 Maintain a list of RenderLayer clients on each SVG resource container, 139 and turn SVG DOM repaint notifications into filter repaint (CSS) 140 notifications. 141 * rendering/svg/RenderSVGResourceFilter.cpp: 142 (WebCore::RenderSVGResourceFilter::buildPrimitives): 143 Construct a SourceGraphic and SourceAlpha node explicitly for the 144 SVG builder case. 145 * svg/graphics/filters/SVGFilterBuilder.cpp: 146 (WebCore::SVGFilterBuilder::SVGFilterBuilder): 147 * svg/graphics/filters/SVGFilterBuilder.h: 148 (WebCore::SVGFilterBuilder::create): 149 Add the SourceGraphic and SourceAlpha as parameters to the constructor 150 and create() methods, so they can be supplied by the caller. 151 1 152 2012-06-28 Kenichi Ishibashi <bashi@chromium.org> 2 153 -
trunk/Source/WebCore/GNUmakefile.list.am
r121332 r121513 1773 1773 Source/WebCore/css/WebKitCSSRegionRule.cpp \ 1774 1774 Source/WebCore/css/WebKitCSSRegionRule.h \ 1775 Source/WebCore/css/WebKitCSSSVGDocumentValue.cpp \ 1776 Source/WebCore/css/WebKitCSSSVGDocumentValue.h \ 1775 1777 Source/WebCore/css/WebKitCSSShaderValue.cpp \ 1776 1778 Source/WebCore/css/WebKitCSSShaderValue.h \ … … 3369 3371 Source/WebCore/platform/graphics/Pattern.cpp \ 3370 3372 Source/WebCore/platform/graphics/Pattern.h \ 3373 Source/WebCore/platform/graphics/PlatformLayer.h \ 3371 3374 Source/WebCore/platform/graphics/Region.cpp \ 3372 3375 Source/WebCore/platform/graphics/Region.h \ -
trunk/Source/WebCore/Target.pri
r121336 r121513 503 503 css/WebKitCSSMatrix.cpp \ 504 504 css/WebKitCSSRegionRule.cpp \ 505 css/WebKitCSSSVGDocumentValue.cpp \ 505 506 css/WebKitCSSShaderValue.cpp \ 506 507 css/WebKitCSSTransformValue.cpp \ … … 1687 1688 css/WebKitCSSMatrix.h \ 1688 1689 css/WebKitCSSRegionRule.h \ 1690 css/WebKitCSSSVGDocumentValue.h \ 1689 1691 css/WebKitCSSShaderValue.h \ 1690 1692 css/WebKitCSSTransformValue.h \ … … 2301 2303 platform/graphics/PathTraversalState.h \ 2302 2304 platform/graphics/Pattern.h \ 2305 platform/graphics/PlatformLayer.h \ 2303 2306 platform/graphics/Region.h \ 2304 2307 platform/graphics/RoundedRect.h \ -
trunk/Source/WebCore/WebCore.gypi
r121473 r121513 395 395 'platform/graphics/Path.h', 396 396 'platform/graphics/Pattern.h', 397 'platform/graphics/PlatformLayer.h', 397 398 'platform/graphics/Region.h', 398 399 'platform/graphics/RoundedRect.h', … … 2583 2584 'css/WebKitCSSShaderValue.cpp', 2584 2585 'css/WebKitCSSShaderValue.h', 2586 'css/WebKitCSSSVGDocumentValue.cpp', 2587 'css/WebKitCSSSVGDocumentValue.h', 2585 2588 'css/WebKitCSSTransformValue.cpp', 2586 2589 'editing/AlternativeTextController.cpp', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r121164 r121513 29363 29363 </File> 29364 29364 <File 29365 RelativePath="..\platform\graphics\PlatformLayer.h" 29366 > 29367 </File> 29368 <File 29365 29369 RelativePath="..\platform\graphics\Region.cpp" 29366 29370 > … … 37576 37580 </File> 37577 37581 <File 37582 RelativePath="..\css\WebKitCSSSVGDocumentValue.cpp" 37583 > 37584 </File> 37585 <File 37586 RelativePath="..\css\WebKitCSSSVGDocumentValue.h" 37587 > 37588 </File> 37589 <File 37578 37590 RelativePath="..\css\WebKitCSSShaderValue.cpp" 37579 >37580 </File>37581 <File37582 RelativePath="..\css\WebKitCSSShaderValue.h"37583 37591 > 37584 37592 </File> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r121358 r121513 79 79 052BFCE9128ABF1500FD338D /* GeolocationClientMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 052BFCE8128ABF1500FD338D /* GeolocationClientMock.cpp */; }; 80 80 052BFCEB128ABF2100FD338D /* GeolocationClientMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 052BFCEA128ABF2100FD338D /* GeolocationClientMock.h */; settings = {ATTRIBUTES = (Private, ); }; }; 81 0562F9461573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0562F9441573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp */; }; 82 0562F9471573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0562F9451573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h */; }; 83 0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0562F9601573F88F0031CA16 /* PlatformLayer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 81 84 05FD69E012845D4300B2BEB3 /* DOMTimeStamp.h in Headers */ = {isa = PBXBuildFile; fileRef = 05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */; settings = {ATTRIBUTES = (Private, ); }; }; 82 85 06027CAD0B1CBFC000884B2D /* ContextMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 06027CAC0B1CBFC000884B2D /* ContextMenuItem.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 3698 3701 A0EE0DF8144F825500F80B0D /* WebGLDebugShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = A0EE0DF4144F825500F80B0D /* WebGLDebugShaders.h */; }; 3699 3702 A104F24314C71F7A009E2C23 /* CachedSVGDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A104F24114C71F7A009E2C23 /* CachedSVGDocument.cpp */; }; 3700 A104F24414C71F7A009E2C23 /* CachedSVGDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = A104F24214C71F7A009E2C23 /* CachedSVGDocument.h */; };3703 A104F24414C71F7A009E2C23 /* CachedSVGDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = A104F24214C71F7A009E2C23 /* CachedSVGDocument.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3701 3704 A10BB5851484E3A700B2E87A /* RenderSVGRect.h in Headers */ = {isa = PBXBuildFile; fileRef = A10BB5831484E3A700B2E87A /* RenderSVGRect.h */; }; 3702 3705 A10BB58B1484E3B300B2E87A /* RenderSVGShape.h in Headers */ = {isa = PBXBuildFile; fileRef = A10BB5891484E3B300B2E87A /* RenderSVGShape.h */; }; … … 4545 4548 B22279B10D00BF220071B782 /* SVGDescElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B222781B0D00BF1F0071B782 /* SVGDescElement.h */; }; 4546 4549 B22279B30D00BF220071B782 /* SVGDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B222781D0D00BF1F0071B782 /* SVGDocument.cpp */; }; 4547 B22279B40D00BF220071B782 /* SVGDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = B222781E0D00BF1F0071B782 /* SVGDocument.h */; };4550 B22279B40D00BF220071B782 /* SVGDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = B222781E0D00BF1F0071B782 /* SVGDocument.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4548 4551 B22279B60D00BF220071B782 /* SVGElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B22278200D00BF1F0071B782 /* SVGElement.cpp */; }; 4549 4552 B22279B70D00BF220071B782 /* SVGElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278210D00BF1F0071B782 /* SVGElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 6994 6997 052BFCE8128ABF1500FD338D /* GeolocationClientMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GeolocationClientMock.cpp; path = mock/GeolocationClientMock.cpp; sourceTree = "<group>"; }; 6995 6998 052BFCEA128ABF2100FD338D /* GeolocationClientMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GeolocationClientMock.h; path = mock/GeolocationClientMock.h; sourceTree = "<group>"; }; 6999 0562F9441573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSSVGDocumentValue.cpp; sourceTree = "<group>"; }; 7000 0562F9451573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSSVGDocumentValue.h; sourceTree = "<group>"; }; 7001 0562F9601573F88F0031CA16 /* PlatformLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformLayer.h; sourceTree = "<group>"; }; 6996 7002 05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMTimeStamp.h; sourceTree = "<group>"; }; 6997 7003 06027CAC0B1CBFC000884B2D /* ContextMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ContextMenuItem.h; sourceTree = "<group>"; }; … … 19549 19555 isa = PBXGroup; 19550 19556 children = ( 19557 0562F9601573F88F0031CA16 /* PlatformLayer.h */, 19551 19558 076F0D0812B8192700C26AA4 /* avfoundation */, 19552 19559 499B3EC0128CCC1800E726C2 /* ca */, … … 20997 21004 8AA61CFE144D595B00F37350 /* WebKitCSSRegionRule.h */, 20998 21005 8AD0A55614C87425000D83C5 /* WebKitCSSRegionRule.idl */, 21006 0562F9441573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp */, 21007 0562F9451573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h */, 20999 21008 5038BC0614711CDB0095E0D1 /* WebKitCSSShaderValue.cpp */, 21000 21009 50B42157146976960087E604 /* WebKitCSSShaderValue.h */, … … 24200 24209 BC9585E112F0989500755821 /* PlatformGestureEvent.h in Headers */, 24201 24210 935C476809AC4D4300A6AAB4 /* PlatformKeyboardEvent.h in Headers */, 24211 0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */, 24202 24212 932871C00B20DEB70049035A /* PlatformMenuDescription.h in Headers */, 24203 24213 41BF70100FE86F61005E8DEC /* PlatformMessagePortChannel.h in Headers */, … … 25044 25054 498391590F1E776900C23782 /* WebKitCSSMatrix.h in Headers */, 25045 25055 8AA61D00144D595B00F37350 /* WebKitCSSRegionRule.h in Headers */, 25056 0562F9471573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h in Headers */, 25046 25057 29CD61DE146D02890068E82A /* WebKitCSSShaderValue.h in Headers */, 25047 25058 BC9ADD230CC4032600098C4C /* WebKitCSSTransformValue.h in Headers */, … … 28109 28120 8AA61CFF144D595B00F37350 /* WebKitCSSRegionRule.cpp in Sources */, 28110 28121 5038BC0714711CDB0095E0D1 /* WebKitCSSShaderValue.cpp in Sources */, 28122 0562F9461573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp in Sources */, 28111 28123 BC9ADD800CC4092200098C4C /* WebKitCSSTransformValue.cpp in Sources */, 28112 28124 1A1414B513A0F0500019996C /* WebKitFontFamilyNames.cpp in Sources */, -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r121442 r121513 786 786 ReferenceFilterOperation* referenceOperation = static_cast<ReferenceFilterOperation*>(filterOperation); 787 787 filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::ReferenceFilterOperation); 788 filterValue->append(cssValuePool().createValue(referenceOperation-> reference(), CSSPrimitiveValue::CSS_STRING));788 filterValue->append(cssValuePool().createValue(referenceOperation->url(), CSSPrimitiveValue::CSS_STRING)); 789 789 break; 790 790 } -
trunk/Source/WebCore/css/CSSParser.cpp
r121442 r121513 95 95 #if ENABLE(CSS_FILTERS) 96 96 #include "WebKitCSSFilterValue.h" 97 #if ENABLE(SVG) 98 #include "WebKitCSSSVGDocumentValue.h" 99 #endif 97 100 #endif 98 101 … … 7559 7562 // See if the specified primitive is one we understand. 7560 7563 if (value->unit == CSSPrimitiveValue::CSS_URI) { 7564 #if ENABLE(SVG) 7561 7565 RefPtr<WebKitCSSFilterValue> referenceFilterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::ReferenceFilterOperation); 7562 7566 list->append(referenceFilterValue); 7563 referenceFilterValue->append(cssValuePool().createValue(value->string, CSSPrimitiveValue::CSS_STRING)); 7567 referenceFilterValue->append(WebKitCSSSVGDocumentValue::create(value->string)); 7568 #endif 7564 7569 } else { 7565 7570 const CSSParserString name = value->function->name; -
trunk/Source/WebCore/css/CSSValue.cpp
r120154 r121513 59 59 #include "WebKitCSSShaderValue.h" 60 60 #include "WebKitCSSTransformValue.h" 61 62 #if ENABLE(SVG) 63 #include "WebKitCSSSVGDocumentValue.h" 64 #endif 61 65 62 66 namespace WebCore { … … 198 202 case SVGPaintClass: 199 203 return static_cast<const SVGPaint*>(this)->customCssText(); 204 case WebKitCSSSVGDocumentClass: 205 return static_cast<const WebKitCSSSVGDocumentValue*>(this)->customCssText(); 200 206 #endif 201 207 } … … 331 337 case SVGPaintClass: 332 338 delete static_cast<SVGPaint*>(this); 339 return; 340 case WebKitCSSSVGDocumentClass: 341 delete static_cast<WebKitCSSSVGDocumentValue*>(this); 333 342 return; 334 343 #endif -
trunk/Source/WebCore/css/CSSValue.h
r121189 r121513 100 100 bool isSVGColor() const { return m_classType == SVGColorClass || m_classType == SVGPaintClass; } 101 101 bool isSVGPaint() const { return m_classType == SVGPaintClass; } 102 bool isWebKitCSSSVGDocumentValue() const { return m_classType == WebKitCSSSVGDocumentClass; } 102 103 #endif 103 104 … … 162 163 SVGColorClass, 163 164 SVGPaintClass, 165 WebKitCSSSVGDocumentClass, 164 166 #endif 165 167 -
trunk/Source/WebCore/css/StyleResolver.cpp
r121442 r121513 137 137 138 138 #if ENABLE(SVG) 139 #include "CachedSVGDocument.h" 140 #include "SVGDocument.h" 139 141 #include "SVGElement.h" 140 142 #include "SVGNames.h" 143 #include "SVGURIReference.h" 144 #include "WebKitCSSSVGDocumentValue.h" 141 145 #endif 142 146 … … 1794 1798 updateFont(); 1795 1799 1796 // Start loading images referenced by this style.1797 loadPending Images();1800 // Start loading resources referenced by this style. 1801 loadPendingResources(); 1798 1802 1799 #if ENABLE(CSS_SHADERS)1800 // Start loading the shaders referenced by this style.1801 loadPendingShaders();1802 #endif1803 1804 1803 // Add all the animating properties to the keyframe. 1805 1804 if (StylePropertySet* styleDeclaration = keyframe->properties()) { … … 1915 1914 adjustRenderStyle(style(), parentStyle, 0); 1916 1915 1917 // Start loading images referenced by this style. 1918 loadPendingImages(); 1919 1920 #if ENABLE(CSS_SHADERS) 1921 // Start loading the shaders referenced by this style. 1922 loadPendingShaders(); 1923 #endif 1916 // Start loading resources referenced by this style. 1917 loadPendingResources(); 1924 1918 1925 1919 // Now return the style. … … 1959 1953 applyMatchedProperties<LowPriorityProperties>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly); 1960 1954 1961 // Start loading images referenced by this style. 1962 loadPendingImages(); 1963 1964 #if ENABLE(CSS_SHADERS) 1965 // Start loading the shaders referenced by this style. 1966 loadPendingShaders(); 1967 #endif 1955 // Start loading resources referenced by this style. 1956 loadPendingResources(); 1968 1957 1969 1958 // Now return the style. … … 3010 2999 applyMatchedProperties<LowPriorityProperties>(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly); 3011 3000 applyMatchedProperties<LowPriorityProperties>(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); 3012 3013 loadPendingImages(); 3014 3015 #if ENABLE(CSS_SHADERS) 3016 loadPendingShaders(); 3017 #endif 3001 3002 // Start loading resources referenced by this style. 3003 loadPendingResources(); 3018 3004 3019 3005 ASSERT(!m_fontDirty); … … 5093 5079 } 5094 5080 5081 #if ENABLE(CSS_FILTERS) && ENABLE(SVG) 5082 void StyleResolver::loadPendingSVGDocuments() 5083 { 5084 if (!m_style->hasFilter() || m_pendingSVGDocuments.isEmpty()) 5085 return; 5086 5087 CachedResourceLoader* cachedResourceLoader = m_element->document()->cachedResourceLoader(); 5088 Vector<RefPtr<FilterOperation> >& filterOperations = m_style->filter().operations(); 5089 for (unsigned i = 0; i < filterOperations.size(); ++i) { 5090 RefPtr<FilterOperation> filterOperation = filterOperations.at(i); 5091 if (filterOperation->getOperationType() == FilterOperation::REFERENCE) { 5092 ReferenceFilterOperation* referenceFilter = static_cast<ReferenceFilterOperation*>(filterOperation.get()); 5093 5094 WebKitCSSSVGDocumentValue* value = m_pendingSVGDocuments.get(referenceFilter); 5095 if (!value) 5096 continue; 5097 CachedSVGDocument* cachedDocument = value->load(cachedResourceLoader); 5098 if (!cachedDocument) 5099 continue; 5100 5101 // Stash the CachedSVGDocument on the reference filter. 5102 referenceFilter->setData(cachedDocument); 5103 } 5104 } 5105 m_pendingSVGDocuments.clear(); 5106 } 5107 #endif 5108 5095 5109 #if ENABLE(CSS_SHADERS) 5096 5110 StyleShader* StyleResolver::styleShader(CSSValue* value) … … 5338 5352 } 5339 5353 #endif 5354 if (operationType == FilterOperation::REFERENCE) { 5355 #if ENABLE(SVG) 5356 if (filterValue->length() != 1) 5357 continue; 5358 CSSValue* argument = filterValue->itemWithoutBoundsCheck(0); 5359 5360 if (!argument->isWebKitCSSSVGDocumentValue()) 5361 continue; 5362 5363 WebKitCSSSVGDocumentValue* svgDocumentValue = static_cast<WebKitCSSSVGDocumentValue*>(argument); 5364 KURL url = m_element->document()->completeURL(svgDocumentValue->url()); 5365 5366 RefPtr<ReferenceFilterOperation> operation = ReferenceFilterOperation::create(svgDocumentValue->url(), url.fragmentIdentifier(), operationType); 5367 if (SVGURIReference::isExternalURIReference(svgDocumentValue->url(), m_element->document())) { 5368 if (!svgDocumentValue->loadRequested()) 5369 m_pendingSVGDocuments.set(operation.get(), svgDocumentValue); 5370 else 5371 operation->setData(svgDocumentValue->cachedSVGDocument()); 5372 } 5373 operations.operations().append(operation); 5374 #endif 5375 continue; 5376 } 5340 5377 5341 5378 // Check that all parameters are primitive values, with the … … 5355 5392 CSSPrimitiveValue* firstValue = filterValue->length() ? static_cast<CSSPrimitiveValue*>(filterValue->itemWithoutBoundsCheck(0)) : 0; 5356 5393 switch (filterValue->operationType()) { 5357 case WebKitCSSFilterValue::ReferenceFilterOperation: {5358 if (firstValue)5359 operations.operations().append(ReferenceFilterOperation::create(firstValue->getStringValue(), operationType));5360 break;5361 }5362 5394 case WebKitCSSFilterValue::GrayscaleFilterOperation: 5363 5395 case WebKitCSSFilterValue::SepiaFilterOperation: … … 5544 5576 } 5545 5577 5578 void StyleResolver::loadPendingResources() 5579 { 5580 // Start loading images referenced by this style. 5581 loadPendingImages(); 5582 5583 #if ENABLE(CSS_SHADERS) 5584 // Start loading the shaders referenced by this style. 5585 loadPendingShaders(); 5586 #endif 5587 5588 #if ENABLE(CSS_FILTERS) && ENABLE(SVG) 5589 // Start loading the SVG Documents referenced by this style. 5590 loadPendingSVGDocuments(); 5591 #endif 5592 } 5593 5546 5594 } // namespace WebCore -
trunk/Source/WebCore/css/StyleResolver.h
r121289 r121513 88 88 class WebKitCSSFilterValue; 89 89 class WebKitCSSShaderValue; 90 class WebKitCSSSVGDocumentValue; 90 91 91 92 #if ENABLE(CSS_SHADERS) … … 263 264 void loadPendingShaders(); 264 265 #endif 266 #if ENABLE(SVG) 267 void loadPendingSVGDocuments(); 268 #endif 265 269 #endif // ENABLE(CSS_FILTERS) 270 271 void loadPendingResources(); 266 272 267 273 struct RuleFeature { … … 496 502 #endif 497 503 504 #if ENABLE(CSS_FILTERS) && ENABLE(SVG) 505 HashMap<FilterOperation*, WebKitCSSSVGDocumentValue*> m_pendingSVGDocuments; 506 #endif 507 498 508 #if ENABLE(STYLE_SCOPED) 499 509 const ContainerNode* determineScope(const CSSStyleSheet*); -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r121461 r121513 39 39 #include "GraphicsLayerClient.h" 40 40 #include "IntRect.h" 41 #include "PlatformLayer.h" 41 42 #include "TransformationMatrix.h" 42 43 #include "TransformOperations.h" 43 44 #include <wtf/OwnPtr.h> 44 45 #include <wtf/PassOwnPtr.h> 45 46 #if PLATFORM(MAC)47 OBJC_CLASS CALayer;48 typedef CALayer PlatformLayer;49 #elif PLATFORM(WIN)50 typedef struct _CACFLayer PlatformLayer;51 #elif PLATFORM(QT)52 #if USE(TEXTURE_MAPPER)53 namespace WebCore {54 class TextureMapperPlatformLayer;55 typedef TextureMapperPlatformLayer PlatformLayer;56 };57 #else58 QT_BEGIN_NAMESPACE59 class QGraphicsObject;60 QT_END_NAMESPACE61 namespace WebCore {62 typedef QGraphicsObject PlatformLayer;63 }64 #endif65 #elif PLATFORM(CHROMIUM)66 namespace WebCore {67 class LayerChromium;68 typedef LayerChromium PlatformLayer;69 }70 #elif PLATFORM(GTK)71 #if USE(TEXTURE_MAPPER_CAIRO) || USE(TEXTURE_MAPPER_GL)72 namespace WebCore {73 class TextureMapperPlatformLayer;74 typedef TextureMapperPlatformLayer PlatformLayer;75 };76 #elif USE(CLUTTER)77 typedef struct _ClutterActor ClutterActor;78 namespace WebCore {79 typedef ClutterActor PlatformLayer;80 };81 #endif82 #else83 typedef void* PlatformLayer;84 #endif85 46 86 47 enum LayerTreeAsTextBehaviorFlags { -
trunk/Source/WebCore/platform/graphics/ImageBuffer.h
r121055 r121513 34 34 #include "GraphicsContext.h" 35 35 #if USE(ACCELERATED_COMPOSITING) 36 #include " GraphicsLayer.h"36 #include "PlatformLayer.h" 37 37 #endif 38 38 #include "GraphicsTypes.h" -
trunk/Source/WebCore/platform/graphics/filters/FilterOperation.h
r114520 r121513 34 34 #include <wtf/PassOwnPtr.h> 35 35 #include <wtf/RefCounted.h> 36 #include <wtf/text/ AtomicString.h>36 #include <wtf/text/WTFString.h> 37 37 38 38 // Annoyingly, wingdi.h #defines this. … … 148 148 class ReferenceFilterOperation : public FilterOperation { 149 149 public: 150 static PassRefPtr<ReferenceFilterOperation> create(const AtomicString& reference, OperationType type)151 { 152 return adoptRef(new ReferenceFilterOperation( reference, type));153 } 154 155 virtual PassRefPtr<FilterOperation> clone() const 156 { 157 // AtomicString is thread-hostile, so we can't be cloned.150 static PassRefPtr<ReferenceFilterOperation> create(const String& url, const String& fragment, OperationType type) 151 { 152 return adoptRef(new ReferenceFilterOperation(url, fragment, type)); 153 } 154 155 virtual PassRefPtr<FilterOperation> clone() const 156 { 157 // Unimplemented 158 158 return 0; 159 159 } … … 162 162 virtual bool movesPixels() const { return true; } 163 163 164 const AtomicString& reference() const { return m_reference; } 164 const String& url() const { return m_url; } 165 const String& fragment() const { return m_fragment; } 166 167 void* data() const { return m_data; } 168 void setData(void* data) { m_data = data; } 165 169 166 170 private: … … 171 175 return false; 172 176 const ReferenceFilterOperation* other = static_cast<const ReferenceFilterOperation*>(&o); 173 return m_reference == other->m_reference; 174 } 175 176 ReferenceFilterOperation(const AtomicString& reference, OperationType type) 177 : FilterOperation(type) 178 , m_reference(reference) 179 { 180 } 181 182 AtomicString m_reference; 177 return m_url == other->m_url; 178 } 179 180 ReferenceFilterOperation(const String& url, const String& fragment, OperationType type) 181 : FilterOperation(type) 182 , m_url(url) 183 , m_fragment(fragment) 184 , m_data(0) 185 { 186 } 187 188 String m_url; 189 String m_fragment; 190 void* m_data; 183 191 }; 184 192 -
trunk/Source/WebCore/platform/graphics/filters/FilterOperations.cpp
r115123 r121513 99 99 #endif 100 100 101 bool FilterOperations::hasReferenceFilter() const 102 { 103 for (size_t i = 0; i < m_operations.size(); ++i) { 104 if (m_operations.at(i)->getOperationType() == FilterOperation::REFERENCE) 105 return true; 106 } 107 return false; 108 } 109 101 110 bool FilterOperations::hasOutsets() const 102 111 { -
trunk/Source/WebCore/platform/graphics/filters/FilterOperations.h
r115123 r121513 73 73 bool hasCustomFilter() const; 74 74 #endif 75 bool hasReferenceFilter() const; 75 76 private: 76 77 Vector<RefPtr<FilterOperation> > m_operations; -
trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
r115868 r121513 28 28 29 29 #include "ImageBuffer.h" 30 #include "GraphicsLayer.h" 30 31 #include "LocalCurrentGraphicsContext.h" 31 32 #include "NSScrollerImpDetails.h" -
trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp
r120757 r121513 51 51 #endif 52 52 53 #if ENABLE(SVG) 54 #include "CachedSVGDocument.h" 55 #include "SVGElement.h" 56 #include "SVGFilterPrimitiveStandardAttributes.h" 57 #include "SourceAlpha.h" 58 #endif 59 53 60 namespace WebCore { 54 61 … … 109 116 } 110 117 118 PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(Document* document, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation* op) 119 { 120 #if ENABLE(SVG) 121 CachedSVGDocument* cachedSVGDocument = static_cast<CachedSVGDocument*>(op->data()); 122 123 // If we have an SVG document, this is an external reference. Otherwise 124 // we look up the referenced node in the current document. 125 if (cachedSVGDocument) 126 document = cachedSVGDocument->document(); 127 128 if (!document) 129 return 0; 130 131 Element* filter = document->getElementById(op->fragment()); 132 if (!filter) 133 return 0; 134 135 RefPtr<FilterEffect> effect; 136 137 // FIXME: Figure out what to do with SourceAlpha. Right now, we're 138 // using the alpha of the original input layer, which is obviously 139 // wrong. We should probably be extracting the alpha from the 140 // previousEffect, but this requires some more processing. 141 // This may need a spec clarification. 142 RefPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create(previousEffect, SourceAlpha::create(this)); 143 144 for (Node* node = filter->firstChild(); node; node = node->nextSibling()) { 145 if (!node->isSVGElement()) 146 continue; 147 148 SVGElement* element = static_cast<SVGElement*>(node); 149 if (!element->isFilterEffect()) 150 continue; 151 152 SVGFilterPrimitiveStandardAttributes* effectElement = static_cast<SVGFilterPrimitiveStandardAttributes*>(element); 153 154 effect = effectElement->build(builder.get(), this); 155 if (!effect) 156 continue; 157 158 effectElement->setStandardAttributes(effect.get()); 159 builder->add(effectElement->result(), effect); 160 m_effects.append(effect); 161 } 162 return effect; 163 #else 164 return 0; 165 #endif 166 } 167 111 168 bool FilterEffectRenderer::build(Document* document, const FilterOperations& operations) 112 169 { … … 123 180 m_effects.clear(); 124 181 125 RefPtr<FilterEffect> previousEffect ;182 RefPtr<FilterEffect> previousEffect = m_sourceGraphic; 126 183 for (size_t i = 0; i < operations.operations().size(); ++i) { 127 184 RefPtr<FilterEffect> effect; … … 129 186 switch (filterOperation->getOperationType()) { 130 187 case FilterOperation::REFERENCE: { 131 // FIXME: Not yet implemented. 132 // https://bugs.webkit.org/show_bug.cgi?id=72443 188 effect = buildReferenceFilter(document, previousEffect, static_cast<ReferenceFilterOperation*>(filterOperation)); 133 189 break; 134 190 } … … 292 348 effect->setClipsToBounds(false); 293 349 294 if ( previousEffect)350 if (filterOperation->getOperationType() != FilterOperation::REFERENCE) { 295 351 effect->inputEffects().append(previousEffect); 296 m_effects.append(effect); 352 m_effects.append(effect); 353 } 297 354 previousEffect = effect.release(); 298 355 } … … 300 357 301 358 // If we didn't make any effects, tell our caller we are not valid 302 if (! previousEffect)359 if (!m_effects.size()) 303 360 return false; 304 361 305 m_effects.first()->inputEffects().append(m_sourceGraphic);306 362 setMaxEffectRects(m_sourceDrawingRegion); 307 363 -
trunk/Source/WebCore/rendering/FilterEffectRenderer.h
r115138 r121513 101 101 102 102 bool build(Document*, const FilterOperations&); 103 PassRefPtr<FilterEffect> buildReferenceFilter(Document*, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation*); 103 104 bool updateBackingStoreRect(const FloatRect& filterRect); 104 105 void allocateBackingStoreIfNeeded(); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r121123 r121513 4995 4995 filterInfo()->removeCustomFilterClients(); 4996 4996 #endif 4997 4997 4998 #if ENABLE(SVG) 4999 if (renderer()->style()->filter().hasReferenceFilter()) 5000 ensureFilterInfo()->updateReferenceFilterClients(renderer()->style()->filter()); 5001 else if (hasFilterInfo()) 5002 filterInfo()->removeReferenceFilterClients(); 5003 #endif 5004 4998 5005 if (!paintsWithFilters()) { 4999 5006 // Don't delete the whole filter info here, because we might use it … … 5021 5028 { 5022 5029 renderer()->node()->setNeedsStyleRecalc(SyntheticStyleChange); 5023 renderer()->repaint(); 5030 if (renderer()->view()) 5031 renderer()->repaint(); 5024 5032 } 5025 5033 #endif -
trunk/Source/WebCore/rendering/RenderLayerFilterInfo.cpp
r115123 r121513 36 36 #include "RenderLayer.h" 37 37 38 #if ENABLE(SVG) 39 #include "CachedSVGDocument.h" 40 #include "SVGElement.h" 41 #include "SVGFilter.h" 42 #include "SVGFilterPrimitiveStandardAttributes.h" 43 #endif 44 38 45 #if ENABLE(CSS_SHADERS) 39 46 #include "CustomFilterOperation.h" … … 97 104 removeCustomFilterClients(); 98 105 #endif 106 #if ENABLE(SVG) 107 removeReferenceFilterClients(); 108 #endif 99 109 } 100 110 … … 103 113 m_renderer = renderer; 104 114 } 115 116 #if ENABLE(SVG) 117 void RenderLayerFilterInfo::notifyFinished(CachedResource*) 118 { 119 RenderObject* renderer = m_layer->renderer(); 120 renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange); 121 renderer->repaint(); 122 } 123 124 void RenderLayerFilterInfo::updateReferenceFilterClients(const FilterOperations& operations) 125 { 126 removeReferenceFilterClients(); 127 for (size_t i = 0; i < operations.size(); ++i) { 128 RefPtr<FilterOperation> filterOperation = operations.operations().at(i); 129 if (filterOperation->getOperationType() != FilterOperation::REFERENCE) 130 continue; 131 ReferenceFilterOperation* referenceFilterOperation = static_cast<ReferenceFilterOperation*>(filterOperation.get()); 132 CachedSVGDocument* cachedSVGDocument = static_cast<CachedSVGDocument*>(referenceFilterOperation->data()); 133 134 if (cachedSVGDocument) { 135 // Reference is external; wait for notifyFinished(). 136 cachedSVGDocument->addClient(this); 137 m_externalSVGReferences.append(cachedSVGDocument); 138 } else { 139 // Reference is internal; add layer as a client so we can trigger 140 // filter repaint on SVG attribute change. 141 Element* filter = m_layer->renderer()->node()->document()->getElementById(referenceFilterOperation->fragment()); 142 if (!filter || !filter->renderer()) 143 continue; 144 ASSERT(filter->renderer()->isSVGResourceContainer()); 145 filter->renderer()->toRenderSVGResourceContainer()->addClientRenderLayer(m_layer); 146 m_internalSVGReferences.append(filter); 147 } 148 } 149 } 150 151 void RenderLayerFilterInfo::removeReferenceFilterClients() 152 { 153 for (size_t i = 0; i < m_externalSVGReferences.size(); ++i) 154 m_externalSVGReferences.at(i)->removeClient(this); 155 m_externalSVGReferences.clear(); 156 for (size_t i = 0; i < m_internalSVGReferences.size(); ++i) { 157 Element* filter = m_internalSVGReferences.at(i).get(); 158 if (!filter->renderer()) 159 continue; 160 filter->renderer()->toRenderSVGResourceContainer()->removeClientRenderLayer(m_layer); 161 } 162 m_internalSVGReferences.clear(); 163 } 164 #endif 105 165 106 166 #if ENABLE(CSS_SHADERS) -
trunk/Source/WebCore/rendering/RenderLayerFilterInfo.h
r115123 r121513 33 33 #if ENABLE(CSS_FILTERS) 34 34 35 #if ENABLE(SVG) 36 #include "CachedSVGDocument.h" 37 #endif 38 #include "FilterOperation.h" 35 39 #include "LayoutTypes.h" 36 40 #include <wtf/HashMap.h> … … 54 58 #if ENABLE(CSS_SHADERS) 55 59 : public CustomFilterProgramClient 60 #if ENABLE(SVG) 61 , public CachedSVGDocumentClient 62 #endif 63 #elif ENABLE(SVG) 64 : public CachedSVGDocumentClient 56 65 #endif 57 66 { … … 76 85 #endif 77 86 78 87 #if ENABLE(SVG) 88 void updateReferenceFilterClients(const FilterOperations&); 89 virtual void notifyFinished(CachedResource*); 90 void removeReferenceFilterClients(); 91 #endif 92 79 93 private: 80 94 RenderLayerFilterInfo(RenderLayer*); … … 92 106 93 107 static RenderLayerFilterInfoMap* s_filterMap; 108 #if ENABLE(SVG) 109 Vector<RefPtr<Element> > m_internalSVGReferences; 110 Vector<CachedResourceHandle<CachedSVGDocument> > m_externalSVGReferences; 111 #endif 94 112 }; 95 113 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
r120706 r121513 23 23 #include "RenderSVGResourceContainer.h" 24 24 25 #include "RenderLayer.h" 25 26 #include "RenderSVGRoot.h" 26 27 #include "RenderView.h" … … 92 93 void RenderSVGResourceContainer::markAllClientsForInvalidation(InvalidationMode mode) 93 94 { 94 if ( m_clients.isEmpty() || m_isInvalidating)95 if ((m_clients.isEmpty() && m_clientLayers.isEmpty()) || m_isInvalidating) 95 96 return; 96 97 … … 112 113 RenderSVGResource::markForLayoutAndParentResourceInvalidation(client, needsLayout); 113 114 } 115 116 #if ENABLE(CSS_FILTERS) 117 HashSet<RenderLayer*>::iterator layerEnd = m_clientLayers.end(); 118 for (HashSet<RenderLayer*>::iterator it = m_clientLayers.begin(); it != layerEnd; ++it) 119 (*it)->filterNeedsRepaint(); 120 #endif 121 114 122 m_isInvalidating = false; 115 123 } … … 146 154 } 147 155 156 void RenderSVGResourceContainer::addClientRenderLayer(RenderLayer* client) 157 { 158 ASSERT(client); 159 m_clientLayers.add(client); 160 } 161 162 void RenderSVGResourceContainer::removeClientRenderLayer(RenderLayer* client) 163 { 164 ASSERT(client); 165 m_clientLayers.remove(client); 166 } 167 148 168 void RenderSVGResourceContainer::registerResource() 149 169 { -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceContainer.h
r120314 r121513 27 27 namespace WebCore { 28 28 29 class RenderLayer; 30 29 31 class RenderSVGResourceContainer : public RenderSVGHiddenContainer, 30 32 public RenderSVGResource { … … 43 45 44 46 void idChanged(); 47 void addClientRenderLayer(RenderLayer*); 48 void removeClientRenderLayer(RenderLayer*); 45 49 46 50 protected: … … 69 73 bool m_isInvalidating : 1; 70 74 HashSet<RenderObject*> m_clients; 75 HashSet<RenderLayer*> m_clientLayers; 71 76 }; 72 77 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
r111674 r121513 39 39 #include "RenderSVGResource.h" 40 40 #include "RenderSVGResourceFilterPrimitive.h" 41 #include "Settings.h"42 41 #include "SVGElement.h" 43 42 #include "SVGFilter.h" … … 48 47 #include "SVGStyledElement.h" 49 48 #include "SVGUnitTypes.h" 49 #include "Settings.h" 50 #include "SourceAlpha.h" 51 #include "SourceGraphic.h" 50 52 51 53 #include <wtf/UnusedParam.h> … … 102 104 103 105 // Add effects to the builder 104 RefPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create( filter);106 RefPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create(SourceGraphic::create(filter), SourceAlpha::create(filter)); 105 107 for (Node* node = filterElement->firstChild(); node; node = node->nextSibling()) { 106 108 if (!node->isSVGElement()) -
trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp
r95901 r121513 32 32 namespace WebCore { 33 33 34 SVGFilterBuilder::SVGFilterBuilder( Filter* filter)34 SVGFilterBuilder::SVGFilterBuilder(PassRefPtr<FilterEffect> sourceGraphic, PassRefPtr<FilterEffect> sourceAlpha) 35 35 { 36 m_builtinEffects.add(SourceGraphic::effectName(), SourceGraphic::create(filter));37 m_builtinEffects.add(SourceAlpha::effectName(), SourceAlpha::create(filter));36 m_builtinEffects.add(SourceGraphic::effectName(), sourceGraphic); 37 m_builtinEffects.add(SourceAlpha::effectName(), sourceAlpha); 38 38 addBuiltinEffects(); 39 39 } -
trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h
r95901 r121513 38 38 typedef HashSet<FilterEffect*> FilterEffectSet; 39 39 40 static PassRefPtr<SVGFilterBuilder> create( Filter* filter) { return adoptRef(new SVGFilterBuilder(filter)); }40 static PassRefPtr<SVGFilterBuilder> create(PassRefPtr<FilterEffect> sourceGraphic, PassRefPtr<FilterEffect> sourceAlpha) { return adoptRef(new SVGFilterBuilder(sourceGraphic, sourceAlpha)); } 41 41 42 42 void add(const AtomicString& id, PassRefPtr<FilterEffect>); … … 61 61 62 62 private: 63 SVGFilterBuilder( Filter*);63 SVGFilterBuilder(PassRefPtr<FilterEffect> sourceGraphic, PassRefPtr<FilterEffect> sourceAlpha); 64 64 65 65 inline void addBuiltinEffects()
Note: See TracChangeset
for help on using the changeset viewer.