Title: [135455] trunk/Source/WebCore
Revision
135455
Author
k...@webkit.org
Date
2012-11-21 16:28:05 -0800 (Wed, 21 Nov 2012)

Log Message

Make CachedSVGDocumentReference independent of FilterOperation
https://bugs.webkit.org/show_bug.cgi?id=102967

Reviewed by Antti Koivisto.

Make CachedSVGDocumentReference independent of FilterOperation to reuse the code for clip-path and masking.

No new tests, refactoring.

* GNUmakefile.list.am: Move CachedSVGDocumentReference to it's proper location and it to the projects.
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::loadPendingSVGDocuments):
(WebCore::StyleResolver::createFilterOperations):
* loader/cache/CachedSVGDocumentReference.h: Renamed from Source/WebCore/css/CachedSVGDocumentReference.h.
(WebCore):
(CachedSVGDocumentReference):
(WebCore::CachedSVGDocumentReference::CachedSVGDocumentReference):
(WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
(WebCore::CachedSVGDocumentReference::document):
* platform/graphics/filters/FilterOperation.h: Rename data() and setData() to
    cachedSVGDocumentReference() and its setter. Adapt other classes.
(WebCore::FilterOperation::ReferenceFilterOperation::cachedSVGDocumentReference):
(WebCore::FilterOperation::ReferenceFilterOperation::setCachedSVGDocumentReference):
(ReferenceFilterOperation):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayerFilterInfo::updateReferenceFilterClients):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135454 => 135455)


--- trunk/Source/WebCore/ChangeLog	2012-11-22 00:25:51 UTC (rev 135454)
+++ trunk/Source/WebCore/ChangeLog	2012-11-22 00:28:05 UTC (rev 135455)
@@ -1,3 +1,37 @@
+2012-11-21  Dirk Schulze  <k...@webkit.org>
+
+        Make CachedSVGDocumentReference independent of FilterOperation
+        https://bugs.webkit.org/show_bug.cgi?id=102967
+
+        Reviewed by Antti Koivisto.
+
+        Make CachedSVGDocumentReference independent of FilterOperation to reuse the code for clip-path and masking.
+
+        No new tests, refactoring.
+
+        * GNUmakefile.list.am: Move CachedSVGDocumentReference to it's proper location and it to the projects. 
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::loadPendingSVGDocuments):
+        (WebCore::StyleResolver::createFilterOperations):
+        * loader/cache/CachedSVGDocumentReference.h: Renamed from Source/WebCore/css/CachedSVGDocumentReference.h.
+        (WebCore):
+        (CachedSVGDocumentReference):
+        (WebCore::CachedSVGDocumentReference::CachedSVGDocumentReference):
+        (WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
+        (WebCore::CachedSVGDocumentReference::document):
+        * platform/graphics/filters/FilterOperation.h: Rename data() and setData() to
+            cachedSVGDocumentReference() and its setter. Adapt other classes.
+        (WebCore::FilterOperation::ReferenceFilterOperation::cachedSVGDocumentReference):
+        (WebCore::FilterOperation::ReferenceFilterOperation::setCachedSVGDocumentReference):
+        (ReferenceFilterOperation):
+        * rendering/FilterEffectRenderer.cpp:
+        (WebCore::FilterEffectRenderer::buildReferenceFilter):
+        * rendering/RenderLayerFilterInfo.cpp:
+        (WebCore::RenderLayerFilterInfo::updateReferenceFilterClients):
+
 2012-11-21  James Simonsen  <simon...@chromium.org>
 
         Remove the concept of initiatorDocument from CachedResourceRequest

Modified: trunk/Source/WebCore/GNUmakefile.list.am (135454 => 135455)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-11-22 00:25:51 UTC (rev 135454)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-11-22 00:28:05 UTC (rev 135455)
@@ -3843,6 +3843,7 @@
 	Source/WebCore/loader/cache/CachedStyleSheetClient.h \
 	Source/WebCore/loader/cache/CachedSVGDocument.cpp \
 	Source/WebCore/loader/cache/CachedSVGDocument.h \
+	Source/WebCore/loader/cache/CachedSVGDocumentReference.h \
 	Source/WebCore/loader/cache/CachedTextTrack.cpp \
 	Source/WebCore/loader/cache/CachedTextTrack.h \
 	Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp \

Modified: trunk/Source/WebCore/WebCore.gypi (135454 => 135455)


--- trunk/Source/WebCore/WebCore.gypi	2012-11-22 00:25:51 UTC (rev 135454)
+++ trunk/Source/WebCore/WebCore.gypi	2012-11-22 00:28:05 UTC (rev 135455)
@@ -3050,6 +3050,7 @@
             'loader/cache/CachedShader.h',
             'loader/cache/CachedSVGDocument.cpp',
             'loader/cache/CachedSVGDocument.h',
+            'loader/cache/CachedSVGDocumentReference.h',
             'loader/cache/CachedTextTrack.cpp',
             'loader/cache/CachedTextTrack.h',
             'loader/cache/CachedXSLStyleSheet.cpp',

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (135454 => 135455)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-11-22 00:25:51 UTC (rev 135454)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-11-22 00:28:05 UTC (rev 135455)
@@ -28277,6 +28277,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\loader\cache\CachedSVGDocumentReference.h"
+					>
+				</File>
+				<File
 					RelativePath="..\loader\cache\CachedXSLStyleSheet.cpp"
 					>
 				</File>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (135454 => 135455)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-11-22 00:25:51 UTC (rev 135454)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-11-22 00:28:05 UTC (rev 135455)
@@ -3448,7 +3448,6 @@
 		9712A5AE15004EDA0048AF10 /* DOMWindowIndexedDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A55515004EDA0048AF10 /* DOMWindowIndexedDatabase.h */; };
 		9712A5B015004EDA0048AF10 /* IDBAny.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A55715004EDA0048AF10 /* IDBAny.cpp */; };
 		9712A5B115004EDA0048AF10 /* IDBAny.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A55815004EDA0048AF10 /* IDBAny.h */; };
