Changeset 78495 in webkit


Ignore:
Timestamp:
Feb 14, 2011 11:48:14 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-02-14 Andrew Wason <rectalogic@rectalogic.com>

Reviewed by Kenneth Russell.

[Qt] WebKit fails to compile for Qt when WebGL enabled
https://bugs.webkit.org/show_bug.cgi?id=53431

No new tests.

  • WebCore.pro: Add source and header files and include directory to Qt project.
  • html/canvas/WebGLRenderingContext.cpp: File uses 'emit' which is a Qt keyword - #undef emit.
  • platform/graphics/gpu/qt: Added.
  • platform/graphics/gpu/qt/DrawingBufferQt.cpp: Added. Partial implementation of DrawingBuffer for Qt. (WebCore::DrawingBuffer::DrawingBuffer): (WebCore::DrawingBuffer::~DrawingBuffer): (WebCore::DrawingBuffer::didReset): (WebCore::DrawingBuffer::platformLayer): (WebCore::DrawingBuffer::platformColorBuffer):
  • platform/graphics/qt/Extensions3DQt.cpp: Noop implementation for pure virtual methods added to Extensions3D.h (WebCore::Extensions3DQt::blitFramebuffer): (WebCore::Extensions3DQt::renderbufferStorageMultisample):
  • platform/graphics/qt/Extensions3DQt.h: Declare new methods added to Extensions3D.h
  • platform/graphics/qt/GraphicsContext3DQt.cpp: Remove method implementations no longer in GraphicsContext3D.h. Change m_syntheticErrors to use unsigned int to match new GC3Denum type. (WebCore::GraphicsContext3D::create): Change return type to match GraphicsContext3D.h (WebCore::GraphicsContext3D::lineWidth): Change argument type to GC3Dfloat to match GraphicsContext3D.h (WebCore::GraphicsContext3D::getUniformLocation): Change return type to GC3Dfloat to match GraphicsContext3D.h (WebCore::GraphicsContext3D::getExtensions): Need to call get() on OwnPtr. (WebCore::GraphicsContext3D::getImageData): Rename enum values to match declarations in GraphicsContext3D.h
