From c3114dc57f80c6a82aeeb4b697b1bfb8dd187d94 Mon Sep 17 00:00:00 2001 From: YongGeol Jung Date: Mon, 1 Apr 2013 12:49:09 +0900 Subject: [PATCH] Fix the issue that short black glitch when switching bandwidth.(2) [Title] Fix the issue that short black glitch when switching bandwidth.(2) [Issue#] ORANGE-141 [Problem] Short black glitch when switching bandwidth. [Cause] After changing video size, new buffer which is not drawn was used for compositing. [Solution] If current buffer is not updated yet, copy previous buffer. Change-Id: I7e2d2d9822809704328fcef5fa7209fb7c4c6ae6 --- .../gstreamer/tizen/SharedVideoPlatformSurfaceTizen.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/WebCore/platform/graphics/gstreamer/tizen/SharedVideoPlatformSurfaceTizen.cpp b/Source/WebCore/platform/graphics/gstreamer/tizen/SharedVideoPlatformSurfaceTizen.cpp index bb9aaff..d5ae97e 100644 --- a/Source/WebCore/platform/graphics/gstreamer/tizen/SharedVideoPlatformSurfaceTizen.cpp +++ b/Source/WebCore/platform/graphics/gstreamer/tizen/SharedVideoPlatformSurfaceTizen.cpp @@ -129,7 +129,16 @@ void VideoPlatformSurface::copySurface(VideoPlatformSurface* other) RefPtr context = adoptRef(cairo_create(surface.get())); OwnPtr 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())); + float xScale = static_cast(m_size.width()) / other->m_size.width(); + float yScale = static_cast(m_size.height()) / other->m_size.height(); + + // Fit to width. (scale using xScale.) + // Copy to center of destination surface. + if (xScale != yScale) { + float yPosition = (m_size.height() - other->m_size.height() * xScale) / 2; + graphicsContext->translate(0, yPosition); + } + graphicsContext->scale(FloatSize(xScale, xScale)); other->paintCurrentFrameInContext(graphicsContext.get(), IntRect()); } -- 2.7.4