diff options
Diffstat (limited to 'cc/test/fake_web_graphics_context_3d.h')
-rw-r--r-- | cc/test/fake_web_graphics_context_3d.h | 394 |
1 files changed, 190 insertions, 204 deletions
diff --git a/cc/test/fake_web_graphics_context_3d.h b/cc/test/fake_web_graphics_context_3d.h index bb8e893..8ef6cb97 100644 --- a/cc/test/fake_web_graphics_context_3d.h +++ b/cc/test/fake_web_graphics_context_3d.h @@ -8,253 +8,239 @@ #include "third_party/khronos/GLES2/gl2.h" #include <public/WebGraphicsContext3D.h> -namespace WebKit { +namespace cc { // WebGraphicsContext3D base class for use in WebKit unit tests. // All operations are no-ops (returning 0 if necessary). -class FakeWebGraphicsContext3D : public WebGraphicsContext3D { +class FakeWebGraphicsContext3D : public WebKit::WebGraphicsContext3D { public: FakeWebGraphicsContext3D() : m_nextTextureId(1) { } - virtual bool makeContextCurrent() { return true; } + virtual bool makeContextCurrent(); - virtual int width() { return 0; } - virtual int height() { return 0; } + virtual int width(); + virtual int height(); virtual void reshape(int width, int height) { } - virtual bool isGLES2Compliant() { return false; } + virtual bool isGLES2Compliant(); - virtual bool readBackFramebuffer(unsigned char* pixels, size_t bufferSize, WebGLId framebuffer, int width, int height) { return false; } + virtual bool readBackFramebuffer(unsigned char* pixels, size_t bufferSize, WebKit::WebGLId framebuffer, int width, int height); - virtual WebGLId getPlatformTextureId() { return 0; } + virtual WebKit::WebGLId getPlatformTextureId(); virtual void prepareTexture() { } virtual void postSubBufferCHROMIUM(int x, int y, int width, int height) { } - virtual void synthesizeGLError(WGC3Denum) { } + virtual void synthesizeGLError(WebKit::WGC3Denum) { } - virtual bool isContextLost() { return false; } + virtual bool isContextLost(); + + virtual void* mapBufferSubDataCHROMIUM(WebKit::WGC3Denum target, WebKit::WGC3Dintptr offset, WebKit::WGC3Dsizeiptr size, WebKit::WGC3Denum access); - virtual void* mapBufferSubDataCHROMIUM(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeiptr size, WGC3Denum access) { return 0; } virtual void unmapBufferSubDataCHROMIUM(const void*) { } - virtual void* mapTexSubImage2DCHROMIUM(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, WGC3Denum access) { return 0; } + virtual void* mapTexSubImage2DCHROMIUM(WebKit::WGC3Denum target, WebKit::WGC3Dint level, WebKit::WGC3Dint xoffset, WebKit::WGC3Dint yoffset, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height, WebKit::WGC3Denum format, WebKit::WGC3Denum type, WebKit::WGC3Denum access); virtual void unmapTexSubImage2DCHROMIUM(const void*) { } virtual void setVisibilityCHROMIUM(bool visible) { } - virtual void discardFramebufferEXT(WGC3Denum target, WGC3Dsizei numAttachments, const WGC3Denum* attachments) { } + virtual void discardFramebufferEXT(WebKit::WGC3Denum target, WebKit::WGC3Dsizei numAttachments, const WebKit::WGC3Denum* attachments) { } virtual void ensureFramebufferCHROMIUM() { } virtual void setMemoryAllocationChangedCallbackCHROMIUM(WebGraphicsMemoryAllocationChangedCallbackCHROMIUM* callback) { } - virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); } + virtual WebKit::WebString getRequestableExtensionsCHROMIUM(); virtual void requestExtensionCHROMIUM(const char*) { } - virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, WGC3Dbitfield mask, WGC3Denum filter) { } - virtual void renderbufferStorageMultisampleCHROMIUM(WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { } - - virtual void activeTexture(WGC3Denum texture) { } - virtual void attachShader(WebGLId program, WebGLId shader) { } - virtual void bindAttribLocation(WebGLId program, WGC3Duint index, const WGC3Dchar* name) { } - virtual void bindBuffer(WGC3Denum target, WebGLId buffer) { } - virtual void bindFramebuffer(WGC3Denum target, WebGLId framebuffer) { } - virtual void bindRenderbuffer(WGC3Denum target, WebGLId renderbuffer) { } - virtual void bindTexture(WGC3Denum target, WebGLId texture) { } - virtual void blendColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue, WGC3Dclampf alpha) { } - virtual void blendEquation(WGC3Denum mode) { } - virtual void blendEquationSeparate(WGC3Denum modeRGB, WGC3Denum modeAlpha) { } - virtual void blendFunc(WGC3Denum sfactor, WGC3Denum dfactor) { } - virtual void blendFuncSeparate(WGC3Denum srcRGB, WGC3Denum dstRGB, WGC3Denum srcAlpha, WGC3Denum dstAlpha) { } - - virtual void bufferData(WGC3Denum target, WGC3Dsizeiptr size, const void* data, WGC3Denum usage) { } - virtual void bufferSubData(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeiptr size, const void* data) { } - - virtual WGC3Denum checkFramebufferStatus(WGC3Denum target) - { - return GL_FRAMEBUFFER_COMPLETE; - } - - virtual void clear(WGC3Dbitfield mask) { } - virtual void clearColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue, WGC3Dclampf alpha) { } - virtual void clearDepth(WGC3Dclampf depth) { } - virtual void clearStencil(WGC3Dint s) { } - virtual void colorMask(WGC3Dboolean red, WGC3Dboolean green, WGC3Dboolean blue, WGC3Dboolean alpha) { } - virtual void compileShader(WebGLId shader) { } - - virtual void compressedTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Dsizei imageSize, const void* data) { } - virtual void compressedTexSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Dsizei imageSize, const void* data) { } - virtual void copyTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border) { } - virtual void copyTexSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) { } - virtual void cullFace(WGC3Denum mode) { } - virtual void depthFunc(WGC3Denum func) { } - virtual void depthMask(WGC3Dboolean flag) { } - virtual void depthRange(WGC3Dclampf zNear, WGC3Dclampf zFar) { } - virtual void detachShader(WebGLId program, WebGLId shader) { } - virtual void disable(WGC3Denum cap) { } - virtual void disableVertexAttribArray(WGC3Duint index) { } - virtual void drawArrays(WGC3Denum mode, WGC3Dint first, WGC3Dsizei count) { } - virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type, WGC3Dintptr offset) { } - - virtual void enable(WGC3Denum cap) { } - virtual void enableVertexAttribArray(WGC3Duint index) { } + virtual void blitFramebufferCHROMIUM(WebKit::WGC3Dint srcX0, WebKit::WGC3Dint srcY0, WebKit::WGC3Dint srcX1, WebKit::WGC3Dint srcY1, WebKit::WGC3Dint dstX0, WebKit::WGC3Dint dstY0, WebKit::WGC3Dint dstX1, WebKit::WGC3Dint dstY1, WebKit::WGC3Dbitfield mask, WebKit::WGC3Denum filter) { } + virtual void renderbufferStorageMultisampleCHROMIUM(WebKit::WGC3Denum target, WebKit::WGC3Dsizei samples, WebKit::WGC3Denum internalformat, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height) { } + + virtual void activeTexture(WebKit::WGC3Denum texture) { } + virtual void attachShader(WebKit::WebGLId program, WebKit::WebGLId shader) { } + virtual void bindAttribLocation(WebKit::WebGLId program, WebKit::WGC3Duint index, const WebKit::WGC3Dchar* name) { } + virtual void bindBuffer(WebKit::WGC3Denum target, WebKit::WebGLId buffer) { } + virtual void bindFramebuffer(WebKit::WGC3Denum target, WebKit::WebGLId framebuffer) { } + virtual void bindRenderbuffer(WebKit::WGC3Denum target, WebKit::WebGLId renderbuffer) { } + virtual void bindTexture(WebKit::WGC3Denum target, WebKit::WebGLId texture) { } + virtual void blendColor(WebKit::WGC3Dclampf red, WebKit::WGC3Dclampf green, WebKit::WGC3Dclampf blue, WebKit::WGC3Dclampf alpha) { } + virtual void blendEquation(WebKit::WGC3Denum mode) { } + virtual void blendEquationSeparate(WebKit::WGC3Denum modeRGB, WebKit::WGC3Denum modeAlpha) { } + virtual void blendFunc(WebKit::WGC3Denum sfactor, WebKit::WGC3Denum dfactor) { } + virtual void blendFuncSeparate(WebKit::WGC3Denum srcRGB, WebKit::WGC3Denum dstRGB, WebKit::WGC3Denum srcAlpha, WebKit::WGC3Denum dstAlpha) { } + + virtual void bufferData(WebKit::WGC3Denum target, WebKit::WGC3Dsizeiptr size, const void* data, WebKit::WGC3Denum usage) { } + virtual void bufferSubData(WebKit::WGC3Denum target, WebKit::WGC3Dintptr offset, WebKit::WGC3Dsizeiptr size, const void* data) { } + + virtual WebKit::WGC3Denum checkFramebufferStatus(WebKit::WGC3Denum target); + + virtual void clear(WebKit::WGC3Dbitfield mask) { } + virtual void clearColor(WebKit::WGC3Dclampf red, WebKit::WGC3Dclampf green, WebKit::WGC3Dclampf blue, WebKit::WGC3Dclampf alpha) { } + virtual void clearDepth(WebKit::WGC3Dclampf depth) { } + virtual void clearStencil(WebKit::WGC3Dint s) { } + virtual void colorMask(WebKit::WGC3Dboolean red, WebKit::WGC3Dboolean green, WebKit::WGC3Dboolean blue, WebKit::WGC3Dboolean alpha) { } + virtual void compileShader(WebKit::WebGLId shader) { } + + virtual void compressedTexImage2D(WebKit::WGC3Denum target, WebKit::WGC3Dint level, WebKit::WGC3Denum internalformat, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height, WebKit::WGC3Dint border, WebKit::WGC3Dsizei imageSize, const void* data) { } + virtual void compressedTexSubImage2D(WebKit::WGC3Denum target, WebKit::WGC3Dint level, WebKit::WGC3Dint xoffset, WebKit::WGC3Dint yoffset, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height, WebKit::WGC3Denum format, WebKit::WGC3Dsizei imageSize, const void* data) { } + virtual void copyTexImage2D(WebKit::WGC3Denum target, WebKit::WGC3Dint level, WebKit::WGC3Denum internalformat, WebKit::WGC3Dint x, WebKit::WGC3Dint y, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height, WebKit::WGC3Dint border) { } + virtual void copyTexSubImage2D(WebKit::WGC3Denum target, WebKit::WGC3Dint level, WebKit::WGC3Dint xoffset, WebKit::WGC3Dint yoffset, WebKit::WGC3Dint x, WebKit::WGC3Dint y, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height) { } + virtual void cullFace(WebKit::WGC3Denum mode) { } + virtual void depthFunc(WebKit::WGC3Denum func) { } + virtual void depthMask(WebKit::WGC3Dboolean flag) { } + virtual void depthRange(WebKit::WGC3Dclampf zNear, WebKit::WGC3Dclampf zFar) { } + virtual void detachShader(WebKit::WebGLId program, WebKit::WebGLId shader) { } + virtual void disable(WebKit::WGC3Denum cap) { } + virtual void disableVertexAttribArray(WebKit::WGC3Duint index) { } + virtual void drawArrays(WebKit::WGC3Denum mode, WebKit::WGC3Dint first, WebKit::WGC3Dsizei count) { } + virtual void drawElements(WebKit::WGC3Denum mode, WebKit::WGC3Dsizei count, WebKit::WGC3Denum type, WebKit::WGC3Dintptr offset) { } + + virtual void enable(WebKit::WGC3Denum cap) { } + virtual void enableVertexAttribArray(WebKit::WGC3Duint index) { } virtual void finish() { } virtual void flush() { } - virtual void framebufferRenderbuffer(WGC3Denum target, WGC3Denum attachment, WGC3Denum renderbuffertarget, WebGLId renderbuffer) { } - virtual void framebufferTexture2D(WGC3Denum target, WGC3Denum attachment, WGC3Denum textarget, WebGLId texture, WGC3Dint level) { } - virtual void frontFace(WGC3Denum mode) { } - virtual void generateMipmap(WGC3Denum target) { } - - virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; } - virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; } - virtual void getAttachedShaders(WebGLId program, WGC3Dsizei maxCount, WGC3Dsizei* count, WebGLId* shaders) { } - virtual WGC3Dint getAttribLocation(WebGLId program, const WGC3Dchar* name) { return 0; } - virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) { } - virtual void getBufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { } - virtual Attributes getContextAttributes() { return m_attrs; } - virtual WGC3Denum getError() { return 0; } - virtual void getFloatv(WGC3Denum pname, WGC3Dfloat* value) { } - virtual void getFramebufferAttachmentParameteriv(WGC3Denum target, WGC3Denum attachment, WGC3Denum pname, WGC3Dint* value) { } - - virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value) - { - if (pname == GL_MAX_TEXTURE_SIZE) - *value = 1024; - } - - virtual void getProgramiv(WebGLId program, WGC3Denum pname, WGC3Dint* value) - { - if (pname == GL_LINK_STATUS) - *value = 1; - } - - virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); } - virtual void getRenderbufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { } - - virtual void getShaderiv(WebGLId shader, WGC3Denum pname, WGC3Dint* value) - { - if (pname == GL_COMPILE_STATUS) - *value = 1; - } - - virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); } - virtual void getShaderPrecisionFormat(WGC3Denum shadertype, WGC3Denum precisiontype, WGC3Dint* range, WGC3Dint* precision) { } - virtual WebString getShaderSource(WebGLId shader) { return WebString(); } - virtual WebString getString(WGC3Denum name) { return WebString(); } - virtual void getTexParameterfv(WGC3Denum target, WGC3Denum pname, WGC3Dfloat* value) { } - virtual void getTexParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { } - virtual void getUniformfv(WebGLId program, WGC3Dint location, WGC3Dfloat* value) { } - virtual void getUniformiv(WebGLId program, WGC3Dint location, WGC3Dint* value) { } - virtual WGC3Dint getUniformLocation(WebGLId program, const WGC3Dchar* name) { return 0; } - virtual void getVertexAttribfv(WGC3Duint index, WGC3Denum pname, WGC3Dfloat* value) { } - virtual void getVertexAttribiv(WGC3Duint index, WGC3Denum pname, WGC3Dint* value) { } - virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname) { return 0; } - - virtual void hint(WGC3Denum target, WGC3Denum mode) { } - virtual WGC3Dboolean isBuffer(WebGLId buffer) { return false; } - virtual WGC3Dboolean isEnabled(WGC3Denum cap) { return false; } - virtual WGC3Dboolean isFramebuffer(WebGLId framebuffer) { return false; } - virtual WGC3Dboolean isProgram(WebGLId program) { return false; } - virtual WGC3Dboolean isRenderbuffer(WebGLId renderbuffer) { return false; } - virtual WGC3Dboolean isShader(WebGLId shader) { return false; } - virtual WGC3Dboolean isTexture(WebGLId texture) { return false; } - virtual void lineWidth(WGC3Dfloat) { } - virtual void linkProgram(WebGLId program) { } - virtual void pixelStorei(WGC3Denum pname, WGC3Dint param) { } - virtual void polygonOffset(WGC3Dfloat factor, WGC3Dfloat units) { } - - virtual void readPixels(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, void* pixels) { } + virtual void framebufferRenderbuffer(WebKit::WGC3Denum target, WebKit::WGC3Denum attachment, WebKit::WGC3Denum renderbuffertarget, WebKit::WebGLId renderbuffer) { } + virtual void framebufferTexture2D(WebKit::WGC3Denum target, WebKit::WGC3Denum attachment, WebKit::WGC3Denum textarget, WebKit::WebGLId texture, WebKit::WGC3Dint level) { } + virtual void frontFace(WebKit::WGC3Denum mode) { } + virtual void generateMipmap(WebKit::WGC3Denum target) { } + + virtual bool getActiveAttrib(WebKit::WebGLId program, WebKit::WGC3Duint index, ActiveInfo&); + virtual bool getActiveUniform(WebKit::WebGLId program, WebKit::WGC3Duint index, ActiveInfo&); + virtual void getAttachedShaders(WebKit::WebGLId program, WebKit::WGC3Dsizei maxCount, WebKit::WGC3Dsizei* count, WebKit::WebGLId* shaders) { } + virtual WebKit::WGC3Dint getAttribLocation(WebKit::WebGLId program, const WebKit::WGC3Dchar* name); + virtual void getBooleanv(WebKit::WGC3Denum pname, WebKit::WGC3Dboolean* value) { } + virtual void getBufferParameteriv(WebKit::WGC3Denum target, WebKit::WGC3Denum pname, WebKit::WGC3Dint* value) { } + virtual Attributes getContextAttributes(); + virtual WebKit::WGC3Denum getError(); + virtual void getFloatv(WebKit::WGC3Denum pname, WebKit::WGC3Dfloat* value) { } + virtual void getFramebufferAttachmentParameteriv(WebKit::WGC3Denum target, WebKit::WGC3Denum attachment, WebKit::WGC3Denum pname, WebKit::WGC3Dint* value) { } + + virtual void getIntegerv(WebKit::WGC3Denum pname, WebKit::WGC3Dint* value); + + virtual void getProgramiv(WebKit::WebGLId program, WebKit::WGC3Denum pname, WebKit::WGC3Dint* value); + + virtual WebKit::WebString getProgramInfoLog(WebKit::WebGLId program); + virtual void getRenderbufferParameteriv(WebKit::WGC3Denum target, WebKit::WGC3Denum pname, WebKit::WGC3Dint* value) { } + + virtual void getShaderiv(WebKit::WebGLId shader, WebKit::WGC3Denum pname, WebKit::WGC3Dint* value); + + virtual WebKit::WebString getShaderInfoLog(WebKit::WebGLId shader); + virtual void getShaderPrecisionFormat(WebKit::WGC3Denum shadertype, WebKit::WGC3Denum precisiontype, WebKit::WGC3Dint* range, WebKit::WGC3Dint* precision) { } + virtual WebKit::WebString getShaderSource(WebKit::WebGLId shader); + virtual WebKit::WebString getString(WebKit::WGC3Denum name); + virtual void getTexParameterfv(WebKit::WGC3Denum target, WebKit::WGC3Denum pname, WebKit::WGC3Dfloat* value) { } + virtual void getTexParameteriv(WebKit::WGC3Denum target, WebKit::WGC3Denum pname, WebKit::WGC3Dint* value) { } + virtual void getUniformfv(WebKit::WebGLId program, WebKit::WGC3Dint location, WebKit::WGC3Dfloat* value) { } + virtual void getUniformiv(WebKit::WebGLId program, WebKit::WGC3Dint location, WebKit::WGC3Dint* value) { } + virtual WebKit::WGC3Dint getUniformLocation(WebKit::WebGLId program, const WebKit::WGC3Dchar* name); + virtual void getVertexAttribfv(WebKit::WGC3Duint index, WebKit::WGC3Denum pname, WebKit::WGC3Dfloat* value) { } + virtual void getVertexAttribiv(WebKit::WGC3Duint index, WebKit::WGC3Denum pname, WebKit::WGC3Dint* value) { } + virtual WebKit::WGC3Dsizeiptr getVertexAttribOffset(WebKit::WGC3Duint index, WebKit::WGC3Denum pname); + + virtual void hint(WebKit::WGC3Denum target, WebKit::WGC3Denum mode) { } + virtual WebKit::WGC3Dboolean isBuffer(WebKit::WebGLId buffer); + virtual WebKit::WGC3Dboolean isEnabled(WebKit::WGC3Denum cap); + virtual WebKit::WGC3Dboolean isFramebuffer(WebKit::WebGLId framebuffer); + virtual WebKit::WGC3Dboolean isProgram(WebKit::WebGLId program); + virtual WebKit::WGC3Dboolean isRenderbuffer(WebKit::WebGLId renderbuffer); + virtual WebKit::WGC3Dboolean isShader(WebKit::WebGLId shader); + virtual WebKit::WGC3Dboolean isTexture(WebKit::WebGLId texture); + virtual void lineWidth(WebKit::WGC3Dfloat) { } + virtual void linkProgram(WebKit::WebGLId program) { } + virtual void pixelStorei(WebKit::WGC3Denum pname, WebKit::WGC3Dint param) { } + virtual void polygonOffset(WebKit::WGC3Dfloat factor, WebKit::WGC3Dfloat units) { } + + virtual void readPixels(WebKit::WGC3Dint x, WebKit::WGC3Dint y, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height, WebKit::WGC3Denum format, WebKit::WGC3Denum type, void* pixels) { } virtual void releaseShaderCompiler() { } - virtual void renderbufferStorage(WGC3Denum target, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { } - virtual void sampleCoverage(WGC3Dclampf value, WGC3Dboolean invert) { } - virtual void scissor(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) { } - virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { } - virtual void stencilFunc(WGC3Denum func, WGC3Dint ref, WGC3Duint mask) { } - virtual void stencilFuncSeparate(WGC3Denum face, WGC3Denum func, WGC3Dint ref, WGC3Duint mask) { } - virtual void stencilMask(WGC3Duint mask) { } - virtual void stencilMaskSeparate(WGC3Denum face, WGC3Duint mask) { } - virtual void stencilOp(WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) { } - virtual void stencilOpSeparate(WGC3Denum face, WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) { } - - virtual void texImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Denum format, WGC3Denum type, const void* pixels) { } - - virtual void texParameterf(WGC3Denum target, WGC3Denum pname, WGC3Dfloat param) { } - virtual void texParameteri(WGC3Denum target, WGC3Denum pname, WGC3Dint param) { } - - virtual void texSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, const void* pixels) { } - - virtual void uniform1f(WGC3Dint location, WGC3Dfloat x) { } - virtual void uniform1fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { } - virtual void uniform1i(WGC3Dint location, WGC3Dint x) { } - virtual void uniform1iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { } - virtual void uniform2f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y) { } - virtual void uniform2fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { } - virtual void uniform2i(WGC3Dint location, WGC3Dint x, WGC3Dint y) { } - virtual void uniform2iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { } - virtual void uniform3f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z) { } - virtual void uniform3fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { } - virtual void uniform3i(WGC3Dint location, WGC3Dint x, WGC3Dint y, WGC3Dint z) { } - virtual void uniform3iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { } - virtual void uniform4f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z, WGC3Dfloat w) { } - virtual void uniform4fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { } - virtual void uniform4i(WGC3Dint location, WGC3Dint x, WGC3Dint y, WGC3Dint z, WGC3Dint w) { } - virtual void uniform4iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { } - virtual void uniformMatrix2fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) { } - virtual void uniformMatrix3fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) { } - virtual void uniformMatrix4fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) { } - - virtual void useProgram(WebGLId program) { } - virtual void validateProgram(WebGLId program) { } - - virtual void vertexAttrib1f(WGC3Duint index, WGC3Dfloat x) { } - virtual void vertexAttrib1fv(WGC3Duint index, const WGC3Dfloat* values) { } - virtual void vertexAttrib2f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y) { } - virtual void vertexAttrib2fv(WGC3Duint index, const WGC3Dfloat* values) { } - virtual void vertexAttrib3f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z) { } - virtual void vertexAttrib3fv(WGC3Duint index, const WGC3Dfloat* values) { } - virtual void vertexAttrib4f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z, WGC3Dfloat w) { } - virtual void vertexAttrib4fv(WGC3Duint index, const WGC3Dfloat* values) { } - virtual void vertexAttribPointer(WGC3Duint index, WGC3Dint size, WGC3Denum type, WGC3Dboolean normalized, - WGC3Dsizei stride, WGC3Dintptr offset) { } - - virtual void viewport(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) { } - - virtual WebGLId createBuffer() { return 1; } - virtual WebGLId createFramebuffer() { return 1; } - virtual WebGLId createProgram() { return 1; } - virtual WebGLId createRenderbuffer() { return 1; } - virtual WebGLId createShader(WGC3Denum) { return 1; } - virtual WebGLId createTexture() { return m_nextTextureId++; } - - virtual void deleteBuffer(WebGLId) { } - virtual void deleteFramebuffer(WebGLId) { } - virtual void deleteProgram(WebGLId) { } - virtual void deleteRenderbuffer(WebGLId) { } - virtual void deleteShader(WebGLId) { } - virtual void deleteTexture(WebGLId) { } - - virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint internalformat, - WGC3Dint width, WGC3Dint height) { } - - virtual WebGLId createQueryEXT() { return 1; } - virtual void deleteQueryEXT(WebGLId) { } - virtual WGC3Dboolean isQueryEXT(WebGLId) { return true; } - virtual void beginQueryEXT(WGC3Denum, WebGLId) { } - virtual void endQueryEXT(WGC3Denum) { } - virtual void getQueryivEXT(WGC3Denum, WGC3Denum, WGC3Dint*) { } - virtual void getQueryObjectuivEXT(WebGLId, WGC3Denum, WGC3Duint*) { } + virtual void renderbufferStorage(WebKit::WGC3Denum target, WebKit::WGC3Denum internalformat, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height) { } + virtual void sampleCoverage(WebKit::WGC3Dclampf value, WebKit::WGC3Dboolean invert) { } + virtual void scissor(WebKit::WGC3Dint x, WebKit::WGC3Dint y, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height) { } + virtual void shaderSource(WebKit::WebGLId shader, const WebKit::WGC3Dchar* string) { } + virtual void stencilFunc(WebKit::WGC3Denum func, WebKit::WGC3Dint ref, WebKit::WGC3Duint mask) { } + virtual void stencilFuncSeparate(WebKit::WGC3Denum face, WebKit::WGC3Denum func, WebKit::WGC3Dint ref, WebKit::WGC3Duint mask) { } + virtual void stencilMask(WebKit::WGC3Duint mask) { } + virtual void stencilMaskSeparate(WebKit::WGC3Denum face, WebKit::WGC3Duint mask) { } + virtual void stencilOp(WebKit::WGC3Denum fail, WebKit::WGC3Denum zfail, WebKit::WGC3Denum zpass) { } + virtual void stencilOpSeparate(WebKit::WGC3Denum face, WebKit::WGC3Denum fail, WebKit::WGC3Denum zfail, WebKit::WGC3Denum zpass) { } + + virtual void texImage2D(WebKit::WGC3Denum target, WebKit::WGC3Dint level, WebKit::WGC3Denum internalformat, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height, WebKit::WGC3Dint border, WebKit::WGC3Denum format, WebKit::WGC3Denum type, const void* pixels) { } + + virtual void texParameterf(WebKit::WGC3Denum target, WebKit::WGC3Denum pname, WebKit::WGC3Dfloat param) { } + virtual void texParameteri(WebKit::WGC3Denum target, WebKit::WGC3Denum pname, WebKit::WGC3Dint param) { } + + virtual void texSubImage2D(WebKit::WGC3Denum target, WebKit::WGC3Dint level, WebKit::WGC3Dint xoffset, WebKit::WGC3Dint yoffset, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height, WebKit::WGC3Denum format, WebKit::WGC3Denum type, const void* pixels) { } + + virtual void uniform1f(WebKit::WGC3Dint location, WebKit::WGC3Dfloat x) { } + virtual void uniform1fv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, const WebKit::WGC3Dfloat* v) { } + virtual void uniform1i(WebKit::WGC3Dint location, WebKit::WGC3Dint x) { } + virtual void uniform1iv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, const WebKit::WGC3Dint* v) { } + virtual void uniform2f(WebKit::WGC3Dint location, WebKit::WGC3Dfloat x, WebKit::WGC3Dfloat y) { } + virtual void uniform2fv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, const WebKit::WGC3Dfloat* v) { } + virtual void uniform2i(WebKit::WGC3Dint location, WebKit::WGC3Dint x, WebKit::WGC3Dint y) { } + virtual void uniform2iv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, const WebKit::WGC3Dint* v) { } + virtual void uniform3f(WebKit::WGC3Dint location, WebKit::WGC3Dfloat x, WebKit::WGC3Dfloat y, WebKit::WGC3Dfloat z) { } + virtual void uniform3fv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, const WebKit::WGC3Dfloat* v) { } + virtual void uniform3i(WebKit::WGC3Dint location, WebKit::WGC3Dint x, WebKit::WGC3Dint y, WebKit::WGC3Dint z) { } + virtual void uniform3iv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, const WebKit::WGC3Dint* v) { } + virtual void uniform4f(WebKit::WGC3Dint location, WebKit::WGC3Dfloat x, WebKit::WGC3Dfloat y, WebKit::WGC3Dfloat z, WebKit::WGC3Dfloat w) { } + virtual void uniform4fv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, const WebKit::WGC3Dfloat* v) { } + virtual void uniform4i(WebKit::WGC3Dint location, WebKit::WGC3Dint x, WebKit::WGC3Dint y, WebKit::WGC3Dint z, WebKit::WGC3Dint w) { } + virtual void uniform4iv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, const WebKit::WGC3Dint* v) { } + virtual void uniformMatrix2fv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, WebKit::WGC3Dboolean transpose, const WebKit::WGC3Dfloat* value) { } + virtual void uniformMatrix3fv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, WebKit::WGC3Dboolean transpose, const WebKit::WGC3Dfloat* value) { } + virtual void uniformMatrix4fv(WebKit::WGC3Dint location, WebKit::WGC3Dsizei count, WebKit::WGC3Dboolean transpose, const WebKit::WGC3Dfloat* value) { } + + virtual void useProgram(WebKit::WebGLId program) { } + virtual void validateProgram(WebKit::WebGLId program) { } + + virtual void vertexAttrib1f(WebKit::WGC3Duint index, WebKit::WGC3Dfloat x) { } + virtual void vertexAttrib1fv(WebKit::WGC3Duint index, const WebKit::WGC3Dfloat* values) { } + virtual void vertexAttrib2f(WebKit::WGC3Duint index, WebKit::WGC3Dfloat x, WebKit::WGC3Dfloat y) { } + virtual void vertexAttrib2fv(WebKit::WGC3Duint index, const WebKit::WGC3Dfloat* values) { } + virtual void vertexAttrib3f(WebKit::WGC3Duint index, WebKit::WGC3Dfloat x, WebKit::WGC3Dfloat y, WebKit::WGC3Dfloat z) { } + virtual void vertexAttrib3fv(WebKit::WGC3Duint index, const WebKit::WGC3Dfloat* values) { } + virtual void vertexAttrib4f(WebKit::WGC3Duint index, WebKit::WGC3Dfloat x, WebKit::WGC3Dfloat y, WebKit::WGC3Dfloat z, WebKit::WGC3Dfloat w) { } + virtual void vertexAttrib4fv(WebKit::WGC3Duint index, const WebKit::WGC3Dfloat* values) { } + virtual void vertexAttribPointer(WebKit::WGC3Duint index, WebKit::WGC3Dint size, WebKit::WGC3Denum type, WebKit::WGC3Dboolean normalized, + WebKit::WGC3Dsizei stride, WebKit::WGC3Dintptr offset) { } + + virtual void viewport(WebKit::WGC3Dint x, WebKit::WGC3Dint y, WebKit::WGC3Dsizei width, WebKit::WGC3Dsizei height) { } + + virtual WebKit::WebGLId createBuffer(); + virtual WebKit::WebGLId createFramebuffer(); + virtual WebKit::WebGLId createProgram(); + virtual WebKit::WebGLId createRenderbuffer(); + virtual WebKit::WebGLId createShader(WebKit::WGC3Denum); + virtual WebKit::WebGLId createTexture(); + + virtual void deleteBuffer(WebKit::WebGLId) { } + virtual void deleteFramebuffer(WebKit::WebGLId) { } + virtual void deleteProgram(WebKit::WebGLId) { } + virtual void deleteRenderbuffer(WebKit::WebGLId) { } + virtual void deleteShader(WebKit::WebGLId) { } + virtual void deleteTexture(WebKit::WebGLId) { } + + virtual void texStorage2DEXT(WebKit::WGC3Denum target, WebKit::WGC3Dint levels, WebKit::WGC3Duint internalformat, + WebKit::WGC3Dint width, WebKit::WGC3Dint height) { } + + virtual WebKit::WebGLId createQueryEXT(); + virtual void deleteQueryEXT(WebKit::WebGLId) { } + virtual WebKit::WGC3Dboolean isQueryEXT(WebKit::WebGLId); + virtual void beginQueryEXT(WebKit::WGC3Denum, WebKit::WebGLId) { } + virtual void endQueryEXT(WebKit::WGC3Denum) { } + virtual void getQueryivEXT(WebKit::WGC3Denum, WebKit::WGC3Denum, WebKit::WGC3Dint*) { } + virtual void getQueryObjectuivEXT(WebKit::WebGLId, WebKit::WGC3Denum, WebKit::WGC3Duint*) { } protected: unsigned m_nextTextureId; Attributes m_attrs; }; -} // namespace WebKit +} // namespace cc #endif // CC_TEST_FAKE_WEB_GRAPHICS_CONTEXT_3D_H_ |