Changeset 86026 in webkit


Ignore:
Timestamp:
May 8, 2011 5:18:53 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-08 Jarkko Sakkinen <jarkko.j.sakkinen@gmail.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] GraphicsContext3D::getImageData() does not retrieve image data correctly
https://bugs.webkit.org/show_bug.cgi?id=58556

Tests: fast/canvas/webgl/gl-teximage.html

  • platform/graphics/qt/GraphicsContext3DQt.cpp: (WebCore::GraphicsContext3D::getImageData):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86025 r86026  
     12011-05-08  Jarkko Sakkinen  <jarkko.j.sakkinen@gmail.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] GraphicsContext3D::getImageData() does not retrieve image data correctly
     6        https://bugs.webkit.org/show_bug.cgi?id=58556
     7
     8        Tests: fast/canvas/webgl/gl-teximage.html
     9
     10        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     11        (WebCore::GraphicsContext3D::getImageData):
     12
    1132011-05-07  Dan Bernstein  <mitz@apple.com>
    214
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r85526 r86026  
    3131#include "NotImplemented.h"
    3232#include "QWebPageClient.h"
     33#include "SharedBuffer.h"
    3334#include "qwebpage.h"
    3435#include <QAbstractScrollArea>
     
    17401741    if (!image)
    17411742        return false;
    1742     QPixmap* nativePixmap = image->nativeImageForCurrentFrame();
    1743     if (!nativePixmap)
    1744         return false;
    1745 
     1743    QImage nativeImage;
     1744    // Is image already loaded? If not, load it.
     1745    if (image->data())
     1746        nativeImage = QImage::fromData(reinterpret_cast<const uchar*>(image->data()->data()), image->data()->size()).convertToFormat(QImage::Format_ARGB32);
     1747    else {
     1748        QPixmap* nativePixmap = image->nativeImageForCurrentFrame();
     1749        nativeImage = nativePixmap->toImage().convertToFormat(QImage::Format_ARGB32);
     1750    }
    17461751    AlphaOp neededAlphaOp = AlphaDoNothing;
    1747     if (!premultiplyAlpha)
    1748         // FIXME: must fetch the image data before the premultiplication step
    1749         neededAlphaOp = AlphaDoUnmultiply;
    1750     QImage nativeImage = nativePixmap->toImage().convertToFormat(QImage::Format_ARGB32);
     1752    if (premultiplyAlpha)
     1753        neededAlphaOp = AlphaDoPremultiply;
    17511754    outputVector.resize(nativeImage.byteCount());
    1752     return packPixels(nativeImage.rgbSwapped().bits(), SourceFormatRGBA8, image->width(), image->height(), 0,
    1753                       format, type, neededAlphaOp, outputVector.data());
     1755    return packPixels(nativeImage.bits(), SourceFormatBGRA8, image->width(), image->height(), 0, format, type, neededAlphaOp, outputVector.data());
    17541756}
    17551757
Note: See TracChangeset for help on using the changeset viewer.