Changeset 162442 in webkit


Ignore:
Timestamp:
Jan 21, 2014 8:36:50 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore: If you set a tiled cross-faded-image or a tiled gradient as
a background layer, -webkit-background-blend-mode doesn't work.
The problem consists in the blendMode parameter not being set
for these specific drawing paths.

https://bugs.webkit.org/show_bug.cgi?id=126888
Patch by Mihai Tica <mitica@adobe.com> on 2014-01-21
Reviewed by Dirk Schulze.

Test: css3/compositing/background-blend-mode-tiled-layers.html

  • platform/graphics/CrossfadeGeneratedImage.cpp:

(WebCore::CrossfadeGeneratedImage::drawPattern): Add the blendMode parameter and pass it to ImageBuffer::drawPattern.

  • platform/graphics/GradientImage.cpp:

(WebCore::GradientImage::drawPattern): Add the blendMode parameter and pass it to ImageBuffer::drawPattern.

  • platform/graphics/ImageBuffer.h: Add a BlendMode parameter to the drawPattern method.
  • platform/graphics/cairo/ImageBufferCairo.cpp:

(WebCore::ImageBuffer::drawPattern): Add the default BlendMode parameter to the method declaration.

  • platform/graphics/cg/ImageBufferCG.cpp:

(WebCore::ImageBuffer::drawPattern): Add and use the blendMode parameter for all the code paths.

  • platform/graphics/wince/ImageBufferWinCE.cpp:

(WebCore::BufferedImage::drawPattern): Add the default BlendMode parameter to the method declaration.

LayoutTests: If you set a tiled cross-faded-image or a tiled gradient as
a background layer, -webkit-background-blend-mode doesn't work.
https://bugs.webkit.org/show_bug.cgi?id=126888

