Changeset 56735 in webkit


Ignore:
Timestamp:
Mar 29, 2010 11:28:08 AM (14 years ago)
Author:
kbr@google.com
Message:

2010-03-29 Kenneth Russell <kbr@google.com>

Reviewed by Darin Fisher.

Eliminate use of GL_BGRA in GraphicsContext3DSkia.cpp
https://bugs.webkit.org/show_bug.cgi?id=36737

No new tests; ran WebGL demos in Chromium on Windows to verify fix.

  • platform/graphics/skia/GraphicsContext3DSkia.cpp: (WebCore::GraphicsContext3D::getImageData):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r56732 r56735  
     12010-03-29  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Eliminate use of GL_BGRA in GraphicsContext3DSkia.cpp
     6        https://bugs.webkit.org/show_bug.cgi?id=36737
     7
     8        No new tests; ran WebGL demos in Chromium on Windows to verify fix.
     9
     10        * platform/graphics/skia/GraphicsContext3DSkia.cpp:
     11        (WebCore::GraphicsContext3D::getImageData):
     12
    1132010-03-29  Alexander Pavlov  <apavlov@chromium.org>
    214
  • trunk/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp

    r54907 r56735  
    3434#include "NativeImageSkia.h"
    3535
     36#include <algorithm>
     37
    3638namespace WebCore {
    3739
     
    6062    uint8_t* pixels = reinterpret_cast<uint8_t*>(skiaImage->getPixels());
    6163    outputVector.resize(rowBytes * height);
    62     memcpy(outputVector.data(), pixels, rowBytes * height);
     64    int size = rowBytes * height;
     65    memcpy(outputVector.data(), pixels, size);
    6366    *hasAlphaChannel = true;
    6467    if (!premultiplyAlpha)
    6568        // FIXME: must fetch the image data before the premultiplication step
    6669        *neededAlphaOp = kAlphaDoUnmultiply;
    67     // FIXME: remove this dependency on desktop OpenGL
    68     *format = 0x80E1; // GL_BGRA
     70    // Convert from BGRA to RGBA. FIXME: add GL_BGRA extension support
     71    // to all underlying OpenGL implementations.
     72    for (int i = 0; i < size; i += 4)
     73        std::swap(outputVector[i], outputVector[i + 2]);
     74    *format = RGBA;
    6975    return true;
    7076}
Note: See TracChangeset for help on using the changeset viewer.