[Refactoring] Move PlatformSurfacePoolEfl to PlatformSurfacePoolTizen
authorGyuyoung Kim <gyuyoung.kim@samsung.com>
Mon, 1 Apr 2013 07:22:04 +0000 (16:22 +0900)
committerGerrit Code Review <gerrit2@kim11>
Tue, 2 Apr 2013 06:58:28 +0000 (15:58 +0900)
Change-Id: I532fb2332b786d17c3623717922efd89554b2ff5

13 files changed:
Source/WebKit2/PlatformTizen.cmake
Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.h
Source/WebKit2/WebProcess/WebPage/efl/tizen/LinkMagnifier.cpp [changed mode: 0755->0644]
Source/WebKit2/WebProcess/WebPage/efl/tizen/LinkMagnifier.h [changed mode: 0755->0644]
Source/WebKit2/WebProcess/WebPage/efl/tizen/PlatformSurfacePoolTizen.cpp [moved from Source/WebKit2/WebProcess/WebPage/efl/PlatformSurfacePoolEfl.cpp with 86% similarity]
Source/WebKit2/WebProcess/WebPage/efl/tizen/PlatformSurfacePoolTizen.h [moved from Source/WebKit2/WebProcess/WebPage/efl/PlatformSurfacePoolEfl.h with 91% similarity]
Source/WebKit2/WebProcess/WebPage/efl/tizen/ScreenReader.cpp [changed mode: 0755->0644]
Source/WebKit2/WebProcess/WebPage/efl/tizen/ScreenReader.h [changed mode: 0755->0644]
Source/WebKit2/WebProcess/WebPage/efl/tizen/TiledBackingStoreRemoteTileTizen.cpp [moved from Source/WebKit2/WebProcess/WebPage/efl/TiledBackingStoreRemoteTileTizen.cpp with 98% similarity]
Source/WebKit2/WebProcess/WebPage/efl/tizen/TiledBackingStoreRemoteTileTizen.h [moved from Source/WebKit2/WebProcess/WebPage/efl/TiledBackingStoreRemoteTileTizen.h with 97% similarity]
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/efl/WebProcessEfl.cpp

index 9cea7eb..0374559 100755 (executable)
@@ -147,12 +147,10 @@ LIST(APPEND WebKit2StaticForDebug_SOURCES
     WebProcess/WebCoreSupport/tizen/WebErrorsTizen.cpp
 
     WebProcess/WebPage/cairo/RecordingSurfaceSetCairo.cpp
-    WebProcess/WebPage/efl/PlatformSurfacePoolEfl.cpp
-    WebProcess/WebPage/efl/TiledBackingStoreRemoteTileTizen.cpp
     WebProcess/WebPage/efl/tizen/LinkMagnifier.cpp
-
+    WebProcess/WebPage/efl/tizen/PlatformSurfacePoolTizen.cpp
     WebProcess/WebPage/efl/tizen/ScreenReader.cpp
-
+    WebProcess/WebPage/efl/tizen/TiledBackingStoreRemoteTileTizen.cpp
     WebProcess/WebPage/efl/tizen/WebPageSerializerTizen.cpp
 )
 
index 5e1eddf..2c676f9 100755 (executable)
@@ -47,7 +47,7 @@
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-#include "efl/TiledBackingStoreRemoteTileTizen.h"
+#include "efl/tizen/TiledBackingStoreRemoteTileTizen.h"
 #endif
 
 #if USE(UI_SIDE_COMPOSITING)
@@ -26,7 +26,7 @@
 #include "config.h"
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-#include "PlatformSurfacePoolEfl.h"
+#include "PlatformSurfacePoolTizen.h"
 #include <WebCore/Logging.h>
 #include <wtf/HashMap.h>
 #include "WebProcess.h"
@@ -49,7 +49,7 @@ static inline bool reachHighPoolUtilization(int usedSize, int totalSize)
     return (usedSize > static_cast<int>(static_cast<float>(totalSize) * 0.9));
 }
 
-PlatformSurfacePoolEfl::PlatformSurfaceInfo::PlatformSurfaceInfo(const IntSize& size)
+PlatformSurfacePoolTizen::PlatformSurfaceInfo::PlatformSurfaceInfo(const IntSize& size)
     : m_used(false)
     , m_willBeRemoved(false)
     , m_age(0)
