int id() const { return m_platformSurface; }
void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
+ void copySurface(VideoPlatformSurface* other);
bool hasAlpha() { return m_hasAlpha; }
private:
cairo_surface_destroy(surface);
}
+void VideoPlatformSurface::copySurface(VideoPlatformSurface* other)
+{
+ RefPtr<cairo_surface_t> surface = adoptRef(cairo_xlib_surface_create(m_nativeDisplay, m_platformSurface, DefaultVisual(m_nativeDisplay, DefaultScreen(m_nativeDisplay)), m_size.width(), m_size.height()));
+ RefPtr<cairo_t> context = adoptRef(cairo_create(surface.get()));
+ OwnPtr<WebCore::GraphicsContext> graphicsContext = adoptPtr(new GraphicsContext(context.get()));
+
+ graphicsContext->scale(FloatSize((float)m_size.width() / other->m_size.width(), (float)m_size.height() / other->m_size.height()));
+ other->paintCurrentFrameInContext(graphicsContext.get(), IntRect());
+}
+
bool VideoPlatformSurface::initialize(IntSize size)
{
if (!createPlatformSurface(size))
m_platformSurface->paintCurrentFrameInContext(context, rect);
}
+void SharedVideoPlatformSurfaceTizen::copySurface(SharedVideoPlatformSurfaceTizen* other)
+{
+ if (m_platformSurface)
+ m_platformSurface->copySurface(other->m_platformSurface.get());
+}
+
void SharedVideoPlatformSurfaceTizen::registerDamageHandler()
{
if (!m_platformSurface)
void platformSurfaceUpdated();
void setVideoPlatformSurfaceUpdateListener(VideoPlatformSurfaceUpdateListener* listener);
void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
+ void copySurface(SharedVideoPlatformSurfaceTizen*);
int graphicsSurfaceFlags() const;
private:
m_platformSurface = SharedVideoPlatformSurfaceTizen::create(size);
m_platformSurface->setVideoPlatformSurfaceUpdateListener(this);
+ if (m_platformSurfaceToBeRemoved)
+ m_platformSurface->copySurface(m_platformSurfaceToBeRemoved.get());
+
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);