[CSS Shaders] Remove the meshType from the CustomFilterOperation
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Apr 2013 23:06:35 +0000 (23:06 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Apr 2013 23:06:35 +0000 (23:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=102529

Patch by Qiankun Miao <qiankun.miao@intel.com> on 2013-04-25
Reviewed by Dean Jackson.

No new tests, no new functionality.

MeshType can be accessed from program, so remove the m_meshType
related code in CustomFilterOperation.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::createCustomFilterOperationWithInlineSyntax):
* platform/graphics/filters/CustomFilterOperation.cpp:
(WebCore::CustomFilterOperation::CustomFilterOperation):
(WebCore::CustomFilterOperation::blend):
* platform/graphics/filters/CustomFilterOperation.h:
(WebCore::CustomFilterOperation::create):
(WebCore::CustomFilterOperation::meshType):
(CustomFilterOperation):
(WebCore::CustomFilterOperation::operator==):
* platform/graphics/texmap/coordinated/CoordinatedCustomFilterOperation.h:
(WebCore::CoordinatedCustomFilterOperation::CoordinatedCustomFilterOperation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149153 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/platform/graphics/filters/CustomFilterOperation.cpp
Source/WebCore/platform/graphics/filters/CustomFilterOperation.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedCustomFilterOperation.h

index 01a8882..81b2330 100644 (file)
@@ -1,3 +1,28 @@
+2013-04-25  Qiankun Miao  <qiankun.miao@intel.com>
+
+        [CSS Shaders] Remove the meshType from the CustomFilterOperation
+        https://bugs.webkit.org/show_bug.cgi?id=102529
+
+        Reviewed by Dean Jackson.
+
+        No new tests, no new functionality.
+
+        MeshType can be accessed from program, so remove the m_meshType
+        related code in CustomFilterOperation.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::createCustomFilterOperationWithInlineSyntax):
+        * platform/graphics/filters/CustomFilterOperation.cpp:
+        (WebCore::CustomFilterOperation::CustomFilterOperation):
+        (WebCore::CustomFilterOperation::blend):
+        * platform/graphics/filters/CustomFilterOperation.h:
+        (WebCore::CustomFilterOperation::create):
+        (WebCore::CustomFilterOperation::meshType):
+        (CustomFilterOperation):
+        (WebCore::CustomFilterOperation::operator==):
+        * platform/graphics/texmap/coordinated/CoordinatedCustomFilterOperation.h:
+        (WebCore::CoordinatedCustomFilterOperation::CoordinatedCustomFilterOperation):
+
 2013-04-25  Kent Tamura  <tkent@chromium.org>
 
         Ignore invalid regular expressions for input[pattern].
index 78dedbb..6952793 100644 (file)
@@ -3903,7 +3903,7 @@ PassRefPtr<CustomFilterOperation> StyleResolver::createCustomFilterOperationWith
         return 0;
 
     RefPtr<CustomFilterProgram> program = lookupCustomFilterProgram(vertexShader, fragmentShader, programType, mixSettings, meshType);
-    return CustomFilterOperation::create(program.release(), parameterList, meshRows, meshColumns, meshType);
+    return CustomFilterOperation::create(program.release(), parameterList, meshRows, meshColumns);
 }
 
 PassRefPtr<CustomFilterOperation> StyleResolver::createCustomFilterOperation(WebKitCSSFilterValue* filterValue)
index cde358e..509a76c 100644 (file)
 
 namespace WebCore {
 
-CustomFilterOperation::CustomFilterOperation(PassRefPtr<CustomFilterProgram> program, const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
+CustomFilterOperation::CustomFilterOperation(PassRefPtr<CustomFilterProgram> program, const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns)
     : FilterOperation(CUSTOM)
     , m_program(program)
     , m_parameters(sortedParameters)
     , m_meshRows(meshRows)
     , m_meshColumns(meshColumns)
-    , m_meshType(meshType)
 {
     // Make sure that the parameters are alwyas sorted by name. We use that to merge two CustomFilterOperations in animations.
     ASSERT(m_parameters.checkAlphabeticalOrder());
@@ -65,13 +64,12 @@ PassRefPtr<FilterOperation> CustomFilterOperation::blend(const FilterOperation*
     const CustomFilterOperation* fromOp = static_cast<const CustomFilterOperation*>(from);
     if (m_program.get() != fromOp->m_program.get()
         || m_meshRows != fromOp->m_meshRows
-        || m_meshColumns != fromOp->m_meshColumns
-        || m_meshType != fromOp->m_meshType)
+        || m_meshColumns != fromOp->m_meshColumns)
         return this;
     
     CustomFilterParameterList animatedParameters;
     m_parameters.blend(fromOp->m_parameters, progress, size, animatedParameters);
-    return CustomFilterOperation::create(m_program, animatedParameters, m_meshRows, m_meshColumns, m_meshType);
+    return CustomFilterOperation::create(m_program, animatedParameters, m_meshRows, m_meshColumns);
 }
 
 } // namespace WebCore
index 681c6a7..447c605 100644 (file)
@@ -43,9 +43,9 @@ namespace WebCore {
 
 class CustomFilterOperation : public FilterOperation {
 public:
-    static PassRefPtr<CustomFilterOperation> create(PassRefPtr<CustomFilterProgram> program, const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
+    static PassRefPtr<CustomFilterOperation> create(PassRefPtr<CustomFilterProgram> program, const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns)
     {
-        return adoptRef(new CustomFilterOperation(program, sortedParameters, meshRows, meshColumns, meshType));
+        return adoptRef(new CustomFilterOperation(program, sortedParameters, meshRows, meshColumns));
     }
     
     CustomFilterProgram* program() const { return m_program.get(); }
@@ -56,7 +56,7 @@ public:
     unsigned meshRows() const { return m_meshRows; }
     unsigned meshColumns() const { return m_meshColumns; }
 
-    CustomFilterMeshType meshType() const { return m_meshType; }
+    CustomFilterMeshType meshType() const { return program() ? program()->meshType() : MeshTypeAttached; }
     
     virtual ~CustomFilterOperation();
     
@@ -67,7 +67,7 @@ public:
     virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress, const LayoutSize&, bool blendToPassthrough = false);
 
 protected:
-    CustomFilterOperation(PassRefPtr<CustomFilterProgram>, const CustomFilterParameterList&, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType);
+    CustomFilterOperation(PassRefPtr<CustomFilterProgram>, const CustomFilterParameterList&, unsigned meshRows, unsigned meshColumns);
     
 private:
     virtual bool operator==(const FilterOperation& o) const
@@ -79,7 +79,6 @@ private:
         return m_program.get() == other->m_program.get()
             && m_meshRows == other->m_meshRows
             && m_meshColumns == other->m_meshColumns
-            && m_meshType == other->m_meshType
             && m_parameters == other->m_parameters;
     }
 
@@ -88,7 +87,6 @@ private:
     
     unsigned m_meshRows;
     unsigned m_meshColumns;
-    CustomFilterMeshType m_meshType;
 };
 
 } // namespace WebCore
index f021b0b..8fdb053 100644 (file)
@@ -51,7 +51,7 @@ public:
 
 private:
     CoordinatedCustomFilterOperation(PassRefPtr<CustomFilterProgram> program, int programID, const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
-        : CustomFilterOperation(program, sortedParameters, meshRows, meshColumns, meshType)
+        : CustomFilterOperation(program, sortedParameters, meshRows, meshColumns)
         , m_programID(programID)
     {
     }