Changeset 254502 in webkit


Ignore:
Timestamp:
Jan 14, 2020 2:01:10 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Always Use CAIRO_OPERATOR_SOURCE to copyRectFromOneSurfaceToAnother
https://bugs.webkit.org/show_bug.cgi?id=206215

Patch by Tomoki Imai <Tomoki Imai> on 2020-01-14
Reviewed by Žan Doberšek.

Most of copyRectFromOneSurfaceToAnother callers passed CAIRO_OPERATOR_SOURCE not to blend.
BackingStoreBackendCairoImpl::scroll had copyRectFromOneSurfaceToAnother with the default cairoOperator CAIRO_OPERATOR_OVER,
but scrolling should use CAIRO_OPERATOR_SOURCE because there is no need to blend and it can have a performance benefit.

No new tests, covered by the existing tests.

  • platform/graphics/cairo/CairoUtilities.cpp:

(WebCore::copyRectFromOneSurfaceToAnother): Use CAIRO_OPERATOR_SOURCE to copy rect.

  • platform/graphics/cairo/CairoUtilities.h: Remove cairoOperator parameter from copyRectFromOneSurfaceToAnother.
  • platform/graphics/cairo/GraphicsContextGLCairo.cpp:

(WebCore::GraphicsContextGLOpenGL::ImageExtractor::extractImage):

  • platform/graphics/cairo/ImageBufferCairo.cpp:

(WebCore::getImageData):
(WebCore::ImageBuffer::putByteArray):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r254499 r254502  
     12020-01-14  Tomoki Imai  <Tomoki.Imai@sony.com>
     2
     3        Always Use CAIRO_OPERATOR_SOURCE to copyRectFromOneSurfaceToAnother
     4        https://bugs.webkit.org/show_bug.cgi?id=206215
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Most of copyRectFromOneSurfaceToAnother callers passed CAIRO_OPERATOR_SOURCE not to blend.
     9        BackingStoreBackendCairoImpl::scroll had copyRectFromOneSurfaceToAnother with the default cairoOperator CAIRO_OPERATOR_OVER,
     10        but scrolling should use CAIRO_OPERATOR_SOURCE because there is no need to blend and it can have a performance benefit.
     11
     12        No new tests, covered by the existing tests.
     13
     14        * platform/graphics/cairo/CairoUtilities.cpp:
     15        (WebCore::copyRectFromOneSurfaceToAnother): Use CAIRO_OPERATOR_SOURCE to copy rect.
     16        * platform/graphics/cairo/CairoUtilities.h: Remove cairoOperator parameter from copyRectFromOneSurfaceToAnother.
     17        * platform/graphics/cairo/GraphicsContextGLCairo.cpp:
     18        (WebCore::GraphicsContextGLOpenGL::ImageExtractor::extractImage):
     19        * platform/graphics/cairo/ImageBufferCairo.cpp:
     20        (WebCore::getImageData):
     21        (WebCore::ImageBuffer::putByteArray):
     22
    1232020-01-14  Eric Carlson  <eric.carlson@apple.com>
    224
  • trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp

    r252965 r254502  
    300300}
    301301
    302 void copyRectFromOneSurfaceToAnother(cairo_surface_t* from, cairo_surface_t* to, const IntSize& sourceOffset, const IntRect& rect, const IntSize& destOffset, cairo_operator_t cairoOperator)
     302void copyRectFromOneSurfaceToAnother(cairo_surface_t* from, cairo_surface_t* to, const IntSize& sourceOffset, const IntRect& rect, const IntSize& destOffset)
    303303{
    304304    RefPtr<cairo_t> context = adoptRef(cairo_create(to));
    305305    cairo_translate(context.get(), destOffset.width(), destOffset.height());
    306     cairo_set_operator(context.get(), cairoOperator);
     306    cairo_set_operator(context.get(), CAIRO_OPERATOR_SOURCE);
    307307    copyRectFromCairoSurfaceToContext(from, context.get(), sourceOffset, rect);
    308308}
  • trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.h

    r234610 r254502  
    8787
    8888void copyRectFromCairoSurfaceToContext(cairo_surface_t* from, cairo_t* to, const IntSize& offset, const IntRect&);
    89 void copyRectFromOneSurfaceToAnother(cairo_surface_t* from, cairo_surface_t* to, const IntSize& offset, const IntRect&, const IntSize& = IntSize(), cairo_operator_t = CAIRO_OPERATOR_OVER);
     89void copyRectFromOneSurfaceToAnother(cairo_surface_t* from, cairo_surface_t* to, const IntSize& offset, const IntRect&, const IntSize& = IntSize());
    9090
    9191IntSize cairoSurfaceSize(cairo_surface_t*);
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextGLCairo.cpp

    r254064 r254502  
    7070            IntSize surfaceSize = cairoSurfaceSize(m_imageSurface.get());
    7171            auto tmpSurface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, surfaceSize.width(), surfaceSize.height()));
    72             copyRectFromOneSurfaceToAnother(m_imageSurface.get(), tmpSurface.get(), IntSize(), IntRect(IntPoint(), surfaceSize), IntSize(), CAIRO_OPERATOR_SOURCE);
     72            copyRectFromOneSurfaceToAnother(m_imageSurface.get(), tmpSurface.get(), IntSize(), IntRect(IntPoint(), surfaceSize), IntSize());
    7373            m_imageSurface = WTFMove(tmpSurface);
    7474        }
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r254214 r254502  
    487487        // This cairo surface operation is done in LogicalCoordinateSystem.
    488488        IntRect logicalArea = intersection(logicalRect, IntRect(0, 0, logicalSize.width(), logicalSize.height()));
    489         copyRectFromOneSurfaceToAnother(data.m_surface.get(), imageSurface.get(), IntSize(-logicalArea.x(), -logicalArea.y()), IntRect(IntPoint(), logicalArea.size()), IntSize(), CAIRO_OPERATOR_SOURCE);
     489        copyRectFromOneSurfaceToAnother(data.m_surface.get(), imageSurface.get(), IntSize(-logicalArea.x(), -logicalArea.y()), IntRect(IntPoint(), logicalArea.size()), IntSize());
    490490    }
    491491
     
    651651    if (imageSurface != m_data.m_surface.get()) {
    652652        // This cairo surface operation is done in LogicalCoordinateSystem.
    653         copyRectFromOneSurfaceToAnother(imageSurface.get(), m_data.m_surface.get(), IntSize(), IntRect(0, 0, logicalNumColumns, logicalNumRows), IntSize(logicalDestPoint.x() + logicalSourceRect.x(), logicalDestPoint.y() + logicalSourceRect.y()), CAIRO_OPERATOR_SOURCE);
     653        copyRectFromOneSurfaceToAnother(imageSurface.get(), m_data.m_surface.get(), IntSize(), IntRect(0, 0, logicalNumColumns, logicalNumRows), IntSize(logicalDestPoint.x() + logicalSourceRect.x(), logicalDestPoint.y() + logicalSourceRect.y()));
    654654    }
    655655}
Note: See TracChangeset for help on using the changeset viewer.