Changeset 76876 in webkit


Ignore:
Timestamp:
Jan 27, 2011 5:29:16 PM (13 years ago)
Author:
zmo@google.com
Message:

2011-01-27 Zhenyao Mo <zmo@google.com>

Reviewed by Kenneth Russell.

Define GC3D types to match GL types and use them in WebGraphicsContext3D
https://bugs.webkit.org/show_bug.cgi?id=51947

  • public/WebGraphicsContext3D.h:
Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r76863 r76876  
     12011-01-27  Zhenyao Mo  <zmo@google.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Define GC3D types to match GL types and use them in WebGraphicsContext3D
     6        https://bugs.webkit.org/show_bug.cgi?id=51947
     7
     8        * public/WebGraphicsContext3D.h:
     9
    1102011-01-27  Zhenyao Mo  <zmo@google.com>
    211
  • trunk/Source/WebKit/chromium/public/WebGraphicsContext3D.h

    r76862 r76876  
    3636#include "WebString.h"
    3737
     38#define USE_WGC3D_TYPES
     39
    3840namespace WebKit {
    3941
     42// WGC3D types match the corresponding GL types as defined in OpenGL ES 2.0
     43// header file gl2.h from khronos.org.
     44typedef char WGC3Dchar;
     45typedef unsigned int WGC3Denum;
     46typedef unsigned char WGC3Dboolean;
     47typedef unsigned int WGC3Dbitfield;
     48typedef signed char WGC3Dbyte;
     49typedef unsigned char WGC3Dubyte;
     50typedef short WGC3Dshort;
     51typedef unsigned short WGC3Dushort;
     52typedef int WGC3Dint;
     53typedef int WGC3Dsizei;
     54typedef unsigned int WGC3Duint;
     55typedef float WGC3Dfloat;
     56typedef float WGC3Dclampf;
     57typedef signed long int WGC3Dintptr;
     58typedef signed long int WGC3Dsizeiptr;
     59
    4060// Typedef for server-side objects like OpenGL textures and program objects.
    41 typedef unsigned int WebGLId;
     61typedef WGC3Duint WebGLId;
    4262
    4363class WebView;
     
    5373    struct ActiveInfo {
    5474        WebString name;
    55         unsigned type;
    56         int size;
     75        WGC3Denum type;
     76        WGC3Dint size;
    5777    };
    5878
     
    98118    virtual int height() = 0;
    99119
    100     // Helper to return the size in bytes of OpenGL data types
    101     // like GL_FLOAT, GL_INT, etc.
    102     virtual int sizeInBytes(int type) = 0;
    103 
    104120    // Resizes the region into which this WebGraphicsContext3D is drawing.
    105121    virtual void reshape(int width, int height) = 0;
     
    117133    // the framebuffer associated with this context. This texture is accessible
    118134    // by the gpu-based page compositor.
    119     virtual unsigned getPlatformTextureId() = 0;
     135    virtual WebGLId getPlatformTextureId() = 0;
    120136
    121137    // Copies the contents of the off-screen render target used by the WebGL
     
    131147    // instance of any given error, and returns them from calls to
    132148    // getError in the order they were added.
    133     virtual void synthesizeGLError(unsigned long error) = 0;
     149    virtual void synthesizeGLError(WGC3Denum) = 0;
     150
     151    virtual bool isContextLost() = 0;
    134152
    135153    // GL_CHROMIUM_map_sub
    136     virtual void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access) = 0;
     154    virtual void* mapBufferSubDataCHROMIUM(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeiptr size, WGC3Denum access) = 0;
    137155    virtual void unmapBufferSubDataCHROMIUM(const void*) = 0;
    138     virtual void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access) = 0;
     156    virtual void* mapTexSubImage2DCHROMIUM(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, WGC3Denum access) = 0;
    139157    virtual void unmapTexSubImage2DCHROMIUM(const void*) = 0;
    140158
    141159    // GL_CHROMIUM_copy_texture_to_parent_texture
    142     virtual void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture) = 0;
     160    virtual void copyTextureToParentTextureCHROMIUM(WebGLId texture, WebGLId parentTexture) = 0;
    143161
    144162    // GL_CHROMIUM_request_extension
     
    147165
    148166    // GL_CHROMIUM_framebuffer_multisample
    149     virtual void blitFramebufferCHROMIUM(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, unsigned mask, unsigned filter) = 0;
    150     virtual void renderbufferStorageMultisampleCHROMIUM(unsigned long target, int samples, unsigned internalformat, unsigned width, unsigned height) = 0;
     167    virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, WGC3Dbitfield mask, WGC3Denum filter) = 0;
     168    virtual void renderbufferStorageMultisampleCHROMIUM(WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) = 0;
    151169
    152170    // The entry points below map directly to the OpenGL ES 2.0 API.
    153171    // See: http://www.khronos.org/registry/gles/
    154172    // and: http://www.khronos.org/opengles/sdk/docs/man/
    155     virtual void activeTexture(unsigned long texture) = 0;
     173    virtual void activeTexture(WGC3Denum texture) = 0;
    156174    virtual void attachShader(WebGLId program, WebGLId shader) = 0;
    157     virtual void bindAttribLocation(WebGLId program, unsigned long index, const char* name) = 0;
    158     virtual void bindBuffer(unsigned long target, WebGLId buffer) = 0;
    159     virtual void bindFramebuffer(unsigned long target, WebGLId framebuffer) = 0;
    160     virtual void bindRenderbuffer(unsigned long target, WebGLId renderbuffer) = 0;
    161     virtual void bindTexture(unsigned long target, WebGLId texture) = 0;
    162     virtual void blendColor(double red, double green, double blue, double alpha) = 0;
    163     virtual void blendEquation(unsigned long mode) = 0;
    164     virtual void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha) = 0;
    165     virtual void blendFunc(unsigned long sfactor, unsigned long dfactor) = 0;
    166     virtual void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha) = 0;
    167 
    168     virtual void bufferData(unsigned long target, int size, const void* data, unsigned long usage) = 0;
    169     virtual void bufferSubData(unsigned long target, long offset, int size, const void* data) = 0;
    170 
    171     virtual unsigned long checkFramebufferStatus(unsigned long target) = 0;
    172     virtual void clear(unsigned long mask) = 0;
    173     virtual void clearColor(double red, double green, double blue, double alpha) = 0;
    174     virtual void clearDepth(double depth) = 0;
    175     virtual void clearStencil(long s) = 0;
    176     virtual void colorMask(bool red, bool green, bool blue, bool alpha) = 0;
     175    virtual void bindAttribLocation(WebGLId program, WGC3Duint index, const WGC3Dchar* name) = 0;
     176    virtual void bindBuffer(WGC3Denum target, WebGLId buffer) = 0;
     177    virtual void bindFramebuffer(WGC3Denum target, WebGLId framebuffer) = 0;
     178    virtual void bindRenderbuffer(WGC3Denum target, WebGLId renderbuffer) = 0;
     179    virtual void bindTexture(WGC3Denum target, WebGLId texture) = 0;
     180    virtual void blendColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue, WGC3Dclampf alpha) = 0;
     181    virtual void blendEquation(WGC3Denum mode) = 0;
     182    virtual void blendEquationSeparate(WGC3Denum modeRGB, WGC3Denum modeAlpha) = 0;
     183    virtual void blendFunc(WGC3Denum sfactor, WGC3Denum dfactor) = 0;
     184    virtual void blendFuncSeparate(WGC3Denum srcRGB, WGC3Denum dstRGB, WGC3Denum srcAlpha, WGC3Denum dstAlpha) = 0;
     185
     186    virtual void bufferData(WGC3Denum target, WGC3Dsizeiptr size, const void* data, WGC3Denum usage) = 0;
     187    virtual void bufferSubData(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeiptr size, const void* data) = 0;
     188
     189    virtual WGC3Denum checkFramebufferStatus(WGC3Denum target) = 0;
     190    virtual void clear(WGC3Dbitfield mask) = 0;
     191    virtual void clearColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue, WGC3Dclampf alpha) = 0;
     192    virtual void clearDepth(WGC3Dclampf depth) = 0;
     193    virtual void clearStencil(WGC3Dint s) = 0;
     194    virtual void colorMask(WGC3Dboolean red, WGC3Dboolean green, WGC3Dboolean blue, WGC3Dboolean alpha) = 0;
    177195    virtual void compileShader(WebGLId shader) = 0;
    178196
    179     virtual void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border) = 0;
    180     virtual void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height) = 0;
    181     virtual void cullFace(unsigned long mode) = 0;
    182     virtual void depthFunc(unsigned long func) = 0;
    183     virtual void depthMask(bool flag) = 0;
    184     virtual void depthRange(double zNear, double zFar) = 0;
     197    virtual void copyTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border) = 0;
     198    virtual void copyTexSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) = 0;
     199    virtual void cullFace(WGC3Denum mode) = 0;
     200    virtual void depthFunc(WGC3Denum func) = 0;
     201    virtual void depthMask(WGC3Dboolean flag) = 0;
     202    virtual void depthRange(WGC3Dclampf zNear, WGC3Dclampf zFar) = 0;
    185203    virtual void detachShader(WebGLId program, WebGLId shader) = 0;
    186     virtual void disable(unsigned long cap) = 0;
    187     virtual void disableVertexAttribArray(unsigned long index) = 0;
    188     virtual void drawArrays(unsigned long mode, long first, long count) = 0;
    189     virtual void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset) = 0;
    190 
    191     virtual void enable(unsigned long cap) = 0;
    192     virtual void enableVertexAttribArray(unsigned long index) = 0;
     204    virtual void disable(WGC3Denum cap) = 0;
     205    virtual void disableVertexAttribArray(WGC3Duint index) = 0;
     206    virtual void drawArrays(WGC3Denum mode, WGC3Dint first, WGC3Dsizei count) = 0;
     207    virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type, WGC3Dintptr offset) = 0;
     208
     209    virtual void enable(WGC3Denum cap) = 0;
     210    virtual void enableVertexAttribArray(WGC3Duint index) = 0;
    193211    virtual void finish() = 0;
    194212    virtual void flush() = 0;
    195     virtual void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLId renderbuffer) = 0;
    196     virtual void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLId texture, long level) = 0;
    197     virtual void frontFace(unsigned long mode) = 0;
    198     virtual void generateMipmap(unsigned long target) = 0;
    199 
    200     virtual bool getActiveAttrib(WebGLId program, unsigned long index, ActiveInfo&) = 0;
    201     virtual bool getActiveUniform(WebGLId program, unsigned long index, ActiveInfo&) = 0;
    202 
    203     virtual void getAttachedShaders(WebGLId program, int maxCount, int* count, unsigned int* shaders) = 0;
    204 
    205     virtual int  getAttribLocation(WebGLId program, const char* name) = 0;
    206 
    207     virtual void getBooleanv(unsigned long pname, unsigned char* value) = 0;
    208 
    209     virtual void getBufferParameteriv(unsigned long target, unsigned long pname, int* value) = 0;
    210 
     213    virtual void framebufferRenderbuffer(WGC3Denum target, WGC3Denum attachment, WGC3Denum renderbuffertarget, WebGLId renderbuffer) = 0;
     214    virtual void framebufferTexture2D(WGC3Denum target, WGC3Denum attachment, WGC3Denum textarget, WebGLId texture, WGC3Dint level) = 0;
     215    virtual void frontFace(WGC3Denum mode) = 0;
     216    virtual void generateMipmap(WGC3Denum target) = 0;
     217
     218    virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&) = 0;
     219    virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&) = 0;
     220    virtual void getAttachedShaders(WebGLId program, WGC3Dsizei maxCount, WGC3Dsizei* count, WebGLId* shaders) = 0;
     221    virtual WGC3Dint getAttribLocation(WebGLId program, const WGC3Dchar* name) = 0;
     222    virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) = 0;
     223    virtual void getBufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) = 0;
    211224    virtual Attributes getContextAttributes() = 0;
    212 
    213     virtual unsigned long getError() = 0;
    214 
    215     virtual bool isContextLost() = 0;
    216 
    217     virtual void getFloatv(unsigned long pname, float* value) = 0;
    218 
    219     virtual void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value) = 0;
    220 
    221     virtual void getIntegerv(unsigned long pname, int* value) = 0;
    222 
    223     virtual void getProgramiv(WebGLId program, unsigned long pname, int* value) = 0;
    224 
     225    virtual WGC3Denum getError() = 0;
     226    virtual void getFloatv(WGC3Denum pname, WGC3Dfloat* value) = 0;
     227    virtual void getFramebufferAttachmentParameteriv(WGC3Denum target, WGC3Denum attachment, WGC3Denum pname, WGC3Dint* value) = 0;
     228    virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value) = 0;
     229    virtual void getProgramiv(WebGLId program, WGC3Denum pname, WGC3Dint* value) = 0;
    225230    virtual WebString getProgramInfoLog(WebGLId program) = 0;
    226 
    227     virtual void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value) = 0;
    228 
    229     virtual void getShaderiv(WebGLId shader, unsigned long pname, int* value) = 0;
    230 
     231    virtual void getRenderbufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) = 0;
     232    virtual void getShaderiv(WebGLId shader, WGC3Denum pname, WGC3Dint* value) = 0;
    231233    virtual WebString getShaderInfoLog(WebGLId shader) = 0;
    232234
     
    235237
    236238    virtual WebString getShaderSource(WebGLId shader) = 0;
    237     virtual WebString getString(unsigned long name) = 0;
    238 
    239     virtual void getTexParameterfv(unsigned long target, unsigned long pname, float* value) = 0;
    240     virtual void getTexParameteriv(unsigned long target, unsigned long pname, int* value) = 0;
    241 
    242     virtual void getUniformfv(WebGLId program, long location, float* value) = 0;
    243     virtual void getUniformiv(WebGLId program, long location, int* value) = 0;
    244 
    245     virtual long getUniformLocation(WebGLId program, const char* name) = 0;
    246 
    247     virtual void getVertexAttribfv(unsigned long index, unsigned long pname, float* value) = 0;
    248     virtual void getVertexAttribiv(unsigned long index, unsigned long pname, int* value) = 0;
    249 
    250     virtual long getVertexAttribOffset(unsigned long index, unsigned long pname) = 0;
    251 
    252     virtual void hint(unsigned long target, unsigned long mode) = 0;
    253     virtual bool isBuffer(WebGLId buffer) = 0;
    254     virtual bool isEnabled(unsigned long cap) = 0;
    255     virtual bool isFramebuffer(WebGLId framebuffer) = 0;
    256     virtual bool isProgram(WebGLId program) = 0;
    257     virtual bool isRenderbuffer(WebGLId renderbuffer) = 0;
    258     virtual bool isShader(WebGLId shader) = 0;
    259     virtual bool isTexture(WebGLId texture) = 0;
    260     virtual void lineWidth(double) = 0;
     239    virtual WebString getString(WGC3Denum name) = 0;
     240    virtual void getTexParameterfv(WGC3Denum target, WGC3Denum pname, WGC3Dfloat* value) = 0;
     241    virtual void getTexParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) = 0;
     242    virtual void getUniformfv(WebGLId program, WGC3Dint location, WGC3Dfloat* value) = 0;
     243    virtual void getUniformiv(WebGLId program, WGC3Dint location, WGC3Dint* value) = 0;
     244    virtual WGC3Dint getUniformLocation(WebGLId program, const WGC3Dchar* name) = 0;
     245    virtual void getVertexAttribfv(WGC3Duint index, WGC3Denum pname, WGC3Dfloat* value) = 0;
     246    virtual void getVertexAttribiv(WGC3Duint index, WGC3Denum pname, WGC3Dint* value) = 0;
     247    virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname) = 0;
     248
     249    virtual void hint(WGC3Denum target, WGC3Denum mode) = 0;
     250    virtual WGC3Dboolean isBuffer(WebGLId buffer) = 0;
     251    virtual WGC3Dboolean isEnabled(WGC3Denum cap) = 0;
     252    virtual WGC3Dboolean isFramebuffer(WebGLId framebuffer) = 0;
     253    virtual WGC3Dboolean isProgram(WebGLId program) = 0;
     254    virtual WGC3Dboolean isRenderbuffer(WebGLId renderbuffer) = 0;
     255    virtual WGC3Dboolean isShader(WebGLId shader) = 0;
     256    virtual WGC3Dboolean isTexture(WebGLId texture) = 0;
     257    virtual void lineWidth(WGC3Dfloat) = 0;
    261258    virtual void linkProgram(WebGLId program) = 0;
    262     virtual void pixelStorei(unsigned long pname, long param) = 0;
    263     virtual void polygonOffset(double factor, double units) = 0;
    264 
    265     virtual void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* pixels) = 0;
     259    virtual void pixelStorei(WGC3Denum pname, WGC3Dint param) = 0;
     260    virtual void polygonOffset(WGC3Dfloat factor, WGC3Dfloat units) = 0;
     261
     262    virtual void readPixels(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, void* pixels) = 0;
    266263
    267264    virtual void releaseShaderCompiler() = 0;
    268     virtual void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height) = 0;
    269     virtual void sampleCoverage(double value, bool invert) = 0;
    270     virtual void scissor(long x, long y, unsigned long width, unsigned long height) = 0;
    271     virtual void shaderSource(WebGLId shader, const char* string) = 0;
    272     virtual void stencilFunc(unsigned long func, long ref, unsigned long mask) = 0;
    273     virtual void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask) = 0;
    274     virtual void stencilMask(unsigned long mask) = 0;
    275     virtual void stencilMaskSeparate(unsigned long face, unsigned long mask) = 0;
    276     virtual void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass) = 0;
    277     virtual void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass) = 0;
    278 
    279     virtual void texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, const void* pixels) = 0;
    280 
    281     virtual void texParameterf(unsigned target, unsigned pname, float param) = 0;
    282     virtual void texParameteri(unsigned target, unsigned pname, int param) = 0;
    283 
    284     virtual void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, const void* pixels) = 0;
    285 
    286     virtual void uniform1f(long location, float x) = 0;
    287     virtual void uniform1fv(long location, int count, float* v) = 0;
    288     virtual void uniform1i(long location, int x) = 0;
    289     virtual void uniform1iv(long location, int count, int* v) = 0;
    290     virtual void uniform2f(long location, float x, float y) = 0;
    291     virtual void uniform2fv(long location, int count, float* v) = 0;
    292     virtual void uniform2i(long location, int x, int y) = 0;
    293     virtual void uniform2iv(long location, int count, int* v) = 0;
    294     virtual void uniform3f(long location, float x, float y, float z) = 0;
    295     virtual void uniform3fv(long location, int count, float* v) = 0;
    296     virtual void uniform3i(long location, int x, int y, int z) = 0;
    297     virtual void uniform3iv(long location, int count, int* v) = 0;
    298     virtual void uniform4f(long location, float x, float y, float z, float w) = 0;
    299     virtual void uniform4fv(long location, int count, float* v) = 0;
    300     virtual void uniform4i(long location, int x, int y, int z, int w) = 0;
    301     virtual void uniform4iv(long location, int count, int* v) = 0;
    302     virtual void uniformMatrix2fv(long location, int count, bool transpose, const float* value) = 0;
    303     virtual void uniformMatrix3fv(long location, int count, bool transpose, const float* value) = 0;
    304     virtual void uniformMatrix4fv(long location, int count, bool transpose, const float* value) = 0;
     265
     266    virtual void renderbufferStorage(WGC3Denum target, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) = 0;
     267    virtual void sampleCoverage(WGC3Dclampf value, WGC3Dboolean invert) = 0;
     268    virtual void scissor(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) = 0;
     269    virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) = 0;
     270    virtual void stencilFunc(WGC3Denum func, WGC3Dint ref, WGC3Duint mask) = 0;
     271    virtual void stencilFuncSeparate(WGC3Denum face, WGC3Denum func, WGC3Dint ref, WGC3Duint mask) = 0;
     272    virtual void stencilMask(WGC3Duint mask) = 0;
     273    virtual void stencilMaskSeparate(WGC3Denum face, WGC3Duint mask) = 0;
     274    virtual void stencilOp(WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) = 0;
     275    virtual void stencilOpSeparate(WGC3Denum face, WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) = 0;
     276
     277    virtual void texImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Denum format, WGC3Denum type, const void* pixels) = 0;
     278
     279    virtual void texParameterf(WGC3Denum target, WGC3Denum pname, WGC3Dfloat param) = 0;
     280    virtual void texParameteri(WGC3Denum target, WGC3Denum pname, WGC3Dint param) = 0;
     281
     282    virtual void texSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, const void* pixels) = 0;
     283
     284    virtual void uniform1f(WGC3Dint location, WGC3Dfloat x) = 0;
     285    virtual void uniform1fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) = 0;
     286    virtual void uniform1i(WGC3Dint location, WGC3Dint x) = 0;
     287    virtual void uniform1iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) = 0;
     288    virtual void uniform2f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y) = 0;
     289    virtual void uniform2fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) = 0;
     290    virtual void uniform2i(WGC3Dint location, WGC3Dint x, WGC3Dint y) = 0;
     291    virtual void uniform2iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) = 0;
     292    virtual void uniform3f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z) = 0;
     293    virtual void uniform3fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) = 0;
     294    virtual void uniform3i(WGC3Dint location, WGC3Dint x, WGC3Dint y, WGC3Dint z) = 0;
     295    virtual void uniform3iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) = 0;
     296    virtual void uniform4f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z, WGC3Dfloat w) = 0;
     297    virtual void uniform4fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) = 0;
     298    virtual void uniform4i(WGC3Dint location, WGC3Dint x, WGC3Dint y, WGC3Dint z, WGC3Dint w) = 0;
     299    virtual void uniform4iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) = 0;
     300    virtual void uniformMatrix2fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) = 0;
     301    virtual void uniformMatrix3fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) = 0;
     302    virtual void uniformMatrix4fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) = 0;
    305303
    306304    virtual void useProgram(WebGLId program) = 0;
    307305    virtual void validateProgram(WebGLId program) = 0;
    308306
    309     virtual void vertexAttrib1f(unsigned long indx, float x) = 0;
    310     virtual void vertexAttrib1fv(unsigned long indx, const float* values) = 0;
    311     virtual void vertexAttrib2f(unsigned long indx, float x, float y) = 0;
    312     virtual void vertexAttrib2fv(unsigned long indx, const float* values) = 0;
    313     virtual void vertexAttrib3f(unsigned long indx, float x, float y, float z) = 0;
    314     virtual void vertexAttrib3fv(unsigned long indx, const float* values) = 0;
    315     virtual void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w) = 0;
    316     virtual void vertexAttrib4fv(unsigned long indx, const float* values) = 0;
    317     virtual void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
    318                                      unsigned long stride, unsigned long offset) = 0;
    319 
    320     virtual void viewport(long x, long y, unsigned long width, unsigned long height) = 0;
     307    virtual void vertexAttrib1f(WGC3Duint index, WGC3Dfloat x) = 0;
     308    virtual void vertexAttrib1fv(WGC3Duint index, const WGC3Dfloat* values) = 0;
     309    virtual void vertexAttrib2f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y) = 0;
     310    virtual void vertexAttrib2fv(WGC3Duint index, const WGC3Dfloat* values) = 0;
     311    virtual void vertexAttrib3f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z) = 0;
     312    virtual void vertexAttrib3fv(WGC3Duint index, const WGC3Dfloat* values) = 0;
     313    virtual void vertexAttrib4f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z, WGC3Dfloat w) = 0;
     314    virtual void vertexAttrib4fv(WGC3Duint index, const WGC3Dfloat* values) = 0;
     315    virtual void vertexAttribPointer(WGC3Duint index, WGC3Dint size, WGC3Denum type, WGC3Dboolean normalized,
     316                                     WGC3Dsizei stride, WGC3Dintptr offset) = 0;
     317
     318    virtual void viewport(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) = 0;
    321319
    322320    // Support for buffer creation and deletion.
    323     virtual unsigned createBuffer() = 0;
    324     virtual unsigned createFramebuffer() = 0;
    325     virtual unsigned createProgram() = 0;
    326     virtual unsigned createRenderbuffer() = 0;
    327     virtual unsigned createShader(unsigned long) = 0;
    328     virtual unsigned createTexture() = 0;
    329 
    330     virtual void deleteBuffer(unsigned) = 0;
    331     virtual void deleteFramebuffer(unsigned) = 0;
    332     virtual void deleteProgram(unsigned) = 0;
    333     virtual void deleteRenderbuffer(unsigned) = 0;
    334     virtual void deleteShader(unsigned) = 0;
    335     virtual void deleteTexture(unsigned) = 0;
     321    virtual WebGLId createBuffer() = 0;
     322    virtual WebGLId createFramebuffer() = 0;
     323    virtual WebGLId createProgram() = 0;
     324    virtual WebGLId createRenderbuffer() = 0;
     325    virtual WebGLId createShader(WGC3Denum) = 0;
     326    virtual WebGLId createTexture() = 0;
     327
     328    virtual void deleteBuffer(WebGLId) = 0;
     329    virtual void deleteFramebuffer(WebGLId) = 0;
     330    virtual void deleteProgram(WebGLId) = 0;
     331    virtual void deleteRenderbuffer(WebGLId) = 0;
     332    virtual void deleteShader(WebGLId) = 0;
     333    virtual void deleteTexture(WebGLId) = 0;
    336334
    337335    virtual void setContextLostCallback(WebGraphicsContextLostCallback* callback) {}
Note: See TracChangeset for help on using the changeset viewer.