Revert "Revert "Hardware Accelerated Video Playback doesn't work on IA""
authorkeonho07.kim <keonho07.kim@samsung.com>
Fri, 29 Mar 2013 05:30:57 +0000 (14:30 +0900)
committerkeonho07.kim <keonho07.kim@samsung.com>
Fri, 29 Mar 2013 05:30:57 +0000 (14:30 +0900)
This reverts commit fe630af72af05c9387735b7cebc82abdffa50bdd.

Note: we have found the root cause of the problem with Samsung SCM team, hence back to merge in.

Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
Source/WebCore/platform/graphics/gstreamer/tizen/SharedVideoPlatformSurfaceTizen.cpp
Source/WebCore/platform/graphics/gstreamer/tizen/SharedVideoPlatformSurfaceTizen.h
Source/WebCore/platform/graphics/gstreamer/tizen/VideoLayerTizen.cpp
Source/WebCore/platform/graphics/gstreamer/tizen/VideoLayerTizen.h
Source/WebCore/platform/graphics/surfaces/tizen/GraphicsSurfaceTizen.cpp
Source/WebCore/platform/graphics/texmap/tizen/PlatformSurfaceTextureGL.cpp
Source/cmake/OptionsTizen.cmake

index 2edd7b8..ccb2212 100755 (executable)
@@ -220,7 +220,7 @@ static void mediaPlayerPrivateRepaintCallback(WebKitVideoSink*, GstBuffer *buffe
     playerPrivate->triggerRepaint(buffer);
 }
 
