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

Changeset 262194 in webkit


Ignore:
Timestamp:
May 27, 2020, 6:25:45 AM (6 years ago)
Author:
magomez@igalia.com
Message:

[WPE] REGRESSION(r253675) Crash when using threaded rendering
​https://bugs.webkit.org/show_bug.cgi?id=212404

Reviewed by Carlos Garcia Campos.

Check whether the GraphicsContext has a PlatformGraphicsContext before trying to paint with
it. If there's no PlatformGraphicsContext, paint using the GraphicsContext methods instead.

  • platform/graphics/cairo/ImageBufferCairoBackend.cpp:

(WebCore::ImageBufferCairoBackend::draw):
(WebCore::ImageBufferCairoBackend::drawPattern):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r262192 r262194  
     12020-05-27  Miguel Gomez  <magomez@igalia.com>
     2
     3        [WPE] REGRESSION(r253675) Crash when using threaded rendering
     4        https://bugs.webkit.org/show_bug.cgi?id=212404
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Check whether the GraphicsContext has a PlatformGraphicsContext before trying to paint with
     9        it. If there's no PlatformGraphicsContext, paint using the GraphicsContext methods instead.
     10
     11        * platform/graphics/cairo/ImageBufferCairoBackend.cpp:
     12        (WebCore::ImageBufferCairoBackend::draw):
     13        (WebCore::ImageBufferCairoBackend::drawPattern):
     14
    1152020-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
    216
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoBackend.cpp

    r261828 r262194  
    5555void ImageBufferCairoBackend::draw(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions& options)
    5656{
     57    if (!destContext.hasPlatformContext()) {
     58        // If there's no platformContext, we're using threaded rendering, and all the operations must be done
     59        // through the GraphicsContext.
     60        auto image = copyImage(&destContext == &context() ? CopyBackingStore : DontCopyBackingStore);
     61        destContext.drawImage(*image, destRect, srcRect, options);
     62        return;
     63    }
     64
    5765    InterpolationQualityMaintainer interpolationQualityForThisScope(destContext, options.interpolationQuality());
    5866    const auto& destinationContextState = destContext.state();
    … …  
    6270}
    6371
    64 void ImageBufferCairoBackend::drawPattern(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize&, const ImagePaintingOptions& options)
     72void ImageBufferCairoBackend::drawPattern(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, const ImagePaintingOptions& options)
    6573{
     74    if (!destContext.hasPlatformContext()) {
     75        // If there's no platformContext, we're using threaded rendering, and all the operations must be done
     76        // through the GraphicsContext.
     77        auto image = copyImage(DontCopyBackingStore);
     78        image->drawPattern(destContext, destRect, srcRect, patternTransform, phase, spacing, options);
     79        return;
     80    }
     81
    6682    if (auto image = copyNativeImage(&destContext == &context() ? CopyBackingStore : DontCopyBackingStore))
    6783        Cairo::drawPattern(*destContext.platformContext(), image.get(), m_logicalSize, destRect, srcRect, patternTransform, phase, options);
Note: See TracChangeset for help on using the changeset viewer.