Changeset 228085 in webkit


Ignore:
Timestamp:
Feb 4, 2018 11:38:08 PM (6 years ago)
Author:
zandobersek@gmail.com
Message:

[Cairo] Correctly calculate stride in GraphicsContext3D::paintToCanvas()
https://bugs.webkit.org/show_bug.cgi?id=182466

Reviewed by Michael Catanzaro.

  • platform/graphics/cairo/GraphicsContext3DCairo.cpp:

(WebCore::GraphicsContext3D::paintToCanvas):
Use cairo_format_stride_for_width() to obtain stride that Cairo thinks
is appropriate for the given width, taking into account internal
alignment requirements.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r228084 r228085  
     12018-02-04  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [Cairo] Correctly calculate stride in GraphicsContext3D::paintToCanvas()
     4        https://bugs.webkit.org/show_bug.cgi?id=182466
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
     9        (WebCore::GraphicsContext3D::paintToCanvas):
     10        Use cairo_format_stride_for_width() to obtain stride that Cairo thinks
     11        is appropriate for the given width, taking into account internal
     12        alignment requirements.
     13
    1142018-02-04  Zan Dobersek  <zdobersek@igalia.com>
    215
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp

    r228084 r228085  
    122122
    123123    RefPtr<cairo_surface_t> imageSurface = adoptRef(cairo_image_surface_create_for_data(
    124         const_cast<unsigned char*>(imagePixels), CAIRO_FORMAT_ARGB32, imageSize.width(), imageSize.height(), imageSize.width() * 4));
     124        const_cast<unsigned char*>(imagePixels), CAIRO_FORMAT_ARGB32, imageSize.width(), imageSize.height(),
     125        cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, imageSize.width())));
    125126
    126127    // OpenGL keeps the pixels stored bottom up, so we need to flip the image here.
Note: See TracChangeset for help on using the changeset viewer.