Changeset 128223 in webkit


Ignore:
Timestamp:
Sep 11, 2012 1:54:05 PM (12 years ago)
Author:
senorblanco@chromium.org
Message:

Source/WebCore: [skia] Switch FEComponentTransfer filter to use skia's SkColorFilter
https://bugs.webkit.org/show_bug.cgi?id=95238

Reviewed by Dirk Schulze.

Covered by existing tests in svg/, such as svg/custom/feComponentTransfer-Discrete.svg.

  • WebCore.gypi:
  • platform/graphics/filters/FEComponentTransfer.cpp:

(WebCore::FEComponentTransfer::platformApplySoftware):
Add a check for the skia implementation.
(WebCore::FEComponentTransfer::getValues):

  • platform/graphics/filters/FEComponentTransfer.h:

Factor out the retrieval of LUT values into its own function, so we
can call it from the Skia implementation.

  • platform/graphics/filters/skia/FEComponentTransferSkia.cpp: Added.

(WebCore::FEComponentTransfer::platformApplySkia):

LayoutTests: [chromium] Mark some tests as needing a rebaseline due to SVG filters change.
https://bugs.webkit.org/show_bug.cgi?id=95238

Reviewed by Dirk Schulze.

  • platform/chromium/TestExpectations:
Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r128222 r128223  
     12012-09-11  Stephen White  <senorblanco@chromium.org>
     2
     3        [chromium] Mark some tests as needing a rebaseline due to SVG filters change.
     4        https://bugs.webkit.org/show_bug.cgi?id=95238
     5
     6        Reviewed by Dirk Schulze.
     7
     8        * platform/chromium/TestExpectations:
     9
    1102012-09-11  Kevin Ellis  <kevers@chromium.org>
    211
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r128216 r128223  
    13191319BUGWK93589 LINUX SNOWLEOPARD DEBUG : svg/dom/SVGScriptElement/script-change-externalResourcesRequired-while-loading.svg = TIMEOUT PASS TEXT
    13201320
     1321// Need rebaseline for slight pixel changes
     1322BUGWK95238 : svg/W3C-SVG-1.1/filters-comptran-01-b.svg = IMAGE
     1323BUGWK95238 : svg/custom/feComponentTransfer-Discrete.svg = IMAGE
     1324BUGWK95238 : svg/custom/feComponentTransfer-Gamma.svg = IMAGE
     1325BUGWK95238 : svg/custom/feComponentTransfer-Linear.svg = IMAGE
     1326BUGWK95238 : svg/custom/feComponentTransfer-Table.svg = IMAGE
     1327BUGWK95238 : svg/dynamic-updates/SVGFEComponentTransferElement-dom-tableValues-attr.html = IMAGE
     1328BUGWK95238 : svg/dynamic-updates/SVGFEComponentTransferElement-svgdom-tableValues-prop.html = IMAGE
     1329BUGWK95238 : css3/filters/effect-reference-ordering.html = IMAGE
     1330BUGWK95238 : css3/filters/effect-combined.html = IMAGE
     1331BUGWK95238 : css3/filters/effect-opacity.html = IMAGE
     1332
    13211333// -----------------------------------------------------------------
    13221334// End SVG TESTS
  • trunk/Source/WebCore/ChangeLog

    r128222 r128223  
     12012-09-11  Stephen White  <senorblanco@chromium.org>
     2
     3        [skia] Switch FEComponentTransfer filter to use skia's SkColorFilter
     4        https://bugs.webkit.org/show_bug.cgi?id=95238
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Covered by existing tests in svg/, such as svg/custom/feComponentTransfer-Discrete.svg.
     9
     10        * WebCore.gypi:
     11        * platform/graphics/filters/FEComponentTransfer.cpp:
     12        (WebCore::FEComponentTransfer::platformApplySoftware):
     13        Add a check for the skia implementation.
     14        (WebCore::FEComponentTransfer::getValues):
     15        * platform/graphics/filters/FEComponentTransfer.h:
     16        Factor out the retrieval of LUT values into its own function, so we
     17        can call it from the Skia implementation.
     18        * platform/graphics/filters/skia/FEComponentTransferSkia.cpp: Added.
     19        (WebCore::FEComponentTransfer::platformApplySkia):
     20
    1212012-09-11  Kevin Ellis  <kevers@chromium.org>
    222
  • trunk/Source/WebCore/WebCore.gypi

    r128159 r128223  
    49974997            'platform/graphics/filters/skia/FEBlendSkia.cpp',
    49984998            'platform/graphics/filters/skia/FEColorMatrixSkia.cpp',
     4999            'platform/graphics/filters/skia/FEComponentTransferSkia.cpp',
    49995000            'platform/graphics/filters/skia/FEGaussianBlurSkia.cpp',
    50005001            'platform/graphics/filters/skia/FEMorphologySkia.cpp',
  • trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp

    r114992 r128223  
    160160
    161161    unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
    162     for (unsigned i = 0; i < 256; ++i)
    163         rValues[i] = gValues[i] = bValues[i] = aValues[i] = i;
     162    getValues(rValues, gValues, bValues, aValues);
    164163    unsigned char* tables[] = { rValues, gValues, bValues, aValues };
    165     ComponentTransferFunction transferFunction[] = {m_redFunc, m_greenFunc, m_blueFunc, m_alphaFunc};
    166     TransferType callEffect[] = {identity, identity, table, discrete, linear, gamma};
    167 
    168     for (unsigned channel = 0; channel < 4; channel++) {
    169         ASSERT(static_cast<size_t>(transferFunction[channel].type) < WTF_ARRAY_LENGTH(callEffect));
    170         (*callEffect[transferFunction[channel].type])(tables[channel], transferFunction[channel]);
    171     }
    172164
    173165    IntRect drawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
     
    180172            pixelArray->set(pixelOffset + channel, tables[channel][c]);
    181173        }
     174    }
     175}
     176
     177void FEComponentTransfer::getValues(unsigned char rValues[256], unsigned char gValues[256], unsigned char bValues[256], unsigned char aValues[256])
     178{
     179    for (unsigned i = 0; i < 256; ++i)
     180        rValues[i] = gValues[i] = bValues[i] = aValues[i] = i;
     181    unsigned char* tables[] = { rValues, gValues, bValues, aValues };
     182    ComponentTransferFunction transferFunction[] = {m_redFunc, m_greenFunc, m_blueFunc, m_alphaFunc};
     183    TransferType callEffect[] = {identity, identity, table, discrete, linear, gamma};
     184
     185    for (unsigned channel = 0; channel < 4; channel++) {
     186        ASSERT(static_cast<size_t>(transferFunction[channel].type) < WTF_ARRAY_LENGTH(callEffect));
     187        (*callEffect[transferFunction[channel].type])(tables[channel], transferFunction[channel]);
    182188    }
    183189}
  • trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.h

    r97853 r128223  
    8080
    8181    virtual void platformApplySoftware();
     82#if USE(SKIA)
     83    virtual bool platformApplySkia();
     84#endif
    8285    virtual void dump();
    8386
     
    8790    FEComponentTransfer(Filter*, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
    8891                        const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
     92
     93    void getValues(unsigned char rValues[256], unsigned char gValues[256], unsigned char bValues[256], unsigned char aValues[256]);
    8994
    9095    ComponentTransferFunction m_redFunc;
Note: See TracChangeset for help on using the changeset viewer.