-#if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 static GstBusSyncReply mediaPlayerPrivateSyncHandler(GstBus* bus, GstMessage* message, MediaPlayerPrivateGStreamer* playerPrivate)
 {
     // ignore anything but 'prepare-xid' message
@@ -780,7 +780,7 @@ void MediaPlayerPrivateGStreamer::notifyPlayerOfVideo()
 
     m_hasVideo = videoTracks > 0;
 
-#if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     int width;
     int height;
     if (gst_video_get_size(m_videoSinkPad.get(), &width, &height)) {
@@ -1835,7 +1835,7 @@ void MediaPlayerPrivateGStreamer::triggerRepaint(GstBuffer* buffer)
     g_return_if_fail(GST_IS_BUFFER(buffer));
     gst_buffer_replace(&m_buffer, buffer);
 #if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER)
-#if !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) || CPU(X86) || CPU(X86_64)
+#if !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     if (m_videoSize.isEmpty())
         m_videoSize =  naturalSize();
     m_videoLayer->paintVideoLayer(m_videoSize);
@@ -2036,7 +2036,7 @@ void MediaPlayerPrivateGStreamer::setDownloadBuffering()
     GstPlayFlags flags;
 
     g_object_get(m_playBin.get(), "flags", &flags, NULL);
-#if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     flags = (GstPlayFlags)(flags | GST_PLAY_FLAG_NATIVE_VIDEO);
 #endif
     if (m_preload == MediaPlayer::Auto) {
@@ -2099,10 +2099,10 @@ void MediaPlayerPrivateGStreamer::createAudioSink()
 #if ENABLE(TIZEN_GSTREAMER_VIDEO)
 GstElement* MediaPlayerPrivateGStreamer::createVideoSink()
 {
-#if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     m_webkitVideoSink = m_videoLayer->createVideoSink();
     m_videoSinkPad = adoptGRef(gst_element_get_static_pad(m_webkitVideoSink, "sink"));
-#else // ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#else // ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 #ifndef GST_API_VERSION_1
     m_webkitVideoSink = webkitVideoSinkNew(m_gstGWorld.get());
 #else
@@ -2110,7 +2110,7 @@ GstElement* MediaPlayerPrivateGStreamer::createVideoSink()
 #endif
     m_videoSinkPad = adoptGRef(gst_element_get_static_pad(m_webkitVideoSink, "sink"));
     g_signal_connect(m_webkitVideoSink, "repaint-requested", G_CALLBACK(mediaPlayerPrivateRepaintCallback), this);
-#endif // ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 
 #ifndef GST_API_VERSION_1
     m_videoSinkBin = gst_bin_new("video-sink");
@@ -2214,7 +2214,7 @@ void MediaPlayerPrivateGStreamer::createGSTPlayBin()
     GRefPtr<GstBus> bus = webkitGstPipelineGetBus(GST_PIPELINE(m_playBin.get()));
     gst_bus_add_signal_watch(bus.get());
     g_signal_connect(bus.get(), "message", G_CALLBACK(mediaPlayerPrivateMessageCallback), this);
-#if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER) && ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     gst_bus_set_sync_handler(bus.get(), GstBusSyncHandler(mediaPlayerPrivateSyncHandler), this);
 #endif
     gst_object_unref(bus.get());
@@ -2275,7 +2275,7 @@ PlatformLayer* MediaPlayerPrivateGStreamer::platformLayer() const
     return m_videoLayer->platformLayer();
 }
 
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 void MediaPlayerPrivateGStreamer::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect)
 {
     m_videoLayer->paintCurrentFrameInContext(context, rect);
@@ -2296,7 +2296,7 @@ void MediaPlayerPrivateGStreamer::xWindowIdPrepared(GstMessage* message)
     m_videoSize = size;
     m_videoLayer->setOverlay(size);
 }
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 #endif // ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER)
 
 #if ENABLE(TIZEN_WEBKIT2_PROXY)
index 9247187..6e9068a 100644 (file)
@@ -145,9 +145,9 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface
             virtual PlatformLayer* platformLayer() const;
 
             void xWindowIdPrepared(GstMessage*);
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
             virtual void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 #endif // ENABLE(TIZEN_ACCELERATED_COMPOSITING) && USE(TIZEN_TEXTURE_MAPPER)
 
 #if ENABLE(TIZEN_WEBKIT2_PROXY)
index cdd2c40..dc7536f 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "config.h"
 
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 
 #include "SharedVideoPlatformSurfaceTizen.h"
 #include "GraphicsContextPlatformPrivateCairo.h"
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 
+#if ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
+#include "GraphicsSurface.h"
+#endif
+
 namespace WebCore {
 
 class VideoPlatformSurface {
@@ -46,6 +50,7 @@ public:
 
     int id() const { return m_platformSurface; }
     void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
+    bool hasAlpha() { return m_hasAlpha; }
 
 private:
     VideoPlatformSurface();
@@ -66,6 +71,7 @@ private:
     EGLSurface m_eglSurface;
 
     IntSize m_size;
+    bool m_hasAlpha;
 };
 
 PassOwnPtr<VideoPlatformSurface> VideoPlatformSurface::create(IntSize size)
@@ -84,6 +90,7 @@ VideoPlatformSurface::VideoPlatformSurface()
     , m_eglContext(EGL_NO_CONTEXT)
     , m_eglSurface(EGL_NO_SURFACE)
     , m_size(IntSize())
+    , m_hasAlpha(true)
 {
 }
 
@@ -145,10 +152,15 @@ bool VideoPlatformSurface::createPlatformSurface(IntSize size)
 
     XSync(m_nativeDisplay, false);
 
-    m_platformSurface = XCreatePixmap(m_nativeDisplay, m_nativeWindow, size.width(), size.height(), XDefaultDepth(m_nativeDisplay, DefaultScreen(m_nativeDisplay)));
+    int visualDepth = XDefaultDepth(m_nativeDisplay, DefaultScreen(m_nativeDisplay));
+    m_platformSurface = XCreatePixmap(m_nativeDisplay, m_nativeWindow, size.width(), size.height(), visualDepth);
 
     XFlush(m_nativeDisplay);
 
+#if USE(ACCELERATED_VIDEO_VAAPI)
+    m_hasAlpha = visualDepth == 32 ?  true : false;
+#endif
+
     return true;
 }
 
@@ -191,7 +203,7 @@ bool VideoPlatformSurface::createPlatformSurfaceSurface()
     configAttribs[i++] = EGL_BLUE_SIZE;
     configAttribs[i++] = 8;
     configAttribs[i++] = EGL_ALPHA_SIZE;
-    configAttribs[i++] = 8;
+    configAttribs[i++] = m_hasAlpha ? 8 : 0;
     configAttribs[i++] = EGL_MATCH_FORMAT_KHR;
     configAttribs[i++] = EGL_FORMAT_RGBA_8888_EXACT_KHR;
     configAttribs[i++] = EGL_SURFACE_TYPE;
@@ -248,7 +260,8 @@ void VideoPlatformSurface::clearPlatformSurfaceSurface()
 
     RefPtr<cairo_t> cr = adoptRef(cairo_create(surface.get()));
     cairo_set_source_surface(cr.get(), surface.get(), 0, 0);
-    cairo_set_source_rgba(cr.get(), 0, 0, 0, 1);
+    int alphaValue = m_hasAlpha ? 1 : 0;
+    cairo_set_source_rgba(cr.get(), 0, 0, 0, alphaValue);
     cairo_rectangle(cr.get(), 0, 0, m_size.width(), m_size.height());
     cairo_fill(cr.get());
 }
@@ -264,7 +277,14 @@ SharedVideoPlatformSurfaceTizen::SharedVideoPlatformSurfaceTizen(IntSize size)
     , m_listener(0)
     , m_platformSurface(VideoPlatformSurface::create(size))
 {
+    if (!m_platformSurface)
+        return;
+
     registerDamageHandler();
+    m_flags = GraphicsSurface::Is2D | GraphicsSurface::UseLinearFilter;
+    if (m_platformSurface->hasAlpha())
+        m_flags |= GraphicsSurface::Alpha;
+
 }
 
 SharedVideoPlatformSurfaceTizen::~SharedVideoPlatformSurfaceTizen()
@@ -326,6 +346,11 @@ void SharedVideoPlatformSurfaceTizen::unregisterDamageHandler()
     }
 }
 