-		9712A5E515004EDA0048AF10 /* IDBBackingStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A58C15004EDA0048AF10 /* IDBBackingStore.cpp */; };
 		9712A5B315004EDA0048AF10 /* IDBBackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A55A15004EDA0048AF10 /* IDBBackingStore.h */; };
 		9712A5B415004EDA0048AF10 /* IDBCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A55B15004EDA0048AF10 /* IDBCallbacks.h */; };
 		9712A5B515004EDA0048AF10 /* IDBCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A55C15004EDA0048AF10 /* IDBCursor.cpp */; };
@@ -3488,6 +3487,7 @@
 		9712A5DF15004EDA0048AF10 /* IDBKeyPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A58615004EDA0048AF10 /* IDBKeyPath.h */; };
 		9712A5E215004EDA0048AF10 /* IDBKeyRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A58915004EDA0048AF10 /* IDBKeyRange.cpp */; };
 		9712A5E315004EDA0048AF10 /* IDBKeyRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A58A15004EDA0048AF10 /* IDBKeyRange.h */; };
+		9712A5E515004EDA0048AF10 /* IDBBackingStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A58C15004EDA0048AF10 /* IDBBackingStore.cpp */; };
 		9712A5E715004EDA0048AF10 /* IDBLevelDBCoding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A58E15004EDA0048AF10 /* IDBLevelDBCoding.cpp */; };
 		9712A5E815004EDA0048AF10 /* IDBLevelDBCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A58F15004EDA0048AF10 /* IDBLevelDBCoding.h */; };
 		9712A5E915004EDA0048AF10 /* IDBObjectStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A59015004EDA0048AF10 /* IDBObjectStore.cpp */; };
@@ -6376,6 +6376,7 @@
 		FABE72F91059C1EB00D999DD /* MathMLMathElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FABE72F21059C1EB00D999DD /* MathMLMathElement.h */; };
 		FABE72FD1059C21100D999DD /* MathMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */; };
 		FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72FC1059C21100D999DD /* MathMLNames.cpp */; };