@@ -58,12 +58,12 @@ PlatformSurfacePoolEfl::PlatformSurfaceInfo::PlatformSurfaceInfo(const IntSize&
     m_SharedPlatformSurfaceTizen =  WebCore::SharedPlatformSurfaceTizen::create(size, true);
 }
 
-PlatformSurfacePoolEfl::PlatformSurfacePoolEfl()
+PlatformSurfacePoolTizen::PlatformSurfacePoolTizen()
     : m_sizeInByte(0)
     , m_maxSizeInByte(128 * MB)  // 128 MB
     , m_usedSizeInByte(0)
     , m_usedSizeInCount(0)
-    , m_removePlaformSurfaceTimer(this, &PlatformSurfacePoolEfl::removePlaformSurfaceTimerFired)
+    , m_removePlaformSurfaceTimer(this, &PlatformSurfacePoolTizen::removePlaformSurfaceTimerFired)
 {
     // FIXME : Create this workqueue and a pixmap temporarily to avoid a crash issue.
     // The crash occur in cairo gl used by 2dCanvas. It will be removed if the issue is fixed.
@@ -71,7 +71,7 @@ PlatformSurfacePoolEfl::PlatformSurfacePoolEfl()
     newPlatformSurfaceInfo = createPlatformSurface(IntSize(384,384));
 }
 
-PlatformSurfacePoolEfl::~PlatformSurfacePoolEfl()
+PlatformSurfacePoolTizen::~PlatformSurfacePoolTizen()
 {
     m_platformSurfacesToFree.clear();
 
@@ -83,7 +83,7 @@ PlatformSurfacePoolEfl::~PlatformSurfacePoolEfl()
     m_platformSurfaces.clear();
 }
 
-SharedPlatformSurfaceTizen* PlatformSurfacePoolEfl::acquirePlatformSurface(const IntSize& size, int tileID)
+SharedPlatformSurfaceTizen* PlatformSurfacePoolTizen::acquirePlatformSurface(const IntSize& size, int tileID)
 {
     freePlatformSurfacesIfNeeded();
     removePlatformSurfacesIfNeeded();
@@ -105,7 +105,7 @@ SharedPlatformSurfaceTizen* PlatformSurfacePoolEfl::acquirePlatformSurface(const
             m_usedSizeInCount++;
 
             LOG(TiledAC, "XPlatformSurface pool size : %u MB (%u tiles) used : %u MB (%u tiles) at [%s]",
-                m_sizeInByte/MB, m_platformSurfaces.size(), m_usedSizeInByte/MB, m_usedSizeInCount, "PlatformSurfacePoolEfl::acquirePlatformSurface");
+                m_sizeInByte/MB, m_platformSurfaces.size(), m_usedSizeInByte/MB, m_usedSizeInCount, "PlatformSurfacePoolTizen::acquirePlatformSurface");
             return platformSurfaceInfo->m_SharedPlatformSurfaceTizen.get();
         }
     }
@@ -113,7 +113,7 @@ SharedPlatformSurfaceTizen* PlatformSurfacePoolEfl::acquirePlatformSurface(const
     if (canCreatePlatformSurface()) {
         RefPtr<PlatformSurfaceInfo> newPlatformSurfaceInfo = createPlatformSurface(size);
         if (!newPlatformSurfaceInfo) {
-            LOG(TiledAC, "can't create new platformSurface(%dx%d) at [%s]", size.width(), size.height(), "PlatformSurfacePoolEfl::acquirePlatformSurface");
+            LOG(TiledAC, "can't create new platformSurface(%dx%d) at [%s]", size.width(), size.height(), "PlatformSurfacePoolTizen::acquirePlatformSurface");
             return 0;
         }
         newPlatformSurfaceInfo->m_used = true;
@@ -123,16 +123,16 @@ SharedPlatformSurfaceTizen* PlatformSurfacePoolEfl::acquirePlatformSurface(const
         m_usedSizeInByte += newPlatformSurfaceInfo->sizeInByte();
 
         LOG(TiledAC, "acquire platformSurface(%dx%d) XPlatformSurface pool size : %u MB (%u tiles) used : %u MB (%u tiles) at [%s]",
-            size.width(), size.height(), m_sizeInByte/MB, m_platformSurfaces.size(), m_usedSizeInByte/MB, m_usedSizeInCount, "PlatformSurfacePoolEfl::acquirePlatformSurface");
+            size.width(), size.height(), m_sizeInByte/MB, m_platformSurfaces.size(), m_usedSizeInByte/MB, m_usedSizeInCount, "PlatformSurfacePoolTizen::acquirePlatformSurface");
 
         return newPlatformSurfaceInfo->m_SharedPlatformSurfaceTizen.get();
     }
 
-    LOG(TiledAC, "No more platformSurface allowed: can't acquire platformSurface(%dx%d) at [%s]", size.width(), size.height(), "PlatformSurfacePoolEfl::acquirePlatformSurface");
+    LOG(TiledAC, "No more platformSurface allowed: can't acquire platformSurface(%dx%d) at [%s]", size.width(), size.height(), "PlatformSurfacePoolTizen::acquirePlatformSurface");
     return 0;
 }
 
