Coordinated Graphics: remove SurfaceUpdateInfo::encode/decode
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2013 00:11:26 +0000 (00:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2013 00:11:26 +0000 (00:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107794

Patch by Jae Hyun Park <jae.park@company100.net> on 2013-01-24
Reviewed by Anders Carlsson.

We want to remove the dependency on CoreIPC from SurfaceUpdateInfo
because we will extract Coordinated Graphics from WK2. Since
SurfaceUpdateInfo is only used in Coordinated Graphics, this patch
moves it to Shared/CoordinatedGraphics, and removes CoreIPC
dependency.

No new tests, no change in behavior.

* CMakeLists.txt:
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(CoreIPC::::encode):
(CoreIPC):
(CoreIPC::::decode):
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
(WebKit):
* Shared/CoordinatedGraphics/SurfaceUpdateInfo.h: Renamed from Source/WebKit2/Shared/SurfaceUpdateInfo.h.
(WebKit):
(SurfaceUpdateInfo):
(WebKit::SurfaceUpdateInfo::SurfaceUpdateInfo):
* Shared/SurfaceUpdateInfo.cpp: Removed.
* Target.pri:

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

Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp
Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h
Source/WebKit2/Shared/CoordinatedGraphics/SurfaceUpdateInfo.h [moved from Source/WebKit2/Shared/SurfaceUpdateInfo.h with 87% similarity]
Source/WebKit2/Shared/SurfaceUpdateInfo.cpp [deleted file]
Source/WebKit2/Target.pri

index 0a32346..b66da7b 100644 (file)
@@ -161,7 +161,6 @@ set(WebKit2_SOURCES
     Shared/SessionState.cpp
     Shared/ShareableBitmap.cpp
     Shared/StatisticsData.cpp
-    Shared/SurfaceUpdateInfo.cpp
     Shared/UpdateInfo.cpp
     Shared/VisitedLinkTable.cpp
     Shared/WebBackForwardListItem.cpp
index f095b50..f6c7f21 100644 (file)
@@ -1,3 +1,32 @@
+2013-01-24  Jae Hyun Park  <jae.park@company100.net>
+
+        Coordinated Graphics: remove SurfaceUpdateInfo::encode/decode
+        https://bugs.webkit.org/show_bug.cgi?id=107794
+
+        Reviewed by Anders Carlsson.
+
+        We want to remove the dependency on CoreIPC from SurfaceUpdateInfo
+        because we will extract Coordinated Graphics from WK2. Since
+        SurfaceUpdateInfo is only used in Coordinated Graphics, this patch
+        moves it to Shared/CoordinatedGraphics, and removes CoreIPC
+        dependency.
+
+        No new tests, no change in behavior.
+
+        * CMakeLists.txt:
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
+        (CoreIPC::::encode):
+        (CoreIPC):
+        (CoreIPC::::decode):
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
+        (WebKit):
+        * Shared/CoordinatedGraphics/SurfaceUpdateInfo.h: Renamed from Source/WebKit2/Shared/SurfaceUpdateInfo.h.
+        (WebKit):
+        (SurfaceUpdateInfo):
+        (WebKit::SurfaceUpdateInfo::SurfaceUpdateInfo):
+        * Shared/SurfaceUpdateInfo.cpp: Removed.
+        * Target.pri:
+
 2013-01-24  Anders Carlsson  <andersca@apple.com>
 
         More StorageAreaProxy cleanup
index 9c9f4c1..9e888e5 100644 (file)
@@ -30,6 +30,7 @@
 
 #if USE(COORDINATED_GRAPHICS)
 #include "CoordinatedLayerInfo.h"
+#include "SurfaceUpdateInfo.h"
 #include "WebCoreArgumentCoders.h"
 #include <WebCore/Animation.h>
 #include <WebCore/Color.h>
@@ -822,6 +823,16 @@ bool ArgumentCoder<CoordinatedLayerInfo>::decode(ArgumentDecoder* decoder, Coord
     return SimpleArgumentCoder<CoordinatedLayerInfo>::decode(decoder, coordinatedLayerInfo);
 }
 
+void ArgumentCoder<SurfaceUpdateInfo>::encode(ArgumentEncoder& encoder, const SurfaceUpdateInfo& surfaceUpdateInfo)
+{
+    SimpleArgumentCoder<SurfaceUpdateInfo>::encode(encoder, surfaceUpdateInfo);
+}
+
+bool ArgumentCoder<SurfaceUpdateInfo>::decode(ArgumentDecoder* decoder, SurfaceUpdateInfo& surfaceUpdateInfo)
+{
+    return SimpleArgumentCoder<SurfaceUpdateInfo>::decode(decoder, surfaceUpdateInfo);
+}
+
 } // namespace CoreIPC
 
 #endif // USE(COORDINATED_GRAPHICS)
index cda934a..0b5e14c 100644 (file)
@@ -54,6 +54,7 @@ struct GraphicsSurfaceToken;
 
 namespace WebKit {
 struct CoordinatedLayerInfo;
+class SurfaceUpdateInfo;
 }
 
 namespace CoreIPC {
@@ -114,6 +115,11 @@ template<> struct ArgumentCoder<WebKit::CoordinatedLayerInfo> {
     static bool decode(ArgumentDecoder*, WebKit::CoordinatedLayerInfo&);
 };
 
+template<> struct ArgumentCoder<WebKit::SurfaceUpdateInfo> {
+    static void encode(ArgumentEncoder&, const WebKit::SurfaceUpdateInfo&);
+    static bool decode(ArgumentDecoder*, WebKit::SurfaceUpdateInfo&);
+};
+
 } // namespace CoreIPC
 
 #endif // USE(COORDINATED_GRAPHICS)
 #ifndef SurfaceUpdateInfo_h
 #define SurfaceUpdateInfo_h
 
+#if USE(COORDINATED_GRAPHICS)
+
 #include <WebCore/IntRect.h>
 #include <wtf/Noncopyable.h>
 
-namespace CoreIPC {
-class ArgumentDecoder;
-class ArgumentEncoder;
-}
-
 namespace WebKit {
 
 class SurfaceUpdateInfo {
@@ -36,9 +33,6 @@ class SurfaceUpdateInfo {
 public:
     SurfaceUpdateInfo() { }
 
-    void encode(CoreIPC::ArgumentEncoder&) const;
-    static bool decode(CoreIPC::ArgumentDecoder*, SurfaceUpdateInfo&);
-
     // The rect to be updated.
     WebCore::IntRect updateRect;
 
@@ -54,4 +48,6 @@ public:
 
 } // namespace WebKit
 
-#endif // UpdateInfo_h
+#endif // USE(COORDINATED_GRAPHICS)
+
+#endif // SurfaceUpdateInfo_h
diff --git a/Source/WebKit2/Shared/SurfaceUpdateInfo.cpp b/Source/WebKit2/Shared/SurfaceUpdateInfo.cpp
deleted file mode 100644 (file)
index 4147cea..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB.  If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "SurfaceUpdateInfo.h"
-
-#include "WebCoreArgumentCoders.h"
-
-namespace WebKit {
-
-void SurfaceUpdateInfo::encode(CoreIPC::ArgumentEncoder& encoder) const
-{
-    encoder.encode(updateRect);
-    encoder.encode(scaleFactor);
-    encoder.encode(atlasID);
-    encoder.encode(surfaceOffset);
-}
-
-bool SurfaceUpdateInfo::decode(CoreIPC::ArgumentDecoder* decoder, SurfaceUpdateInfo& result)
-{
-    if (!decoder->decode(result.updateRect))
-        return false;
-    if (!decoder->decode(result.scaleFactor))
-        return false;
-    if (!decoder->decode(result.atlasID))
-        return false;
-    if (!decoder->decode(result.surfaceOffset))
-        return false;
-
-    return true;
-}
-
-} // namespace WebKit
index c812450..0f40ac3 100644 (file)
@@ -99,7 +99,6 @@ HEADERS += \
     Shared/SessionState.h \
     Shared/StatisticsData.h \
     Shared/StringPairVector.h \
-    Shared/SurfaceUpdateInfo.h \
     Shared/UpdateInfo.h \
     Shared/UserMessageCoders.h \
     Shared/VisitedLinkTable.h \
@@ -137,6 +136,7 @@ HEADERS += \
     Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h \
     Shared/CoordinatedGraphics/CoordinatedLayerInfo.h \
     Shared/CoordinatedGraphics/CoordinatedSurface.h \
+    Shared/CoordinatedGraphics/SurfaceUpdateInfo.h \
     Shared/CoordinatedGraphics/WebCoordinatedSurface.h \
     Shared/CoordinatedGraphics/WebCustomFilterProgram.h \
     Shared/Plugins/Netscape/NetscapePluginModule.h \
@@ -474,7 +474,6 @@ SOURCES += \
     Shared/SecurityOriginData.cpp \
     Shared/SessionState.cpp \
     Shared/StatisticsData.cpp \
-    Shared/SurfaceUpdateInfo.cpp \
     Shared/UpdateInfo.cpp \
     Shared/VisitedLinkTable.cpp \
     Shared/WebBackForwardListItem.cpp \