+int SharedVideoPlatformSurfaceTizen::graphicsSurfaceFlags() const
+{
+    return m_flags;
+}
+
 } // WebCore
 
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
index 3d9d00f..d763e6c 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef SharedVideoPlatformSurfaceTizen_h
 #define SharedVideoPlatformSurfaceTizen_h
 
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 
 #include "IntSize.h"
 #include <Ecore.h>
@@ -48,6 +48,7 @@ public:
     void platformSurfaceUpdated();
     void setVideoPlatformSurfaceUpdateListener(VideoPlatformSurfaceUpdateListener* listener);
     void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
+    int graphicsSurfaceFlags() const;
 
 private:
     SharedVideoPlatformSurfaceTizen(IntSize size);
@@ -59,10 +60,11 @@ private:
     Ecore_Event_Handler* m_damageHandler;
     VideoPlatformSurfaceUpdateListener* m_listener;
     OwnPtr<VideoPlatformSurface> m_platformSurface;
+    int m_flags;
 };
 
 } // WebCore
 
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 
 #endif // SharedVideoPlatformSurfaceTizen_h
index 0b21ecb..401497f 100644 (file)
@@ -26,7 +26,7 @@
 #include "IntRect.h"
 #include "RenderLayerBacking.h"
 
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 #include <gst/interfaces/xoverlay.h>
 #include <gst/video/gstvideosink.h>
 #include <gst/video/video.h>
 #include <cairo-xlib.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 
