⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 130706 in webkit


Ignore:
Timestamp:
Oct 8, 2012, 5:55:34 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

[CAIRO] Adjust the source rect size when IMAGE_DECODER_DOWN_SAMPLING is enabled
​https://bugs.webkit.org/show_bug.cgi?id=98630

Patch by Jaehun Lim <​ljaehun.lim@samsung.com> on 2012-10-08
Reviewed by Martin Robinson.

IMAGE_DECODER_DOWN_SAMPLING scales down the size of the big image.
CAIRO needs to adjust the source size to the scaled value.

No new tests.

  • platform/graphics/cairo/BitmapImageCairo.cpp:

(WebCore::BitmapImage::draw):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r130705 r130706  
     12012-10-08  Jaehun Lim  <ljaehun.lim@samsung.com>
     2
     3        [CAIRO] Adjust the source rect size when IMAGE_DECODER_DOWN_SAMPLING is enabled
     4        https://bugs.webkit.org/show_bug.cgi?id=98630
     5
     6        Reviewed by Martin Robinson.
     7
     8        IMAGE_DECODER_DOWN_SAMPLING scales down the size of the big image.
     9        CAIRO needs to adjust the source size to the scaled value.
     10
     11        No new tests.
     12
     13        * platform/graphics/cairo/BitmapImageCairo.cpp:
     14        (WebCore::BitmapImage::draw):
     15
    1162012-10-08  Adam Barth  <abarth@webkit.org>
    217
  • trunk/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp

    r116907 r130706  
    9898    else
    9999        context->setCompositeOperation(op);
    100     context->platformContext()->drawSurfaceToContext(nativeImage->surface(), dstRect, srcRect, context);
     100
     101#if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
     102    cairo_surface_t* surface = nativeImage->surface();
     103    IntSize scaledSize(cairo_image_surface_get_width(surface), cairo_image_surface_get_height(surface));
     104    FloatRect adjustedSrcRect = adjustSourceRectForDownSampling(srcRect, scaledSize);
     105#else
     106    FloatRect adjustedSrcRect(srcRect);
     107#endif
     108
     109    context->platformContext()->drawSurfaceToContext(nativeImage->surface(), dstRect, adjustedSrcRect, context);
    101110
    102111    context->restore();
Note: See TracChangeset for help on using the changeset viewer.