-void PlatformSurfacePoolEfl::freePlatformSurfaceByTileID(int tileID)
+void PlatformSurfacePoolTizen::freePlatformSurfaceByTileID(int tileID)
 {
     int platformSurfaceId = 0;
     PlatformSurfaceMap::iterator end = m_platformSurfaces.end();
@@ -147,7 +147,7 @@ void PlatformSurfacePoolEfl::freePlatformSurfaceByTileID(int tileID)
         freePlatformSurface(platformSurfaceId);
 }
 
-void PlatformSurfacePoolEfl::freePlatformSurface(int platformSurfaceId)
+void PlatformSurfacePoolTizen::freePlatformSurface(int platformSurfaceId)
 {
     RefPtr<PlatformSurfaceInfo> platformSurfaceInfo = m_platformSurfaces.get(platformSurfaceId);
     if (platformSurfaceInfo && platformSurfaceInfo->m_used)
@@ -156,7 +156,7 @@ void PlatformSurfacePoolEfl::freePlatformSurface(int platformSurfaceId)
         LOG(TiledAC, "WARNING: no matching or freed PlatformSurfaceInfo for %d at [%s]", platformSurfaceId, __PRETTY_FUNCTION__);
 }
 
-void PlatformSurfacePoolEfl::freePlatformSurfacesIfNeeded()
+void PlatformSurfacePoolTizen::freePlatformSurfacesIfNeeded()
 {
     if (m_platformSurfacesToFree.isEmpty())
         return;
@@ -181,7 +181,7 @@ void PlatformSurfacePoolEfl::freePlatformSurfacesIfNeeded()
         shrink();
 }
 