Patch by Mihai Tica <mitica@adobe.com> on 2014-01-21
Reviewed by Dirk Schulze.

  • css3/compositing/background-blend-mode-tiled-layers-expected.html: Added.
  • css3/compositing/background-blend-mode-tiled-layers.html: Added.
  • platform/efl/TestExpectations: Skip test for efl, blendModes are not implemented.
  • platform/mac/TestExpectations: Mark added test as ImageOnlyFailure due to slight differences between the actual result and the blending formula.
Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r162438 r162442  
     12014-01-21  Mihai Tica  <mitica@adobe.com>
     2
     3        If you set a tiled cross-faded-image or a tiled gradient as
     4        a background layer, -webkit-background-blend-mode doesn't work.
     5        https://bugs.webkit.org/show_bug.cgi?id=126888
     6
     7        Reviewed by Dirk Schulze.
     8
     9        * css3/compositing/background-blend-mode-tiled-layers-expected.html: Added.
     10        * css3/compositing/background-blend-mode-tiled-layers.html: Added.
     11        * platform/efl/TestExpectations: Skip test for efl, blendModes are not implemented.
     12        * platform/mac/TestExpectations: Mark added test as ImageOnlyFailure due to slight differences between the actual result and the blending formula.
     13
    1142014-01-21  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
    215
  • trunk/LayoutTests/platform/efl/TestExpectations

    r162381 r162442  
    500500webkit.org/b/99200 css3/compositing/blend-mode-should-not-have-compositing-layer.html [ Skip ]
    501501webkit.org/b/118894 css3/compositing/background-blend-mode-data-uri-svg-image.html [ Skip ]
     502webkit.org/b/126888 css3/compositing/background-blend-mode-tiled-layers.html [ Skip ]
    502503
    503504# No concept of secure text input
  • trunk/LayoutTests/platform/mac/TestExpectations

    r162425 r162442  
    618618# Blend mode result is slightly different than the applied formula.
    619619css3/compositing/background-blend-mode-data-uri-svg-image.html [ ImageOnlyFailure Pass ]
     620css3/compositing/background-blend-mode-tiled-layers.html [ ImageOnlyFailure Pass ]
     621css3/compositing/background-blend-mode-crossfade-image.html [ ImageOnlyFailure Pass ]
    620622
    621623# https://bugs.webkit.org/show_bug.cgi?id=110871
     
    661663css3/filters/composited-during-transition-layertree.html
    662664webkit.org/b/95622 css3/filters/composited-during-animation-layertree.html [ Pass Failure ]
    663 
    664 # Blending result is slightly different than the formula.
    665 webkit.org/b/126887 css3/compositing/background-blend-mode-crossfade-image.html [ ImageOnlyFailure Pass ]
    666665
    667666# --- Custom Filters ---
  • trunk/Source/WebCore/ChangeLog

    r162440 r162442  
     12014-01-21  Mihai Tica  <mitica@adobe.com>
     2
     3        If you set a tiled cross-faded-image or a tiled gradient as
     4        a background layer, -webkit-background-blend-mode doesn't work.
     5        The problem consists in the blendMode parameter not being set
     6        for these specific drawing paths.
     7
     8        https://bugs.webkit.org/show_bug.cgi?id=126888
     9        Reviewed by Dirk Schulze.
     10
     11        Test: css3/compositing/background-blend-mode-tiled-layers.html
     12
     13        * platform/graphics/CrossfadeGeneratedImage.cpp:
     14        (WebCore::CrossfadeGeneratedImage::drawPattern): Add the blendMode parameter and pass it to ImageBuffer::drawPattern.
     15        * platform/graphics/GradientImage.cpp:
     16        (WebCore::GradientImage::drawPattern): Add the blendMode parameter and pass it to ImageBuffer::drawPattern.
     17        * platform/graphics/ImageBuffer.h: Add a BlendMode parameter to the drawPattern method.
     18        * platform/graphics/cairo/ImageBufferCairo.cpp:
     19        (WebCore::ImageBuffer::drawPattern): Add the default BlendMode parameter to the method declaration.
     20        * platform/graphics/cg/ImageBufferCG.cpp:
     21        (WebCore::ImageBuffer::drawPattern): Add and use the blendMode parameter for all the code paths.
     22        * platform/graphics/wince/ImageBufferWinCE.cpp:
     23        (WebCore::BufferedImage::drawPattern): Add the default BlendMode parameter to the method declaration.
     24
    1252014-01-21  Gurpreet Kaur  <k.gurpreet@samsung.com>
    226
  • trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp

    r162348 r162442  
    9797}
    9898
    99 void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode)
     99void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
    100100{
    101101    std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(size(), 1, ColorSpaceDeviceRGB, context->isAcceleratedContext() ? Accelerated : Unaccelerated);
     
    108108
    109109    // Tile the image buffer into the context.
    110     imageBuffer->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, compositeOp, dstRect);
     110    imageBuffer->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, compositeOp, dstRect, blendMode);
    111111}
    112112
  • trunk/Source/WebCore/platform/graphics/GradientImage.cpp

    r157909 r162442  
    4646
    4747void GradientImage::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
    48     const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode)
     48    const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode blendMode)
    4949{
    5050    // Allow the generator to provide visually-equivalent tiling parameters for better performance.
     
    8282
    8383    // Tile the image buffer into the context.
    84     m_cachedImageBuffer->drawPattern(destContext, adjustedSrcRect, adjustedPatternCTM, phase, styleColorSpace, compositeOp, destRect);
     84    m_cachedImageBuffer->drawPattern(destContext, adjustedSrcRect, adjustedPatternCTM, phase, styleColorSpace, compositeOp, destRect, blendMode);
    8585}
    8686
  • trunk/Source/WebCore/platform/graphics/ImageBuffer.h

    r160121 r162442  
    144144
    145145        void draw(GraphicsContext*, ColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
    146         void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
     146        void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
    147147
    148148        inline void genericConvertToLuminanceMask();
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r154936 r162442  
    154154
    155155void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
    156                               const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
     156    const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode)
    157157{
    158158    RefPtr<Image> image = copyImage(DontCopyBackingStore);
  • trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp

    r161779 r162442  
    308308}
    309309
    310 void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
     310void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
    311311{
    312312    FloatRect adjustedSrcRect = srcRect;
     
    316316        if (destContext == m_context || destContext->isAcceleratedContext()) {
    317317            RefPtr<Image> copy = copyImage(CopyBackingStore); // Drawing into our own buffer, need to deep copy.
    318             copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, styleColorSpace, op, destRect);
     318            copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, styleColorSpace, op, destRect, blendMode);
    319319        } else {
    320320            RefPtr<Image> imageForRendering = copyImage(DontCopyBackingStore);
    321             imageForRendering->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, styleColorSpace, op, destRect);
     321            imageForRendering->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, styleColorSpace, op, destRect, blendMode);
    322322        }
    323323    } else {
    324324        RefPtr<Image> copy = copyImage(CopyBackingStore);
    325         copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, styleColorSpace, op, destRect);
     325        copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, styleColorSpace, op, destRect, blendMode);
    326326    }
    327327}
  • trunk/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp

    r157909 r162442  
    5757
    5858void BufferedImage::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRectIn, const AffineTransform& patternTransform,
    59                              const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
     59    const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode)
    6060{
    6161    m_data->m_bitmap->drawPattern(ctxt, tileRectIn, patternTransform, phase, styleColorSpace, op, destRect, size());
Note: See TracChangeset for help on using the changeset viewer.