Changeset 222264 in webkit


Ignore:
Timestamp:
Sep 20, 2017 9:02:51 AM (7 years ago)
Author:
magomez@igalia.com
Message:

[GTK] Completely garbled display in GMail
https://bugs.webkit.org/show_bug.cgi?id=168964

Reviewed by Carlos Garcia Campos.

Do not try to decode images that are bigger than 32768 pixels, as cairo won't be able to render them,
and they will break the rendering of the rest of the page.

Covered by existent tests.

  • platform/graphics/ImageBackingStore.h:

(WebCore::ImageBackingStore::isOverSize):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r222263 r222264  
     12017-09-20  Miguel Gomez  <magomez@igalia.com>
     2
     3        [GTK] Completely garbled display in GMail
     4        https://bugs.webkit.org/show_bug.cgi?id=168964
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Do not try to decode images that are bigger than 32768 pixels, as cairo won't be able to render them,
     9        and they will break the rendering of the rest of the page.
     10
     11        Covered by existent tests.
     12
     13        * platform/graphics/ImageBackingStore.h:
     14        (WebCore::ImageBackingStore::isOverSize):
     15
    1162017-09-20  Antti Koivisto  <antti@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/ImageBackingStore.h

    r219702 r222264  
    3434namespace WebCore {
    3535
     36#if USE(CAIRO)
     37// Due to the pixman 16.16 floating point representation, cairo is not able to handle
     38// images whose size is bigger than 32768.
     39static const int cairoMaxImageSize = 32768;
     40#endif
     41
    3642class ImageBackingStore {
    3743    WTF_MAKE_FAST_ALLOCATED;
     
    172178    static bool isOverSize(const IntSize& size)
    173179    {
     180#if USE(CAIRO)
     181        // FIXME: this is a workaround to avoid the cairo image size limit, but we should implement support for
     182        // bigger images. See https://bugs.webkit.org/show_bug.cgi?id=177227.
     183        //
     184        // If the image is bigger than the cairo limit it can't be displayed, so we don't even try to decode it.
     185        if (size.width() > cairoMaxImageSize || size.height() > cairoMaxImageSize)
     186            return true;
     187#endif
    174188        static unsigned long long MaxPixels = ((1 << 29) - 1);
    175189        unsigned long long pixels = static_cast<unsigned long long>(size.width()) * static_cast<unsigned long long>(size.height());
Note: See TracChangeset for help on using the changeset viewer.