-#if !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) || CPU(X86) || CPU(X86_64)
+#if !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 static Display* g_nativeDisplay = 0;
 static int g_nativeWindow = 0;
 #endif
 
 namespace WebCore {
 
+#if USE(ACCELERATED_VIDEO_VAAPI)
+    void setVaapiEnv()
+    {
+        static bool envSet = false;
+        if (!envSet) {
+            envSet = true;
+            setenv("PSB_VIDEO_CTEXTURE", "1", true);
+        }
+    }
+#endif
+
 VideoLayerTizen::VideoLayerTizen(HTMLMediaElement* media)
     : m_media(media)
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     , m_videoSink(0)
 #else
     , m_platformSurfaceID(0)
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 {
-#if !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) || CPU(X86) || CPU(X86_64)
+#if !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     if (!g_nativeDisplay)
            g_nativeDisplay = XOpenDisplay(0);
 
@@ -69,7 +80,7 @@ VideoLayerTizen::~VideoLayerTizen()
 {
     syncLayer(0);
 
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     if (m_platformSurface)
         m_platformSurface.clear();
 
@@ -86,7 +97,7 @@ VideoLayerTizen::~VideoLayerTizen()
         XDestroyWindow(g_nativeDisplay, g_nativeWindow);
         g_nativeWindow = 0;
     }
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 }
 
 PlatformLayer* VideoLayerTizen::platformLayer() const
@@ -107,7 +118,7 @@ void VideoLayerTizen::syncLayer(VideoLayerTizen* layer)
     }
 }
 
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 static gboolean platformSurfaceUpdateTimeoutCallback(VideoLayerTizen* layer)
 {
     layer->notifySyncRequired();
@@ -132,8 +143,14 @@ void VideoLayerTizen::platformSurfaceUpdated()
 
 GstElement* VideoLayerTizen::createVideoSink()
 {
+#if !USE(ACCELERATED_VIDEO_VAAPI)
     GstElement* videoSink = gst_element_factory_make("xvimagesink", "xvimagesink");
     g_object_set(videoSink, "rotate", 0, NULL);
+#else
+    setVaapiEnv();
+    GstElement* videoSink = gst_element_factory_make("vaapisink", "vaapisink");
+    g_object_set(videoSink, "is-pixmap", 1, NULL);
+#endif
 
     m_videoSink = videoSink;
 
@@ -163,7 +180,11 @@ void VideoLayerTizen::setOverlay(IntSize size)
     m_platformSurface->setVideoPlatformSurfaceUpdateListener(this);
 
     gst_x_overlay_set_window_handle(GST_X_OVERLAY(m_videoSink), m_platformSurface->id());
+#if !USE(ACCELERATED_VIDEO_VAAPI)
     g_object_set(m_videoSink, "rotate", 0, NULL);
+#else
+    g_object_set(m_videoSink, "is-pixmap", 1, NULL);
+#endif
 }
 
 void VideoLayerTizen::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect)