+		FB2C15C3165D649D0039C9F8 /* CachedSVGDocumentReference.h in Headers */ = {isa = PBXBuildFile; fileRef = FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FB78AD2E151BF5E600FE54D3 /* CSSParserMode.h in Headers */ = {isa = PBXBuildFile; fileRef = FB78AD2C151BF5D200FE54D3 /* CSSParserMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FB92DF4B15FED08700994433 /* ClipPathOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = FB92DF4915FED08700994433 /* ClipPathOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FBC220DF1237FBEB00BCF788 /* GraphicsContext3DOpenGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FBC220DE1237FBEB00BCF788 /* GraphicsContext3DOpenGL.cpp */; };
@@ -9106,8 +9107,8 @@
 		65F80697054D9F86008BF776 /* BlockExceptions.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlockExceptions.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		65FEA86809833ADE00BED4AB /* Page.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Page.cpp; sourceTree = "<group>"; };
 		6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NativeImagePtr.h; sourceTree = "<group>"; };
-		6C638893A96CCEE50C8C946C /* CachedResourceRequestInitiators.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CachedResourceRequestInitiators.h; path = CachedResourceRequestInitiators.h; sourceTree = "<group>"; };
-		6C638894A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = CachedResourceRequestInitiators.cpp; path = CachedResourceRequestInitiators.cpp; sourceTree = "<group>"; };
+		6C638893A96CCEE50C8C946C /* CachedResourceRequestInitiators.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedResourceRequestInitiators.h; sourceTree = "<group>"; };
+		6C638894A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceRequestInitiators.cpp; sourceTree = "<group>"; };
 		6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3D.cpp; sourceTree = "<group>"; };
 		6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DCG.cpp; sourceTree = "<group>"; };
 		6E3FAD3614733F4000E42306 /* JSWebGLCompressedTextureS3TC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLCompressedTextureS3TC.cpp; sourceTree = "<group>"; };
@@ -10742,7 +10743,6 @@
 		9712A58A15004EDA0048AF10 /* IDBKeyRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IDBKeyRange.h; path = Modules/indexeddb/IDBKeyRange.h; sourceTree = "<group>"; };
 		9712A58B15004EDA0048AF10 /* IDBKeyRange.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = IDBKeyRange.idl; path = Modules/indexeddb/IDBKeyRange.idl; sourceTree = "<group>"; };
 		9712A58C15004EDA0048AF10 /* IDBBackingStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IDBBackingStore.cpp; path = Modules/indexeddb/IDBBackingStore.cpp; sourceTree = "<group>"; };
-		9712A58D15004EDA0048AF10 /* IDBBackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IDBBackingStore.h; path = Modules/indexeddb/IDBBackingStore.h; sourceTree = "<group>"; };
 		9712A58E15004EDA0048AF10 /* IDBLevelDBCoding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IDBLevelDBCoding.cpp; path = Modules/indexeddb/IDBLevelDBCoding.cpp; sourceTree = "<group>"; };
 		9712A58F15004EDA0048AF10 /* IDBLevelDBCoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IDBLevelDBCoding.h; path = Modules/indexeddb/IDBLevelDBCoding.h; sourceTree = "<group>"; };
 		9712A59015004EDA0048AF10 /* IDBObjectStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IDBObjectStore.cpp; path = Modules/indexeddb/IDBObjectStore.cpp; sourceTree = "<group>"; };
@@ -13866,6 +13866,7 @@
 		FABE72F31059C1EB00D999DD /* mathtags.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mathtags.in; sourceTree = "<group>"; };
 		FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLElementFactory.cpp; sourceTree = "<group>"; };
 		FABE72FC1059C21100D999DD /* MathMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLNames.cpp; sourceTree = "<group>"; };
+		FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGDocumentReference.h; sourceTree = "<group>"; };
 		FB78AD2C151BF5D200FE54D3 /* CSSParserMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSParserMode.h; sourceTree = "<group>"; };
 		FB92DF4915FED08700994433 /* ClipPathOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipPathOperation.h; sourceTree = "<group>"; };
 		FBC220DE1237FBEB00BCF788 /* GraphicsContext3DOpenGL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DOpenGL.cpp; sourceTree = "<group>"; };
@@ -19325,6 +19326,7 @@
 				D0BC54481443AC4A00E105DA /* CachedStyleSheetClient.h */,
 				A104F24114C71F7A009E2C23 /* CachedSVGDocument.cpp */,
 				A104F24214C71F7A009E2C23 /* CachedSVGDocument.h */,
+				FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */,
 				0753860014489E9800B78452 /* CachedTextTrack.cpp */,
 				0753860114489E9800B78452 /* CachedTextTrack.h */,
 				BCB16C0E0979C3BD00467741 /* CachedXSLStyleSheet.cpp */,
@@ -25792,6 +25794,7 @@
 				1E50084716516AD800B7E098 /* RenderThemeMacShared.h in Headers */,
 				53EF766B16530A61004CBE49 /* SettingsMacros.h in Headers */,
 				447958041643B49A001E0A7F /* ParsedContentType.h in Headers */,
+				FB2C15C3165D649D0039C9F8 /* CachedSVGDocumentReference.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Deleted: trunk/Source/WebCore/css/CachedSVGDocumentReference.h (135454 => 135455)


--- trunk/Source/WebCore/css/CachedSVGDocumentReference.h	2012-11-22 00:25:51 UTC (rev 135454)
+++ trunk/Source/WebCore/css/CachedSVGDocumentReference.h	2012-11-22 00:28:05 UTC (rev 135455)
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef CachedSVGDocumentReference_h
-#define CachedSVGDocumentReference_h
-
-#if ENABLE(SVG) && ENABLE(CSS_FILTERS)
-#include "CachedResourceHandle.h"
-#include "FilterOperation.h"
-
-namespace WebCore {
-
-class CachedSVGDocument;
-
-class CachedSVGDocumentReference : public ReferenceFilterOperation::Data, public CachedSVGDocumentClient {
-public:
-    CachedSVGDocumentReference(CachedSVGDocument* document) : m_document(document) { m_document->addClient(this); }
-    virtual ~CachedSVGDocumentReference() { m_document->removeClient(this); }
-    CachedSVGDocument* document() { return m_document.get(); }
-private:
-    CachedResourceHandle<CachedSVGDocument> m_document;
-};
-
-};
-
-#endif
-
-#endif

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (135454 => 135455)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2012-11-22 00:25:51 UTC (rev 135454)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2012-11-22 00:28:05 UTC (rev 135455)
@@ -4588,7 +4588,7 @@
                 continue;
 
             // Stash the CachedSVGDocument on the reference filter.
-            referenceFilter->setData(adoptPtr(new CachedSVGDocumentReference(cachedDocument)));
+            referenceFilter->setCachedSVGDocumentReference(adoptPtr(new CachedSVGDocumentReference(cachedDocument)));
         }
     }
     m_pendingSVGDocuments.clear();
@@ -4933,7 +4933,7 @@
                 if (!svgDocumentValue->loadRequested())
                     m_pendingSVGDocuments.set(operation.get(), svgDocumentValue);
                 else if (svgDocumentValue->cachedSVGDocument())
-                    operation->setData(adoptPtr(new CachedSVGDocumentReference(svgDocumentValue->cachedSVGDocument())));
+                    operation->setCachedSVGDocumentReference(adoptPtr(new CachedSVGDocumentReference(svgDocumentValue->cachedSVGDocument())));
             }
             operations.operations().append(operation);
 #endif

Copied: trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.h (from rev 135453, trunk/Source/WebCore/css/CachedSVGDocumentReference.h) (0 => 135455)


--- trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.h	                        (rev 0)
+++ trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.h	2012-11-22 00:28:05 UTC (rev 135455)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CachedSVGDocumentReference_h
+#define CachedSVGDocumentReference_h
+
+#if ENABLE(SVG) && ENABLE(CSS_FILTERS)
+#include "CachedResourceHandle.h"
+#include "CachedSVGDocument.h"
+
+namespace WebCore {
+
+class CachedSVGDocumentReference : public CachedSVGDocumentClient {
+public:
+    CachedSVGDocumentReference(CachedSVGDocument* document) : m_document(document) { m_document->addClient(this); }
+    virtual ~CachedSVGDocumentReference() { m_document->removeClient(this); }
+    CachedSVGDocument* document() { return m_document.get(); }
+private:
+    CachedResourceHandle<CachedSVGDocument> m_document;
+};
+
+};
+
+#endif
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/filters/FilterOperation.h (135454 => 135455)


--- trunk/Source/WebCore/platform/graphics/filters/FilterOperation.h	2012-11-22 00:25:51 UTC (rev 135454)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterOperation.h	2012-11-22 00:28:05 UTC (rev 135455)
@@ -28,6 +28,7 @@
 
 #if ENABLE(CSS_FILTERS)
 
+#include "CachedSVGDocumentReference.h"
 #include "Color.h"
 #include "FilterEffect.h"
 #include "LayoutSize.h"
@@ -163,19 +164,15 @@
         return adoptRef(new ReferenceFilterOperation(url, fragment, type));
     }
 
-    class Data {
-    public:
-        virtual ~Data() { }
-    };
-
     virtual bool affectsOpacity() const { return true; }
     virtual bool movesPixels() const { return true; }
 
     const String& url() const { return m_url; }
     const String& fragment() const { return m_fragment; }
 
-    Data* data() const { return m_data.get(); }
-    void setData(PassOwnPtr<Data> data) { m_data = data; }
+    CachedSVGDocumentReference* cachedSVGDocumentReference() const { return m_cachedSVGDocumentReference.get(); }
+    void setCachedSVGDocumentReference(PassOwnPtr<CachedSVGDocumentReference> cachedSVGDocumentReference) { m_cachedSVGDocumentReference = cachedSVGDocumentReference; }
+
     FilterEffect* filterEffect() const { return m_filterEffect.get(); }
     void setFilterEffect(PassRefPtr<FilterEffect> filterEffect) { m_filterEffect = filterEffect; }
 
@@ -198,7 +195,7 @@
 
     String m_url;
     String m_fragment;
-    OwnPtr<Data> m_data;
+    OwnPtr<CachedSVGDocumentReference> m_cachedSVGDocumentReference;
     RefPtr<FilterEffect> m_filterEffect;
 };
 

Modified: trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp (135454 => 135455)


--- trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp	2012-11-22 00:25:51 UTC (rev 135454)
+++ trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp	2012-11-22 00:28:05 UTC (rev 135455)
@@ -122,10 +122,10 @@
     return sourceImage() ? sourceImage()->context() : 0;
 }
 
-PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(Document* document, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation* op)
+PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(Document* document, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation* filterOperation)
 {
 #if ENABLE(SVG)
-    CachedSVGDocumentReference* cachedSVGDocumentReference = static_cast<CachedSVGDocumentReference*>(op->data());
+    CachedSVGDocumentReference* cachedSVGDocumentReference = filterOperation->cachedSVGDocumentReference();
     CachedSVGDocument* cachedSVGDocument = cachedSVGDocumentReference ? cachedSVGDocumentReference->document() : 0;
 
     // If we have an SVG document, this is an external reference. Otherwise
@@ -136,7 +136,7 @@
     if (!document)
         return 0;
 
-    Element* filter = document->getElementById(op->fragment());
+    Element* filter = document->getElementById(filterOperation->fragment());
     if (!filter)
         return 0;
 
@@ -171,7 +171,7 @@
 #else
     UNUSED_PARAM(document);
     UNUSED_PARAM(previousEffect);
-    UNUSED_PARAM(op);
+    UNUSED_PARAM(filterOperation);
     return 0;
 #endif
 }

Modified: trunk/Source/WebCore/rendering/RenderLayerFilterInfo.cpp (135454 => 135455)


--- trunk/Source/WebCore/rendering/RenderLayerFilterInfo.cpp	2012-11-22 00:25:51 UTC (rev 135454)
+++ trunk/Source/WebCore/rendering/RenderLayerFilterInfo.cpp	2012-11-22 00:28:05 UTC (rev 135455)
@@ -130,7 +130,7 @@
         if (filterOperation->getOperationType() != FilterOperation::REFERENCE)
             continue;
         ReferenceFilterOperation* referenceFilterOperation = static_cast<ReferenceFilterOperation*>(filterOperation.get());
-        CachedSVGDocumentReference* documentReference = static_cast<CachedSVGDocumentReference*>(referenceFilterOperation->data());
+        CachedSVGDocumentReference* documentReference = referenceFilterOperation->cachedSVGDocumentReference();
         CachedSVGDocument* cachedSVGDocument = documentReference ? documentReference->document() : 0;
 
         if (cachedSVGDocument) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to