Revert "Update tile partially"
authorJungJik Lee <jungjik.lee@samsung.com>
Sat, 13 Apr 2013 08:39:52 +0000 (17:39 +0900)
committerJungJik Lee <jungjik.lee@samsung.com>
Sat, 13 Apr 2013 08:39:52 +0000 (17:39 +0900)
[Title] Revert "Update tile partially"
[Issue#] N/A
[Problem] Drawing images without clipping in StoryAlbum.
[Cause] N/A
[Solution] Revert the patch.

This reverts commit 2f997258449b738de6096d8749c1acfd32f90260.

Source/WebKit2/WebProcess/WebPage/efl/tizen/PlatformSurfacePoolTizen.cpp
Source/WebKit2/WebProcess/WebPage/efl/tizen/PlatformSurfacePoolTizen.h
Source/WebKit2/WebProcess/WebPage/efl/tizen/TiledBackingStoreRemoteTileTizen.cpp
Source/WebKit2/WebProcess/WebPage/efl/tizen/TiledBackingStoreRemoteTileTizen.h

index c6ce2a4..7051b51 100644 (file)
@@ -132,14 +132,6 @@ SharedPlatformSurfaceTizen* PlatformSurfacePoolTizen::acquirePlatformSurface(con
     return 0;
 }
 
-SharedPlatformSurfaceTizen* PlatformSurfacePoolTizen::acquirePlatformSurfaceByID(int platformSurfaceId)
-{
-    PlatformSurfaceMap::iterator foundSurface = m_platformSurfaces.find(platformSurfaceId);
-    if (foundSurface == m_platformSurfaces.end())
-        return 0;
-    return foundSurface->second->m_SharedPlatformSurfaceTizen.get();
-}
-
 void PlatformSurfacePoolTizen::freePlatformSurfaceByTileID(int tileID)
 {
     int platformSurfaceId = 0;
index b5ba35e..2d37190 100644 (file)
@@ -50,7 +50,6 @@ public :
     PlatformSurfacePoolTizen();
     ~PlatformSurfacePoolTizen();
     SharedPlatformSurfaceTizen* acquirePlatformSurface(const WebCore::IntSize&, int tileID);
-    SharedPlatformSurfaceTizen* acquirePlatformSurfaceByID(int platformSurfaceId);
     void freePlatformSurface(int platformSurfaceId);
     void freePlatformSurfaceByTileID(int tileID);
     void removePlatformSurface(int platformSurfaceId);
index 2f40b2c..27fcb5f 100644 (file)
@@ -49,13 +49,6 @@ TiledBackingStoreRemoteTileTizen::TiledBackingStoreRemoteTileTizen(TiledBackingS
 {
 }
 
-static inline bool needUpdateBackBufferPartially(const IntRect& entireRect, const IntRect& dirtyRect)
-{
-    if (entireRect.size() != dirtyRect.size())
-        return true;
-    return false;
-}
-
 Vector<IntRect> TiledBackingStoreRemoteTileTizen::updateBackBuffer()
 {
     if (!isDirty())
@@ -70,7 +63,7 @@ Vector<IntRect> TiledBackingStoreRemoteTileTizen::updateBackBuffer()
         needToCreateTile = true;
     }
 
-    if (!m_tiledBackingStoreRemoteTileBufferTizen->drawPlatformSurface(m_tiledBackingStore->tileSize(), m_dirtyRect, m_ID))
+    if (!m_tiledBackingStoreRemoteTileBufferTizen->drawPlatformSurface(m_tiledBackingStore->tileSize(), m_rect, m_ID))
         return Vector<IntRect>();
 
     updateInfo.updateRect = m_rect;
@@ -112,58 +105,7 @@ void TiledBackingStoreRemoteTileTizen::review()
     m_client->createTile(m_ID, updateInfo, m_rect);
 }
 
-bool TiledBackingStoreRemoteTileBufferTizen::copyPreviousFrame(void* dst, int platformSurfaceID, const IntRect& wholeRect, const IntRect& clipRect)
-{
-    SharedPlatformSurfaceTizen* backupSurface;
-    unsigned int offset;
-    void* src;
-
-    PlatformSurfacePoolTizen* platformSurfacePool = WebProcess::shared().platformSurfacePool();
-    if(!platformSurfacePool)
-        return false;
-
-    backupSurface = platformSurfacePool->acquirePlatformSurfaceByID(platformSurfaceID);
-    if (!backupSurface)
-        return false;
-
-    if (!backupSurface->lockSurface())
-        return false;
-
-    if (!backupSurface->querySurface((int*)&src)) {
-        backupSurface->unlockSurface();
-        return false;
-    }
-
-    // upper side
-    if (clipRect.y() -wholeRect.y() > 0)
-        memcpy(dst, src, 4 * wholeRect.width() * (clipRect.y() -wholeRect.y()));
-
-    if (wholeRect.width() - clipRect.width() > 0) {
-        offset = 4 * (clipRect.y() - wholeRect.y()) * wholeRect.width();
-        for (int i = 0; i < clipRect.height(); i++) {
-            // left side
-            if (clipRect.x() - wholeRect.x() > 0)
-                memcpy(dst + offset, src + offset, 4 * (clipRect.x() - wholeRect.x()));
-
-            // right side
-            if (wholeRect.x() + wholeRect.width() - clipRect.x() - clipRect.width() > 0)
-                memcpy(dst + offset + 4 * (clipRect.x() + clipRect.width() - wholeRect.x()),
-                    src + offset + 4 * (clipRect.x() + clipRect.width() - wholeRect.x()),
-                    4 * (wholeRect.x() + wholeRect.width() - clipRect.x() - clipRect.width()));
-            offset += 4 * wholeRect.width();
-        }
-    }
-    // lower side
-    if (wholeRect.y() + wholeRect.height() - clipRect.y() - clipRect.height() > 0) {
-        offset = 4 * wholeRect.width() * (clipRect.y() + clipRect.height() - wholeRect.y());
-        memcpy(dst + offset, src + offset,
-            4 * wholeRect.width() * (wholeRect.y() + wholeRect.height() - clipRect.y() - clipRect.height()));
-    }
-    backupSurface->unlockSurface();
-    return true;
-}
-
-bool TiledBackingStoreRemoteTileBufferTizen::drawPlatformSurface(const IntSize& size, const IntRect& dirtyRect, int tileID)
+bool TiledBackingStoreRemoteTileBufferTizen::drawPlatformSurface(const IntSize& size, const IntRect& dirty, int tileID)
 {
     PlatformSurfacePoolTizen* platformSurfacePool = WebProcess::shared().platformSurfacePool();
     if(!platformSurfacePool)
@@ -197,12 +139,6 @@ bool TiledBackingStoreRemoteTileBufferTizen::drawPlatformSurface(const IntSize&
 #endif
     graphicsContext->clearRect(WebCore::FloatRect(WebCore::FloatPoint(0, 0), sharedPlatformSurface->size()));
 
-    IntRect paintRect = m_rect;
-    if (needUpdateBackBufferPartially(m_rect, dirtyRect) && m_platformSurfaceID > 0) {
-        if (copyPreviousFrame(m_eglImgData, m_platformSurfaceID, IntRect(m_rect.location(), sharedPlatformSurface->size()), dirtyRect))
-            paintRect = dirtyRect;
-    }
-
 #if ENABLE(TIZEN_RECORDING_SURFACE_SET)
     if (m_tiledBackingStore->client()->recordingSurfaceSetEnableGet()) {
         m_tiledBackingStore->client()->tiledBackingStorePaint(graphicsContext.get(), m_rect);
@@ -211,7 +147,7 @@ bool TiledBackingStoreRemoteTileBufferTizen::drawPlatformSurface(const IntSize&
     {
         graphicsContext->translate(-m_rect.x(), -m_rect.y());
         graphicsContext->scale(FloatSize(m_tiledBackingStore->contentsScale(), m_tiledBackingStore->contentsScale()));
-        m_tiledBackingStore->client()->tiledBackingStorePaint(graphicsContext.get(), m_tiledBackingStore->mapToContents(paintRect));
+        m_tiledBackingStore->client()->tiledBackingStorePaint(graphicsContext.get(), m_tiledBackingStore->mapToContents(dirty));
     }
 
     m_platformSurfaceID = sharedPlatformSurface->id();
index bedbd49..c039949 100644 (file)
@@ -49,7 +49,6 @@ public:
     void resize(const WebCore::IntSize& size) { m_rect.setSize(size); }
     IntSize platformSurfaceSize() { return m_platformSurfaceSize; }
 private:
-    bool copyPreviousFrame(void* dst, int platformSurfaceID, const IntRect& wholeRect, const IntRect& clipRect);
     int m_platformSurfaceID;
     IntSize m_platformSurfaceSize;
     unsigned char* m_eglImgData;
@@ -73,6 +72,7 @@ public:
 
 private:
     TiledBackingStoreRemoteTileTizen(TiledBackingStoreRemoteTileClient*, WebCore::TiledBackingStore*, const Coordinate&);
+
     OwnPtr<TiledBackingStoreRemoteTileBufferTizen> m_tiledBackingStoreRemoteTileBufferTizen;
 };