Location:
trunk/Source/WebCore
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r78493 r78495  
     12011-02-14  Andrew Wason  <rectalogic@rectalogic.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        [Qt] WebKit fails to compile for Qt when WebGL enabled
     6        https://bugs.webkit.org/show_bug.cgi?id=53431
     7
     8        No new tests.
     9
     10        * WebCore.pro:
     11          Add source and header files and include directory to Qt project.
     12        * html/canvas/WebGLRenderingContext.cpp:
     13          File uses 'emit' which is a Qt keyword - #undef emit.
     14        * platform/graphics/gpu/qt: Added.
     15        * platform/graphics/gpu/qt/DrawingBufferQt.cpp: Added.
     16          Partial implementation of DrawingBuffer for Qt.
     17        (WebCore::DrawingBuffer::DrawingBuffer):
     18        (WebCore::DrawingBuffer::~DrawingBuffer):
     19        (WebCore::DrawingBuffer::didReset):
     20        (WebCore::DrawingBuffer::platformLayer):
     21        (WebCore::DrawingBuffer::platformColorBuffer):
     22        * platform/graphics/qt/Extensions3DQt.cpp:
     23          Noop implementation for pure virtual methods added to Extensions3D.h
     24        (WebCore::Extensions3DQt::blitFramebuffer):
     25        (WebCore::Extensions3DQt::renderbufferStorageMultisample):
     26        * platform/graphics/qt/Extensions3DQt.h:
     27          Declare new methods added to Extensions3D.h
     28        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     29          Remove method implementations no longer in GraphicsContext3D.h.
     30          Change m_syntheticErrors to use unsigned int to match new
     31          GC3Denum type.
     32        (WebCore::GraphicsContext3D::create):
     33         Change return type to match GraphicsContext3D.h
     34        (WebCore::GraphicsContext3D::lineWidth):
     35         Change argument type to GC3Dfloat to match GraphicsContext3D.h
     36        (WebCore::GraphicsContext3D::getUniformLocation):
     37         Change return type to GC3Dfloat to match GraphicsContext3D.h
     38        (WebCore::GraphicsContext3D::getExtensions):
     39         Need to call get() on OwnPtr.
     40        (WebCore::GraphicsContext3D::getImageData):
     41         Rename enum values to match declarations in GraphicsContext3D.h
     42
    1432011-02-14  Tony Chang  <tony@chromium.org>
    244
  • trunk/Source/WebCore/WebCore.pro

    r78439 r78495  
    38113811        html/canvas/WebGLBuffer.h \
    38123812        html/canvas/WebGLContextAttributes.h \
     3813        html/canvas/WebGLContextEvent.h \
    38133814        html/canvas/WebGLExtension.h \
    38143815        html/canvas/WebGLFramebuffer.h \
     
    38253826        platform/graphics/Extensions3D.h \
    38263827        platform/graphics/GraphicsContext3D.h \
     3828        platform/graphics/gpu/DrawingBuffer.h \
    38273829        platform/graphics/qt/Extensions3DQt.h
    38283830
     
    38363838        html/canvas/WebGLBuffer.cpp \
    38373839        html/canvas/WebGLContextAttributes.cpp \
     3840        html/canvas/WebGLContextEvent.cpp \
    38383841        html/canvas/WebGLExtension.cpp \
    38393842        html/canvas/WebGLFramebuffer.cpp \
     
    38493852        html/canvas/WebKitLoseContext.cpp \
    38503853        platform/graphics/GraphicsContext3D.cpp \
     3854        platform/graphics/gpu/DrawingBuffer.cpp \
     3855        platform/graphics/gpu/qt/DrawingBufferQt.cpp \
    38513856        platform/graphics/qt/Extensions3DQt.cpp \
    38523857        platform/graphics/qt/GraphicsContext3DQt.cpp
     3858
     3859        INCLUDEPATH += $$PWD/platform/graphics/gpu
    38533860}
    38543861
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r78419 r78495  
    6666#include <wtf/PassOwnArrayPtr.h>
    6767#include <wtf/text/StringBuilder.h>
     68
     69#if PLATFORM(QT)
     70#undef emit
     71#endif
    6872
    6973namespace WebCore {
  • trunk/Source/WebCore/platform/graphics/qt/Extensions3DQt.cpp

    r76600 r78495  
    5757}
    5858
     59void Extensions3DQt::blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter)
     60{
     61}
     62
     63void Extensions3DQt::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
     64{
     65}
     66
    5967} // namespace WebCore
    6068
  • trunk/Source/WebCore/platform/graphics/qt/Extensions3DQt.h

    r73806 r78495  
    3939    virtual void ensureEnabled(const String&);
    4040    virtual int getGraphicsResetStatusARB();
     41    virtual void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter);
     42    virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);   
    4143
    4244private:
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r77900 r78495  
    253253    GLuint m_depthBuffer;
    254254    QImage m_pixels;
    255     ListHashSet<unsigned long> m_syntheticErrors;
     255    ListHashSet<unsigned int> m_syntheticErrors;
    256256
    257257    OwnPtr<Extensions3DQt> m_extensions;
     
    278278}
    279279
    280 // Even with underlying GLES2 driver, the below flags should still be set to
    281 // false if extentions exist (and they almost always do).
    282 bool GraphicsContext3D::isGLES2NPOTStrict() const
    283 {
    284     return false;
    285 }
    286 
    287 bool GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses() const
    288 {
    289     return false;
    290 }
    291 
    292 int GraphicsContext3D::getGraphicsResetStatusARB()
    293 {
    294     return NO_ERROR;
    295 }
    296 
    297  
    298280GraphicsContext3DInternal::GraphicsContext3DInternal(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
    299281    : m_attrs(attrs)
     
    500482}
    501483
    502 PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
     484PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
    503485{
    504486    // This implementation doesn't currently support rendering directly to the HostWindow.
    505487    if (renderStyle == RenderDirectlyToHostWindow)
    506488        return 0;
    507     OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow, false));
     489    RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, false));
    508490    return context->m_internal ? context.release() : 0;
    509491}
     
    10391021}
    10401022
    1041 void GraphicsContext3D::lineWidth(double width)
     1023void GraphicsContext3D::lineWidth(GC3Dfloat width)
    10421024{
    10431025    m_internal->m_glWidget->makeCurrent();
     
    14901472}
    14911473
    1492 long GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
     1474GC3Dint GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
    14931475{
    14941476    ASSERT(program);
     
    16211603    if (!m_internal->m_extensions)
    16221604        m_internal->m_extensions = adoptPtr(new Extensions3DQt);
    1623     return m_internal->m_extensions;
     1605    return m_internal->m_extensions.get();
    16241606}
    16251607
     
    16381620        return false;
    16391621
    1640     AlphaOp neededAlphaOp = kAlphaDoNothing;
     1622    AlphaOp neededAlphaOp = AlphaDoNothing;
    16411623    if (!premultiplyAlpha)
    16421624        // FIXME: must fetch the image data before the premultiplication step
    1643         neededAlphaOp = kAlphaDoUnmultiply;
     1625        neededAlphaOp = AlphaDoUnmultiply;
    16441626    QImage nativeImage = nativePixmap->toImage().convertToFormat(QImage::Format_ARGB32);
    16451627    outputVector.resize(nativeImage.byteCount());
    1646     return packPixels(nativeImage.rgbSwapped().bits(), kSourceFormatRGBA8, image->width(), image->height(), 0,
     1628    return packPixels(nativeImage.rgbSwapped().bits(), SourceFormatRGBA8, image->width(), image->height(), 0,
    16471629                      format, type, neededAlphaOp, outputVector.data());
    16481630}
Note: See TracChangeset for help on using the changeset viewer.