@@ -172,12 +193,7 @@ void VideoLayerTizen::paintCurrentFrameInContext(GraphicsContext* context, const
         m_platformSurface->paintCurrentFrameInContext(context, rect);
 }
 #else
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && (CPU(X86) || CPU(X86_64))
-bool VideoLayerTizen::swapPlatformSurfaces()
-{
-    return true;
-}
-#endif
+
 void VideoLayerTizen::paintVideoLayer(IntSize videoSize)
 {
     if (videoSize.isEmpty())
@@ -205,12 +221,12 @@ void VideoLayerTizen::paintVideoLayer(IntSize videoSize)
 
     syncLayer(this);
 }
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 
 #if USE(GRAPHICS_SURFACE) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
 uint64_t VideoLayerTizen::graphicsSurfaceToken() const
 {
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     return (m_platformSurface ? m_platformSurface->id() : 0);
 #else
     return m_platformSurfaceID;
@@ -219,7 +235,7 @@ uint64_t VideoLayerTizen::graphicsSurfaceToken() const
 
 uint32_t VideoLayerTizen::copyToGraphicsSurface()
 {
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     return (m_platformSurface ? m_platformSurface->id() : 0);
 #else
     return m_platformSurfaceID;
@@ -228,8 +244,8 @@ uint32_t VideoLayerTizen::copyToGraphicsSurface()
 
 int VideoLayerTizen::graphicsSurfaceFlags() const
 {
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
-    return GraphicsSurface::Is2D | GraphicsSurface::UseLinearFilter | GraphicsSurface::Alpha;
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
+    return m_platformSurface ? m_platformSurface->graphicsSurfaceFlags() : GraphicsSurface::Is2D;
 #else
     return GraphicsSurface::Is2D;
 #endif
index def602c..88bf140 100644 (file)
 #include "HTMLMediaElement.h"
 #include "TextureMapperGL.h"
 
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 #include "SharedVideoPlatformSurfaceTizen.h"
 #include <gst/gst.h>
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 #if ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
 #include "GraphicsSurface.h"
 #endif
@@ -40,9 +40,9 @@ class GraphicsContext;
 class IntRect;
 
 class VideoLayerTizen : public TextureMapperPlatformLayer
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
                       , public VideoPlatformSurfaceUpdateListener
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 {
 public:
     static PassOwnPtr<VideoLayerTizen> create(HTMLMediaElement* media)
@@ -57,7 +57,7 @@ public:
     virtual void paintToTextureMapper(TextureMapper*, const FloatRect& targetRect, const TransformationMatrix&, float opacity) { }
     virtual Image* paintToImage() { return 0; }
 
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     // TextureMapperPlatformLayer interface
     virtual bool swapPlatformSurfaces();
     virtual void freePlatformSurface(int);
@@ -70,11 +70,8 @@ public:
     void setOverlay(IntSize);
     void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
 #else
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && (CPU(X86) || CPU(X86_64))
-    virtual bool swapPlatformSurfaces();
-#endif
     void paintVideoLayer(IntSize);
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 
 #if USE(GRAPHICS_SURFACE) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
     virtual uint32_t copyToGraphicsSurface();
@@ -86,14 +83,14 @@ private:
     VideoLayerTizen(HTMLMediaElement* media);
     void syncLayer(VideoLayerTizen* layer);
 
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     GstElement* m_videoSink;
     OwnPtr<SharedVideoPlatformSurfaceTizen> m_platformSurface;
     OwnPtr<SharedVideoPlatformSurfaceTizen> m_platformSurfaceToBeRemoved;
 #else
     IntSize m_videoSize;
     int m_platformSurfaceID;
-#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !(CPU(X86) || CPU(X86_64))
+#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 
     HTMLMediaElement* m_media;
 };
index 28d289a..1eef303 100644 (file)
@@ -100,9 +100,9 @@ void GraphicsSurface::platformPaintToTextureMapper(TextureMapper* textureMapper,
 
     // FIXME: Do we really need both SupportsBlending and contentsOpaque??
     if (m_canvasFlags & GraphicsSurface::Is2D)
-        static_cast<TextureMapperGL*>(textureMapper)->drawTexture(platformGetTextureID(), TextureMapperGL::SupportsBlending, m_size, targetRect, transform, opacity, expandedIntSize(targetRect.size()), true);
+        static_cast<TextureMapperGL*>(textureMapper)->drawTexture(platformGetTextureID(), alpha ? TextureMapperGL::SupportsBlending : 0, m_size, targetRect, transform, opacity,expandedIntSize(targetRect.size()), true);
     else
-        static_cast<TextureMapperGL*>(textureMapper)->drawTexture(platformGetTextureID(), alpha ? TextureMapperGL::SupportsBlending : 0, m_size, targetRect, transform, opacity, expandedIntSize(targetRect.size()), premultipliedAlpha);
+        static_cast<TextureMapperGL*>(textureMapper)->drawTexture(platformGetTextureID(), alpha ? TextureMapperGL::SupportsBlending : 0, m_size, targetRect, transform, opacity,expandedIntSize(targetRect.size()), premultipliedAlpha);
 }
 
 PassRefPtr<GraphicsSurface> GraphicsSurface::platformCreate(const IntSize& size, Flags flags)
index 0e951db..a707aa0 100644 (file)
@@ -84,9 +84,11 @@ void PlatformSurfaceTextureGL::updateTexture()
 
 void PlatformSurfaceTextureGL::HandleGLError(const char* name)
 {
+#if !USE(ACCELERATED_VIDEO_VAAPI)
     GLuint errorCode = glGetError();
     if (errorCode != GL_NO_ERROR)
         TIZEN_LOGE("'%s' returned gl error (0x%x)", name, errorCode);
+#endif
 }
 
 };
index ad92cc4..b8db26b 100644 (file)
@@ -293,6 +293,7 @@ IF ("${EFL_TARGET}" STREQUAL "i386")
     ADD_DEFINITIONS(-DENABLE_TIZEN_WEBKIT2_DIRECT_RENDERING=1)
     SET(ENABLE_TIZEN_WEBKIT2_DIRECT_RENDERING 1)
     ADD_DEFINITIONS(-DENABLE_TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE=1)
+    ADD_DEFINITIONS(-DWTF_USE_ACCELERATED_VIDEO_VAAPI=1)
     SET(ENABLE_TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE 1)
 ELSEIF ("${EFL_TARGET}" STREQUAL "emulator")
     MESSAGE("i386 emulator Build Mode <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")