Changeset 65761 in webkit


Ignore:
Timestamp:
Aug 20, 2010 4:23:25 PM (14 years ago)
Author:
andreas.kling@nokia.com
Message:

2010-08-20 Andreas Kling <andreas.kling@nokia.com>

Reviewed by Ariya Hidayat.

[Qt] WebKit does not compile with --3d-canvas
https://bugs.webkit.org/show_bug.cgi?id=44335

  • PlatformGLObject => Platform3DObject
  • Implemented getAttachedShaders()
  • Implemented bufferData() and bufferSubData() for ArrayBuffer*
  • Removed reference to nonexistent variable in getImageData()
  • platform/graphics/qt/GraphicsContext3DQt.cpp: (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal): (WebCore::GraphicsContext3D::attachShader): (WebCore::GraphicsContext3D::getAttachedShaders): (WebCore::GraphicsContext3D::bindAttribLocation): (WebCore::GraphicsContext3D::bindBuffer): (WebCore::GraphicsContext3D::bindFramebuffer): (WebCore::GraphicsContext3D::bindRenderbuffer): (WebCore::GraphicsContext3D::bindTexture): (WebCore::GraphicsContext3D::bufferData): (WebCore::GraphicsContext3D::bufferSubData): (WebCore::GraphicsContext3D::compileShader): (WebCore::GraphicsContext3D::detachShader): (WebCore::GraphicsContext3D::framebufferRenderbuffer): (WebCore::GraphicsContext3D::framebufferTexture2D): (WebCore::GraphicsContext3D::getActiveAttrib): (WebCore::GraphicsContext3D::getActiveUniform): (WebCore::GraphicsContext3D::getAttribLocation): (WebCore::GraphicsContext3D::isBuffer): (WebCore::GraphicsContext3D::isFramebuffer): (WebCore::GraphicsContext3D::isProgram): (WebCore::GraphicsContext3D::isRenderbuffer): (WebCore::GraphicsContext3D::isShader): (WebCore::GraphicsContext3D::isTexture): (WebCore::GraphicsContext3D::linkProgram): (WebCore::GraphicsContext3D::shaderSource): (WebCore::GraphicsContext3D::useProgram): (WebCore::GraphicsContext3D::validateProgram): (WebCore::GraphicsContext3D::getProgramiv): (WebCore::GraphicsContext3D::getProgramInfoLog): (WebCore::GraphicsContext3D::getShaderiv): (WebCore::GraphicsContext3D::getShaderInfoLog): (WebCore::GraphicsContext3D::getShaderSource): (WebCore::GraphicsContext3D::getUniformfv): (WebCore::GraphicsContext3D::getUniformiv): (WebCore::GraphicsContext3D::getUniformLocation): (WebCore::GraphicsContext3D::getImageData):
  • platform/graphics/qt/GraphicsLayerQt.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r65760 r65761  
     12010-08-20  Andreas Kling  <andreas.kling@nokia.com>
     2
     3        Reviewed by Ariya Hidayat.
     4
     5        [Qt] WebKit does not compile with --3d-canvas
     6        https://bugs.webkit.org/show_bug.cgi?id=44335
     7
     8        - PlatformGLObject => Platform3DObject
     9        - Implemented getAttachedShaders()
     10        - Implemented bufferData() and bufferSubData() for ArrayBuffer*
     11        - Removed reference to nonexistent variable in getImageData()
     12
     13        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     14        (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
     15        (WebCore::GraphicsContext3D::attachShader):
     16        (WebCore::GraphicsContext3D::getAttachedShaders):
     17        (WebCore::GraphicsContext3D::bindAttribLocation):
     18        (WebCore::GraphicsContext3D::bindBuffer):
     19        (WebCore::GraphicsContext3D::bindFramebuffer):
     20        (WebCore::GraphicsContext3D::bindRenderbuffer):
     21        (WebCore::GraphicsContext3D::bindTexture):
     22        (WebCore::GraphicsContext3D::bufferData):
     23        (WebCore::GraphicsContext3D::bufferSubData):
     24        (WebCore::GraphicsContext3D::compileShader):
     25        (WebCore::GraphicsContext3D::detachShader):
     26        (WebCore::GraphicsContext3D::framebufferRenderbuffer):
     27        (WebCore::GraphicsContext3D::framebufferTexture2D):
     28        (WebCore::GraphicsContext3D::getActiveAttrib):
     29        (WebCore::GraphicsContext3D::getActiveUniform):
     30        (WebCore::GraphicsContext3D::getAttribLocation):
     31        (WebCore::GraphicsContext3D::isBuffer):
     32        (WebCore::GraphicsContext3D::isFramebuffer):
     33        (WebCore::GraphicsContext3D::isProgram):
     34        (WebCore::GraphicsContext3D::isRenderbuffer):
     35        (WebCore::GraphicsContext3D::isShader):
     36        (WebCore::GraphicsContext3D::isTexture):
     37        (WebCore::GraphicsContext3D::linkProgram):
     38        (WebCore::GraphicsContext3D::shaderSource):
     39        (WebCore::GraphicsContext3D::useProgram):
     40        (WebCore::GraphicsContext3D::validateProgram):
     41        (WebCore::GraphicsContext3D::getProgramiv):
     42        (WebCore::GraphicsContext3D::getProgramInfoLog):
     43        (WebCore::GraphicsContext3D::getShaderiv):
     44        (WebCore::GraphicsContext3D::getShaderInfoLog):
     45        (WebCore::GraphicsContext3D::getShaderSource):
     46        (WebCore::GraphicsContext3D::getUniformfv):
     47        (WebCore::GraphicsContext3D::getUniformiv):
     48        (WebCore::GraphicsContext3D::getUniformLocation):
     49        (WebCore::GraphicsContext3D::getImageData):
     50        * platform/graphics/qt/GraphicsLayerQt.h:
     51
    1522010-08-20  Dan Bernstein  <mitz@apple.com>
    253
  • trunk/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r65449 r65761  
    9090typedef void (APIENTRY* glGetActiveAttribType) (GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
    9191typedef void (APIENTRY* glGetActiveUniformType) (GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
     92typedef void (APIENTRY* glGetAttachedShadersType) (GLuint, GLsizei, GLsizei*, GLuint*);
    9293typedef GLint (APIENTRY* glGetAttribLocationType) (GLuint, const char*);
    9394typedef void (APIENTRY* glGetBufferParameterivType) (GLenum, GLenum, GLint*);
     
    188189    glGetActiveAttribType getActiveAttrib;
    189190    glGetActiveUniformType getActiveUniform;
     191    glGetAttachedShadersType getAttachedShaders;
    190192    glGetAttribLocationType getAttribLocation;
    191193    glGetBufferParameterivType getBufferParameteriv;
     
    350352    getActiveAttrib = GET_PROC_ADDRESS(glGetActiveAttrib);
    351353    getActiveUniform = GET_PROC_ADDRESS(glGetActiveUniform);
     354    getAttachedShaders = GET_PROC_ADDRESS(glGetAttachedShaders);
    352355    getAttribLocation = GET_PROC_ADDRESS(glGetAttribLocation);
    353356    getBufferParameteriv = GET_PROC_ADDRESS(glGetBufferParameteriv);
     
    583586}
    584587
    585 void GraphicsContext3D::attachShader(PlatformGLObject program, PlatformGLObject shader)
     588void GraphicsContext3D::attachShader(Platform3DObject program, Platform3DObject shader)
    586589{
    587590    ASSERT(program);
     
    591594}
    592595
    593 void GraphicsContext3D::bindAttribLocation(PlatformGLObject program, unsigned long index, const String& name)
     596void GraphicsContext3D::getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders)
     597{
     598    if (!program) {
     599        synthesizeGLError(INVALID_VALUE);
     600        return;
     601    }
     602
     603    m_internal->m_glWidget->makeCurrent();
     604    getAttachedShaders((GLuint) program, maxCount, count, shaders);
     605}
     606
     607void GraphicsContext3D::bindAttribLocation(Platform3DObject program, unsigned long index, const String& name)
    594608{
    595609    ASSERT(program);
     
    598612}
    599613
    600 void GraphicsContext3D::bindBuffer(unsigned long target, PlatformGLObject buffer)
    601 {
    602     m_internal->m_glWidget->makeCurrent();
    603     m_internal->bindBuffer(target, (GLuint) buffer->object());
    604 }
    605 
    606 void GraphicsContext3D::bindFramebuffer(unsigned long target, PlatformGLObject buffer)
     614void GraphicsContext3D::bindBuffer(unsigned long target, Platform3DObject buffer)
     615{
     616    m_internal->m_glWidget->makeCurrent();
     617    m_internal->bindBuffer(target, (GLuint) buffer);
     618}
     619
     620void GraphicsContext3D::bindFramebuffer(unsigned long target, Platform3DObject buffer)
    607621{
    608622    m_internal->m_glWidget->makeCurrent();
     
    611625}
    612626
    613 void GraphicsContext3D::bindRenderbuffer(unsigned long target, PlatformGLObject renderbuffer)
     627void GraphicsContext3D::bindRenderbuffer(unsigned long target, Platform3DObject renderbuffer)
    614628{
    615629    m_internal->m_glWidget->makeCurrent();
     
    617631}
    618632
    619 void GraphicsContext3D::bindTexture(unsigned long target, PlatformGLObject texture)
     633void GraphicsContext3D::bindTexture(unsigned long target, Platform3DObject texture)
    620634{
    621635    m_internal->m_glWidget->makeCurrent();
     
    657671    m_internal->m_glWidget->makeCurrent();
    658672    m_internal->bufferData(target, size, /* data */ 0, usage);
     673}
     674
     675void GraphicsContext3D::bufferData(unsigned long target, ArrayBuffer* array, unsigned long usage)
     676{
     677    if (!array || !array->byteLength())
     678        return;
     679
     680    m_internal->m_glWidget->makeCurrent();
     681    m_internal->bufferData(target, array->byteLength(), array->data(), usage);
    659682}
    660683
     
    666689    m_internal->m_glWidget->makeCurrent();
    667690    m_internal->bufferData(target, array->byteLength(), array->baseAddress(), usage);
     691}
     692
     693void GraphicsContext3D::bufferSubData(unsigned long target, long offset, ArrayBuffer* array)
     694{
     695    if (!array || !array->byteLength())
     696        return;
     697
     698    m_internal->m_glWidget->makeCurrent();
     699    m_internal->bufferSubData(target, offset, array->byteLength(), array->data());
    668700}
    669701
     
    717749}
    718750
    719 void GraphicsContext3D::compileShader(PlatformGLObject shader)
     751void GraphicsContext3D::compileShader(Platform3DObject shader)
    720752{
    721753    ASSERT(shader);
     
    764796}
    765797
    766 void GraphicsContext3D::detachShader(PlatformGLObject program, PlatformGLObject shader)
     798void GraphicsContext3D::detachShader(Platform3DObject program, Platform3DObject shader)
    767799{
    768800    ASSERT(program);
     
    820852}
    821853
    822 void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, PlatformGLObject buffer)
     854void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject buffer)
    823855{
    824856    m_internal->m_glWidget->makeCurrent();
     
    826858}
    827859
    828 void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, PlatformGLObject texture, long level)
     860void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject texture, long level)
    829861{
    830862    m_internal->m_glWidget->makeCurrent();
     
    844876}
    845877
    846 bool GraphicsContext3D::getActiveAttrib(PlatformGLObject program, unsigned long index, ActiveInfo& info)
     878bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo& info)
    847879{
    848880    if (!program) {
     
    876908}
    877909   
    878 bool GraphicsContext3D::getActiveUniform(PlatformGLObject program, unsigned long index, ActiveInfo& info)
     910bool GraphicsContext3D::getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo& info)
    879911{
    880912    if (!program) {
     
    908940}
    909941
    910 int GraphicsContext3D::getAttribLocation(PlatformGLObject program, const String& name)
     942int GraphicsContext3D::getAttribLocation(Platform3DObject program, const String& name)
    911943{
    912944    if (!program)
     
    947979}
    948980
    949 bool GraphicsContext3D::isBuffer(PlatformGLObject buffer)
     981bool GraphicsContext3D::isBuffer(Platform3DObject buffer)
    950982{
    951983    if (!buffer)
     
    962994}
    963995
    964 bool GraphicsContext3D::isFramebuffer(PlatformGLObject framebuffer)
     996bool GraphicsContext3D::isFramebuffer(Platform3DObject framebuffer)
    965997{
    966998    if (!framebuffer)
     
    9711003}
    9721004
    973 bool GraphicsContext3D::isProgram(PlatformGLObject program)
     1005bool GraphicsContext3D::isProgram(Platform3DObject program)
    9741006{
    9751007    if (!program)
     
    9801012}
    9811013
    982 bool GraphicsContext3D::isRenderbuffer(PlatformGLObject renderbuffer)
     1014bool GraphicsContext3D::isRenderbuffer(Platform3DObject renderbuffer)
    9831015{
    9841016    if (!renderbuffer)
     
    9891021}
    9901022
    991 bool GraphicsContext3D::isShader(PlatformGLObject shader)
     1023bool GraphicsContext3D::isShader(Platform3DObject shader)
    9921024{
    9931025    if (!shader)
     
    9981030}
    9991031
    1000 bool GraphicsContext3D::isTexture(PlatformGLObject texture)
     1032bool GraphicsContext3D::isTexture(Platform3DObject texture)
    10011033{
    10021034    if (!texture)
     
    10131045}
    10141046
    1015 void GraphicsContext3D::linkProgram(PlatformGLObject program)
     1047void GraphicsContext3D::linkProgram(Platform3DObject program)
    10161048{
    10171049    ASSERT(program);
     
    10661098}
    10671099
    1068 void GraphicsContext3D::shaderSource(PlatformGLObject shader, const String& source)
     1100void GraphicsContext3D::shaderSource(Platform3DObject shader, const String& source)
    10691101{
    10701102    ASSERT(shader);
     
    12481280}
    12491281
    1250 void GraphicsContext3D::useProgram(PlatformGLObject program)
     1282void GraphicsContext3D::useProgram(Platform3DObject program)
    12511283{
    12521284    ASSERT(program);
     
    12561288}
    12571289
    1258 void GraphicsContext3D::validateProgram(PlatformGLObject program)
     1290void GraphicsContext3D::validateProgram(Platform3DObject program)
    12591291{
    12601292    ASSERT(program);
     
    13541386}
    13551387
    1356 void GraphicsContext3D::getProgramiv(PlatformGLObject program, unsigned long paramName, int* value)
     1388void GraphicsContext3D::getProgramiv(Platform3DObject program, unsigned long paramName, int* value)
    13571389{
    13581390    m_internal->m_glWidget->makeCurrent();
     
    13601392}
    13611393
    1362 String GraphicsContext3D::getProgramInfoLog(PlatformGLObject program)
     1394String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
    13631395{
    13641396    m_internal->m_glWidget->makeCurrent();
     
    13871419}
    13881420
    1389 void GraphicsContext3D::getShaderiv(PlatformGLObject shader, unsigned long paramName, int* value)
     1421void GraphicsContext3D::getShaderiv(Platform3DObject shader, unsigned long paramName, int* value)
    13901422{
    13911423    ASSERT(shader);
     
    13941426}
    13951427
    1396 String GraphicsContext3D::getShaderInfoLog(PlatformGLObject shader)
     1428String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
    13971429{
    13981430    m_internal->m_glWidget->makeCurrent();
     
    14141446}
    14151447
    1416 String GraphicsContext3D::getShaderSource(PlatformGLObject shader)
     1448String GraphicsContext3D::getShaderSource(Platform3DObject shader)
    14171449{
    14181450    m_internal->m_glWidget->makeCurrent();
     
    14461478}
    14471479
    1448 void GraphicsContext3D::getUniformfv(PlatformGLObject program, long location, float* value)
     1480void GraphicsContext3D::getUniformfv(Platform3DObject program, long location, float* value)
    14491481{
    14501482    m_internal->m_glWidget->makeCurrent();
     
    14521484}
    14531485
    1454 void GraphicsContext3D::getUniformiv(PlatformGLObject program, long location, int* value)
     1486void GraphicsContext3D::getUniformiv(Platform3DObject program, long location, int* value)
    14551487{
    14561488    m_internal->m_glWidget->makeCurrent();
     
    14581490}
    14591491
    1460 long GraphicsContext3D::getUniformLocation(PlatformGLObject program, const String& name)
     1492long GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
    14611493{
    14621494    ASSERT(program);
     
    16221654
    16231655    AlphaOp neededAlphaOp = kAlphaDoNothing;
    1624     if (!premultiplyAlpha && *hasAlphaChannel)
     1656    if (!premultiplyAlpha)
    16251657        // FIXME: must fetch the image data before the premultiplication step
    16261658        neededAlphaOp = kAlphaDoUnmultiply;
  • trunk/WebCore/platform/graphics/qt/GraphicsLayerQt.h

    r63001 r65761  
    2121#define GraphicsLayerQt_h
    2222
     23#if ENABLE(3D_CANVAS)
     24#include "GraphicsContext3D.h"
     25#endif
    2326#include "GraphicsLayer.h"
    2427#include "GraphicsLayerClient.h"
Note: See TracChangeset for help on using the changeset viewer.