Changeset 49740 in webkit


Ignore:
Timestamp:
Oct 17, 2009 8:45:32 AM (15 years ago)
Author:
eric@webkit.org
Message:

2009-10-17 Alpha Lam <hclam@chromium.org>

Reviewed by Eric Seidel.

[chromium] Video controls not zoomed / transformed correctly
https://bugs.webkit.org/show_bug.cgi?id=30461

Draw the images in the controls scaled.

No new tests. With this change Chromium will pass the following tests:
LayoutTests/media/video-controls-zoomed.html
LayoutTests/media/video-controls-transformed.html

  • rendering/RenderMediaControlsChromium.cpp: (WebCore::paintMediaButton): Pass along the target rect directly. (WebCore::RenderMediaControlsChromium::adjustMediaSliderThumbSize): Adjust the thumb slide applied with the scale factor.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r49739 r49740  
     12009-10-17  Alpha Lam  <hclam@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [chromium] Video controls not zoomed / transformed correctly
     6        https://bugs.webkit.org/show_bug.cgi?id=30461
     7
     8        Draw the images in the controls scaled.
     9
     10        No new tests. With this change Chromium will pass the following tests:
     11        LayoutTests/media/video-controls-zoomed.html
     12        LayoutTests/media/video-controls-transformed.html
     13
     14        * rendering/RenderMediaControlsChromium.cpp:
     15        (WebCore::paintMediaButton):
     16        Pass along the target rect directly.
     17        (WebCore::RenderMediaControlsChromium::adjustMediaSliderThumbSize):
     18        Adjust the thumb slide applied with the scale factor.
     19
    1202009-10-17  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
    221
  • trunk/WebCore/rendering/RenderMediaControlsChromium.cpp

    r49697 r49740  
    5757static bool paintMediaButton(GraphicsContext* context, const IntRect& rect, Image* image)
    5858{
    59     // Create a destination rectangle for the image that is centered in the drawing rectangle, rounded left, and down.
    6059    IntRect imageRect = image->rect();
    61     imageRect.setY(rect.y() + (rect.height() - image->height() + 1) / 2);
    62     imageRect.setX(rect.x() + (rect.width() - image->width() + 1) / 2);
    63 
    64     context->drawImage(image, imageRect);
     60    context->drawImage(image, rect);
    6561    return true;
    6662}
     
    279275        thumbImage = mediaVolumeSliderThumb;
    280276
     277    float zoomLevel = object->style()->effectiveZoom();
    281278    if (thumbImage) {
    282         object->style()->setWidth(Length(thumbImage->width(), Fixed));
    283         object->style()->setHeight(Length(thumbImage->height(), Fixed));
     279        object->style()->setWidth(Length(static_cast<int>(thumbImage->width() * zoomLevel), Fixed));
     280        object->style()->setHeight(Length(static_cast<int>(thumbImage->height() * zoomLevel), Fixed));
    284281    }
    285282}
Note: See TracChangeset for help on using the changeset viewer.