Changeset 60391 in webkit


Ignore:
Timestamp:
May 28, 2010 11:27:54 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-05-28 Stephen White <senorblanco@chromium.org>

Reviewed by Darin Fisher.

[CHROMIUM] Chromium port should support image interpolation quality
https://bugs.webkit.org/show_bug.cgi?id=38686

  • platform/chromium/test_expectations.txt: Add failure expectations for resizing-based tests, so they can be rebaselined by the bots.

2010-05-28 Stephen White <senorblanco@chromium.org>

Reviewed by Darin Fisher.

Implement GraphicsContext::setImageInterpolation() for the Chromium
port. This is preparatory work for bug 38233. A number of
background-resize tests will need a rebaseline, since the images are
taken during the initial "low quality" phase (<800ms).

[CHROMIUM] Chromium port should support image interpolation quality
https://bugs.webkit.org/show_bug.cgi?id=38686

Covered by fast/backgrounds/size/backgroundSize15.html, and others.

  • platform/graphics/skia/GraphicsContextSkia.cpp: Implement WebCore::GraphicsContext::setImageInterpolationQuality.
  • platform/graphics/skia/ImageSkia.cpp: (WebCore::computeResamplingMode): Only enable high quality interpolation if it has been requested in the GraphicsContext. (WebCore::drawResampledBitmap): Enable cacheing of resampled images even if the size is not full (fix from Brett Wilson). (WebCore::paintSkBitmap): Pass in the PlatformContextSkia to computeResamplingMode, so it can query it for interpolation quality. (WebCore::Image::drawPattern): Ibid.
  • platform/graphics/skia/PlatformContextSkia.cpp: (PlatformContextSkia::State::State): (PlatformContextSkia::interpolationQuality): (PlatformContextSkia::setInterpolationQuality):
  • platform/graphics/skia/PlatformContextSkia.h: Add a member fn and accessors to retain the image interpolation quality in the platform context, and to save/restore it with the state.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r60388 r60391  
     12010-05-28  Stephen White  <senorblanco@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [CHROMIUM] Chromium port should support image interpolation quality
     6        https://bugs.webkit.org/show_bug.cgi?id=38686
     7
     8        * platform/chromium/test_expectations.txt:
     9        Add failure expectations for resizing-based tests, so they can be
     10        rebaselined by the bots.
     11
    1122010-05-28  Csaba Osztrogonác  <ossy@webkit.org>
    213
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r60301 r60391  
    28602860BUG45106 WIN : svg/text/text-text-04-t.svg = PASS CRASH
    28612861BUG45106 WIN : svg/text/text-text-05-t.svg = PASS CRASH
     2862
     2863// These test need to rebaselined after 38686 lands.
     2864BUG_WK38686 WIN LINUX : fast/backgrounds/size/backgroundSize15.html = IMAGE
     2865BUG_WK38686 WIN LINUX : fast/backgrounds/size/contain-and-cover.html = IMAGE
     2866BUG_WK38686 WIN LINUX : fast/borders/svg-as-border-image.html = IMAGE
     2867BUG_WK38686 WIN LINUX : fast/repaint/backgroundSizeRepaint.html = IMAGE
     2868BUG_WK38686 WIN LINUX : scrollbars/listbox-scrollbar-combinations.html = IMAGE
     2869BUG_WK38686 WIN LINUX : scrollbars/overflow-scrollbar-combinations.html = IMAGE
     2870BUG_WK38686 WIN LINUX : svg/W3C-SVG-1.1/coords-viewattr-02-b.svg = IMAGE
  • trunk/WebCore/ChangeLog

    r60389 r60391  
     12010-05-28  Stephen White  <senorblanco@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Implement GraphicsContext::setImageInterpolation() for the Chromium
     6        port.  This is preparatory work for bug 38233.  A number of
     7        background-resize tests will need a rebaseline, since the images are
     8        taken during the initial "low quality" phase (<800ms).
     9
     10        [CHROMIUM] Chromium port should support image interpolation quality
     11        https://bugs.webkit.org/show_bug.cgi?id=38686
     12
     13        Covered by fast/backgrounds/size/backgroundSize15.html, and others.
     14
     15        * platform/graphics/skia/GraphicsContextSkia.cpp:
     16        Implement WebCore::GraphicsContext::setImageInterpolationQuality.
     17        * platform/graphics/skia/ImageSkia.cpp:
     18        (WebCore::computeResamplingMode):  Only enable high quality
     19        interpolation if it has been requested in the GraphicsContext.
     20        (WebCore::drawResampledBitmap):  Enable cacheing of resampled images
     21        even if the size is not full (fix from Brett Wilson).
     22        (WebCore::paintSkBitmap):  Pass in the PlatformContextSkia to
     23        computeResamplingMode, so it can query it for interpolation quality.
     24        (WebCore::Image::drawPattern):  Ibid.
     25        * platform/graphics/skia/PlatformContextSkia.cpp:
     26        (PlatformContextSkia::State::State):
     27        (PlatformContextSkia::interpolationQuality):
     28        (PlatformContextSkia::setInterpolationQuality):
     29        * platform/graphics/skia/PlatformContextSkia.h:
     30        Add a member fn and accessors to retain the image interpolation quality
     31        in the platform context, and to save/restore it with the state.
     32
    1332010-05-28  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
    234
  • trunk/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

    r58916 r60391  
    876876}
    877877
    878 void GraphicsContext::setImageInterpolationQuality(InterpolationQuality)
    879 {
    880     notImplemented();
     878void GraphicsContext::setImageInterpolationQuality(InterpolationQuality q)
     879{
     880    platformContext()->setInterpolationQuality(q);
    881881}
    882882
  • trunk/WebCore/platform/graphics/skia/ImageSkia.cpp

    r59487 r60391  
    6565};
    6666
    67 static ResamplingMode computeResamplingMode(const NativeImageSkia& bitmap, int srcWidth, int srcHeight, float destWidth, float destHeight)
     67static ResamplingMode computeResamplingMode(PlatformContextSkia* platformContext, const NativeImageSkia& bitmap, int srcWidth, int srcHeight, float destWidth, float destHeight)
    6868{
    6969    int destIWidth = static_cast<int>(destWidth);
     
    131131
    132132    // Everything else gets resampled.
    133     return RESAMPLE_AWESOME;
     133    // If the platform context permits high quality interpolation, use it.
     134    if (platformContext->interpolationQuality() == InterpolationHigh)
     135        return RESAMPLE_AWESOME;
     136   
     137    return RESAMPLE_LINEAR;
    134138}
    135139
     
    185189        return;  // Resized image does not intersect.
    186190
    187     if (srcIsFull && bitmap.shouldCacheResampling(
     191    if (srcIsFull || bitmap.shouldCacheResampling(
    188192            resizedImageRect.width(),
    189193            resizedImageRect.height(),
     
    231235
    232236    ResamplingMode resampling = platformContext->isPrinting() ? RESAMPLE_NONE :
    233         computeResamplingMode(bitmap, srcRect.width(), srcRect.height(),
     237        computeResamplingMode(platformContext, bitmap, srcRect.width(), srcRect.height(),
    234238                              SkScalarToFloat(destRect.width()),
    235239                              SkScalarToFloat(destRect.height()));
     
    337341      resampling = RESAMPLE_LINEAR;
    338342    else {
    339       resampling = computeResamplingMode(*bitmap,
     343      resampling = computeResamplingMode(context->platformContext(), *bitmap,
    340344                                         srcRect.width(), srcRect.height(),
    341345                                         destBitmapWidth, destBitmapHeight);
  • trunk/WebCore/platform/graphics/skia/PlatformContextSkia.cpp

    r54859 r60391  
    100100    // order in which they were pushed.
    101101    WTF::Vector<SkPath> m_antiAliasClipPaths;
     102    WebCore::InterpolationQuality m_interpolationQuality;
    102103
    103104private:
     
    124125    , m_dash(0)
    125126    , m_textDrawingMode(WebCore::cTextFill)
     127    , m_interpolationQuality(WebCore::InterpolationHigh)
    126128{
    127129}
     
    148150    , m_clip(other.m_clip)
    149151#endif
     152    , m_interpolationQuality(other.m_interpolationQuality)
    150153{
    151154    // Up the ref count of these. saveRef does nothing if 'this' is NULL.
     
    540543}
    541544
     545WebCore::InterpolationQuality PlatformContextSkia::interpolationQuality() const
     546{
     547    return m_state->m_interpolationQuality;
     548}
     549
     550void PlatformContextSkia::setInterpolationQuality(WebCore::InterpolationQuality interpolationQuality)
     551{
     552    m_state->m_interpolationQuality = interpolationQuality;
     553}
     554
    542555void PlatformContextSkia::setDashPathEffect(SkDashPathEffect* dash)
    543556{
  • trunk/WebCore/platform/graphics/skia/PlatformContextSkia.h

    r54262 r60391  
    148148    skia::PlatformCanvas* canvas() { return m_canvas; }
    149149
     150    WebCore::InterpolationQuality interpolationQuality() const;
     151    void setInterpolationQuality(WebCore::InterpolationQuality interpolationQuality);
     152
    150153    // FIXME: This should be pushed down to GraphicsContext.
    151154    void drawRect(SkRect rect);
Note: See TracChangeset for help on using the changeset viewer.