Align pixmap of video layer to 16.
authorYongGeol Jung <yg48.jung@samsung.com>
Mon, 22 Apr 2013 02:57:20 +0000 (11:57 +0900)
committerYongGeol Jung <yg48.jung@samsung.com>
Mon, 22 Apr 2013 02:57:20 +0000 (11:57 +0900)
[Title] Align pixmap of video layer to 16.
[Issue#] N/A
[Problem] Some streaming video's screen is not updated.
[Cause] Pixmap if not aligned to 16.
[Solution] Align pixmap of video layer to 16.

Change-Id: I73eb9241f779da06611bb0ad6ec3b7fae1e66337

Source/WebCore/platform/graphics/gstreamer/tizen/VideoLayerTizen.cpp

index 24be59c..113d914 100644 (file)
@@ -119,15 +119,6 @@ void VideoLayerTizen::syncLayer(VideoLayerTizen* layer)
 }
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-/*
-// Defined but not used.
-static gboolean platformSurfaceUpdateTimeoutCallback(VideoLayerTizen* layer)
-{
-    layer->notifySyncRequired();
-    return FALSE;
-}
-*/
-
 bool VideoLayerTizen::swapPlatformSurfaces()
 {
     return true;
@@ -179,6 +170,13 @@ void VideoLayerTizen::setOverlay(IntSize size)
     if (m_platformSurface)
         m_platformSurfaceToBeRemoved = m_platformSurface.release();
 
+    // Align to 16. (If not aligned to 16, pixmap will be created again.)
+    int remainder = size.width() % 16;
+    if (remainder) {
+        size.setHeight(size.height() + (16 - remainder) * (static_cast<float>(size.height()) / size.width()));
+        size.setWidth(size.width() + (16 - remainder));
+    }
+
     m_platformSurface = SharedVideoPlatformSurfaceTizen::create(size);
     m_platformSurface->setVideoPlatformSurfaceUpdateListener(this);