-void PlatformSurfacePoolEfl::removePlatformSurface(int platformSurfaceId)
+void PlatformSurfacePoolTizen::removePlatformSurface(int platformSurfaceId)
 {
     /*FIXME : platformSurfaceId must not be zero.
        But sometimes zero id was added to platformSurfaceMap.
@@ -208,15 +208,15 @@ void PlatformSurfacePoolEfl::removePlatformSurface(int platformSurfaceId)
     m_platformSurfaces.remove(foundSurface);
 
     LOG(TiledAC, "remove platformSurface(%dx%d) XPlatformSurface pool size : %u MB (%u tiles) used : %u MB (%u tiles) at [%s]",
-       width,  height, m_sizeInByte/MB, m_platformSurfaces.size(), m_usedSizeInByte/MB, m_usedSizeInCount, "PlatformSurfacePoolEfl::removePlatformSurface");
+       width,  height, m_sizeInByte/MB, m_platformSurfaces.size(), m_usedSizeInByte/MB, m_usedSizeInCount, "PlatformSurfacePoolTizen::removePlatformSurface");
 }
 
-void PlatformSurfacePoolEfl::willRemovePlatformSurface(int platformSurfaceId)
+void PlatformSurfacePoolTizen::willRemovePlatformSurface(int platformSurfaceId)
 {
     WebProcess::shared().connection()->send(Messages::WebProcessProxy::RemovePlatformSurfaceTextureFromPool(platformSurfaceId), 0);
 }
 
-bool PlatformSurfacePoolEfl::canCreatePlatformSurface()
+bool PlatformSurfacePoolTizen::canCreatePlatformSurface()
 {
     if (m_sizeInByte >= m_maxSizeInByte)
         shrink();
@@ -224,7 +224,7 @@ bool PlatformSurfacePoolEfl::canCreatePlatformSurface()
     return m_sizeInByte < m_maxSizeInByte;
 }
 
-RefPtr<PlatformSurfacePoolEfl::PlatformSurfaceInfo> PlatformSurfacePoolEfl::createPlatformSurface(const IntSize& size)
+RefPtr<PlatformSurfacePoolTizen::PlatformSurfaceInfo> PlatformSurfacePoolTizen::createPlatformSurface(const IntSize& size)
 {
     RefPtr<PlatformSurfaceInfo> newPlatformSurface = adoptRef(new PlatformSurfaceInfo(size));
     if (!newPlatformSurface->m_SharedPlatformSurfaceTizen)
@@ -236,7 +236,7 @@ RefPtr<PlatformSurfacePoolEfl::PlatformSurfaceInfo> PlatformSurfacePoolEfl::crea
     return newPlatformSurface.get();
 }
 
-void PlatformSurfacePoolEfl::shrink()
+void PlatformSurfacePoolTizen::shrink()
 {
     Vector<int> platformSurfacesToRemove;
     {
@@ -257,7 +257,7 @@ void PlatformSurfacePoolEfl::shrink()
     }
 
     if (platformSurfacesToRemove.size())
-        LOG(TiledAC, "remove %d platformSurfaces @PlatformSurfacePoolEfl::shrink", platformSurfacesToRemove.size());
+        LOG(TiledAC, "remove %d platformSurfaces @PlatformSurfacePoolTizen::shrink", platformSurfacesToRemove.size());
 
     for (size_t index = 0; index < platformSurfacesToRemove.size(); index++) {
         // FIXME: we should send willRemovePlatformSurface to UIProcess before destroying xplatformSurface itself
@@ -270,20 +270,20 @@ void PlatformSurfacePoolEfl::shrink()
     }
 }
 
-void PlatformSurfacePoolEfl::startRemovePlaformSurfaceTimer()
+void PlatformSurfacePoolTizen::startRemovePlaformSurfaceTimer()
 {
     if (m_removePlaformSurfaceTimer.isActive())
         return;
     m_removePlaformSurfaceTimer.startOneShot(0.01);
 }
 
-void PlatformSurfacePoolEfl::removePlaformSurfaceTimerFired(Timer<PlatformSurfacePoolEfl>*)
+void PlatformSurfacePoolTizen::removePlaformSurfaceTimerFired(Timer<PlatformSurfacePoolTizen>*)
 {
     freePlatformSurfacesIfNeeded();
     removePlatformSurfacesIfNeeded();
 }
 
-void PlatformSurfacePoolEfl::removePlatformSurfacesIfNeeded()
+void PlatformSurfacePoolTizen::removePlatformSurfacesIfNeeded()
 {
     Vector<int> platformSurfacesIdToRemove = m_platformSurfacesIdToRemove;
     m_platformSurfacesIdToRemove.clear();
@@ -23,8 +23,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TilePoolEfl_h
-#define TilePoolEfl_h
+#ifndef PlatformSurfacePoolTizen_h
+#define PlatformSurfacePoolTizen_h
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 
@@ -43,12 +43,12 @@ class SharedPlatformSurfaceTizen;
 using namespace WebCore;
 
 namespace WebKit {
-class PlatformSurfacePoolEfl {
-    WTF_MAKE_NONCOPYABLE(PlatformSurfacePoolEfl);
+class PlatformSurfacePoolTizen {
+    WTF_MAKE_NONCOPYABLE(PlatformSurfacePoolTizen);
 
 public :
-    PlatformSurfacePoolEfl();
-    ~PlatformSurfacePoolEfl();
+    PlatformSurfacePoolTizen();
+    ~PlatformSurfacePoolTizen();
     SharedPlatformSurfaceTizen* acquirePlatformSurface(const WebCore::IntSize&, int tileID);
     void freePlatformSurface(int platformSurfaceId);
     void freePlatformSurfaceByTileID(int tileID);
@@ -73,7 +73,7 @@ private :
     void freePlatformSurfacesIfNeeded();
     void shrink();
     void startRemovePlaformSurfaceTimer();
-    void removePlaformSurfaceTimerFired(Timer<PlatformSurfacePoolEfl>*);
+    void removePlaformSurfaceTimerFired(Timer<PlatformSurfacePoolTizen>*);
     void removePlatformSurfacesIfNeeded();
 
     typedef HashMap<int, RefPtr<PlatformSurfaceInfo> > PlatformSurfaceMap;
@@ -87,7 +87,7 @@ private :
     size_t m_usedSizeInByte;
     size_t m_usedSizeInCount;
 
-    Timer<PlatformSurfacePoolEfl> m_removePlaformSurfaceTimer;
+    Timer<PlatformSurfacePoolTizen> m_removePlaformSurfaceTimer;
 
 };
 }
@@ -107,7 +107,7 @@ void TiledBackingStoreRemoteTileTizen::review()
 
 bool TiledBackingStoreRemoteTileBufferTizen::drawPlatformSurface(const IntSize& size, const IntRect& dirty, int tileID)
 {
-    PlatformSurfacePoolEfl* platformSurfacePool = WebProcess::shared().platformSurfacePool();
+    PlatformSurfacePoolTizen* platformSurfacePool = WebProcess::shared().platformSurfacePool();
     if(!platformSurfacePool)
         return false;
 
@@ -23,7 +23,7 @@
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 #include "TiledBackingStoreRemoteTile.h"
 #include "SharedPlatformSurfaceTizen.h"
-#include "efl/PlatformSurfacePoolEfl.h"
+#include "efl/tizen/PlatformSurfacePoolTizen.h"
 
 namespace WebCore {
 class ImageBuffer;
@@ -35,7 +35,7 @@ namespace WebKit {
 class TiledBackingStoreRemoteTileClient;
 class SurfaceUpdateInfo;
 
-class PlatformSurfacePoolEfl;
+class PlatformSurfacePoolTizen;
 class TiledBackingStoreRemoteTileBufferTizen {
 public:
     TiledBackingStoreRemoteTileBufferTizen(TiledBackingStoreRemoteTileClient* client, WebCore::TiledBackingStore* tiledBackingStore, IntRect rect)
index 09261ec..5e9accd 100644 (file)
@@ -99,7 +99,7 @@
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-#include "WebPage/efl/PlatformSurfacePoolEfl.h"
+#include "WebPage/efl/tizen/PlatformSurfacePoolTizen.h"
 #endif
 
 #if ENABLE(TIZEN_LOG)
@@ -245,7 +245,7 @@ void WebProcess::initialize(CoreIPC::Connection::Identifier serverIdentifier, Ru
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-    m_platformSurfacePool = adoptPtr(new PlatformSurfacePoolEfl());
+    m_platformSurfacePool = adoptPtr(new PlatformSurfacePoolTizen());
 #endif
 
 #if ENABLE(TIZEN_JPEGIMAGE_DECODING_THREAD)
@@ -626,7 +626,7 @@ void WebProcess::createWebPage(uint64_t pageID, const WebPageCreationParameters&
 {
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     if (!m_platformSurfacePool)
-        m_platformSurfacePool = adoptPtr(new PlatformSurfacePoolEfl());
+        m_platformSurfacePool = adoptPtr(new PlatformSurfacePoolTizen());
 #endif
     // It is necessary to check for page existence here since during a window.open() (or targeted
     // link) the WebPage gets created both in the synchronous handler and through the normal way. 
index 036acb3..4614a0e 100755 (executable)
@@ -98,7 +98,7 @@ class SecKeychainItemResponseData;
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-class PlatformSurfacePoolEfl;
+class PlatformSurfacePoolTizen;
 #endif
 
 class WebProcess : public ChildProcess, private CoreIPC::Connection::QueueClient {
@@ -204,7 +204,7 @@ public:
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-    PlatformSurfacePoolEfl* platformSurfacePool() { return m_platformSurfacePool.get(); }
+    PlatformSurfacePoolTizen* platformSurfacePool() { return m_platformSurfacePool.get(); }
     void removePlatformSurfaceFromPool(int platformSurfaceId);
 #endif
 
@@ -389,7 +389,7 @@ private:
     bool m_disablePluginProcessMessageTimeout;
 #endif
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-    OwnPtr<PlatformSurfacePoolEfl> m_platformSurfacePool;
+    OwnPtr<PlatformSurfacePoolTizen> m_platformSurfacePool;
 #endif
 
 #if ENABLE(TIZEN_INDEXED_DATABASE)
index a7570b2..385f6d7 100755 (executable)
@@ -55,7 +55,7 @@
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-#include "WebPage/efl/PlatformSurfacePoolEfl.h"
+#include "WebPage/efl/tizen/PlatformSurfacePoolTizen.h"
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_X_WINDOW)
@@ -78,7 +78,7 @@
 
 namespace WebKit {
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-class PlatformSurfacePoolEfl;
+class PlatformSurfacePoolTizen;
 #endif
 
 #if ENABLE(TIZEN_SOUP_COOKIE_CACHE_FOR_WEBKIT2)