[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
eric at webkit.org
eric at webkit.org
Thu Dec 3 13:23:42 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 21f14b1983c0a3feda6823d141b4ef5f119e4d13
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Oct 30 17:43:29 2009 +0000
2009-10-30 Sebastian Dröge <sebastian.droege at collabora.co.uk>
Reviewed by Gustavo Noronha.
* platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivate::paint):
Add some comments to explain what is happening here.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 27fd1c9..252cb92 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,11 @@
+2009-10-30 Sebastian Dröge <sebastian.droege at collabora.co.uk>
+
+ Reviewed by Gustavo Noronha.
+
+ * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::MediaPlayerPrivate::paint):
+ Add some comments to explain what is happening here.
+
2009-10-30 Alexander Pavlov <apavlov at chromium.org>
Reviewed by Timothy Hatcher.
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
index 3fc9a15..42d8b15 100644
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
@@ -661,23 +661,31 @@ void MediaPlayerPrivate::paint(GraphicsContext* context, const IntRect& rect)
cairo_save(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
+ // Calculate the display width/height from the storage width/height and the pixel aspect ratio
displayWidth *= doublePixelAspectRatioNumerator / doublePixelAspectRatioDenominator;
displayHeight *= doublePixelAspectRatioDenominator / doublePixelAspectRatioNumerator;
- scale = MIN (rect.width () / displayWidth, rect.height () / displayHeight);
+ // Calculate the largest scale factor that would fill the target surface
+ scale = MIN(rect.width() / displayWidth, rect.height() / displayHeight);
+ // And calculate the new display width/height
displayWidth *= scale;
displayHeight *= scale;
- // Calculate gap between border an picture
+ // Calculate gap between border an picture on every side
gapWidth = (rect.width() - displayWidth) / 2.0;
gapHeight = (rect.height() - displayHeight) / 2.0;
- // paint the rectangle on the context and draw the surface inside.
+ // Paint the rectangle on the context and draw the buffer inside the rectangle
+
+ // Go to the new origin and center the video frame.
cairo_translate(cr, rect.x() + gapWidth, rect.y() + gapHeight);
cairo_rectangle(cr, 0, 0, rect.width(), rect.height());
+ // Scale the video frame according to the pixel aspect ratio.
cairo_scale(cr, doublePixelAspectRatioNumerator / doublePixelAspectRatioDenominator,
doublePixelAspectRatioDenominator / doublePixelAspectRatioNumerator);
+ // Scale the video frame to fill the target surface as good as possible.
cairo_scale(cr, scale, scale);
+ // And paint it.
cairo_set_source_surface(cr, src, 0, 0);
cairo_fill(cr);
cairo_restore(cr);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list