Changeset 50343 in webkit
- Timestamp:
- Oct 30, 2009 10:43:29 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r50342 r50343 1 2009-10-30 Sebastian Dröge <sebastian.droege@collabora.co.uk> 2 3 Reviewed by Gustavo Noronha. 4 5 * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: 6 (WebCore::MediaPlayerPrivate::paint): 7 Add some comments to explain what is happening here. 8 1 9 2009-10-30 Alexander Pavlov <apavlov@chromium.org> 2 10 -
trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
r50295 r50343 662 662 cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); 663 663 664 // Calculate the display width/height from the storage width/height and the pixel aspect ratio 664 665 displayWidth *= doublePixelAspectRatioNumerator / doublePixelAspectRatioDenominator; 665 666 displayHeight *= doublePixelAspectRatioDenominator / doublePixelAspectRatioNumerator; 666 667 667 scale = MIN (rect.width () / displayWidth, rect.height () / displayHeight); 668 // Calculate the largest scale factor that would fill the target surface 669 scale = MIN(rect.width() / displayWidth, rect.height() / displayHeight); 670 // And calculate the new display width/height 668 671 displayWidth *= scale; 669 672 displayHeight *= scale; 670 673 671 // Calculate gap between border an picture 674 // Calculate gap between border an picture on every side 672 675 gapWidth = (rect.width() - displayWidth) / 2.0; 673 676 gapHeight = (rect.height() - displayHeight) / 2.0; 674 677 675 // paint the rectangle on the context and draw the surface inside. 678 // Paint the rectangle on the context and draw the buffer inside the rectangle 679 680 // Go to the new origin and center the video frame. 676 681 cairo_translate(cr, rect.x() + gapWidth, rect.y() + gapHeight); 677 682 cairo_rectangle(cr, 0, 0, rect.width(), rect.height()); 683 // Scale the video frame according to the pixel aspect ratio. 678 684 cairo_scale(cr, doublePixelAspectRatioNumerator / doublePixelAspectRatioDenominator, 679 685 doublePixelAspectRatioDenominator / doublePixelAspectRatioNumerator); 686 // Scale the video frame to fill the target surface as good as possible. 680 687 cairo_scale(cr, scale, scale); 688 // And paint it. 681 689 cairo_set_source_surface(cr, src, 0, 0); 682 690 cairo_fill(cr);
Note: See TracChangeset
for help on using the changeset viewer.