| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 public: | 130 public: |
| 131 virtual void onErrorMessage(const WebString&, WGC3Dint) = 0; | 131 virtual void onErrorMessage(const WebString&, WGC3Dint) = 0; |
| 132 | 132 |
| 133 protected: | 133 protected: |
| 134 virtual ~WebGraphicsErrorMessageCallback() { } | 134 virtual ~WebGraphicsErrorMessageCallback() { } |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 // This destructor needs to be public so that using classes can destroy inst
ances if initialization fails. | 137 // This destructor needs to be public so that using classes can destroy inst
ances if initialization fails. |
| 138 virtual ~WebGraphicsContext3D() { } | 138 virtual ~WebGraphicsContext3D() { } |
| 139 | 139 |
| 140 // Each flush or finish is assigned an unique ID. The larger | |
| 141 // the ID number, the more recently the context has been flushed. | |
| 142 virtual uint32_t lastFlushID() { return 0; } | |
| 143 | |
| 144 // GL_EXT_discard_framebuffer - makes specified attachments of currently bou
nd framebuffer undefined. | |
| 145 virtual void discardFramebufferEXT(WGC3Denum target, WGC3Dsizei numAttachmen
ts, const WGC3Denum* attachments) { } | |
| 146 | |
| 147 virtual WGC3Duint64 insertFenceSyncCHROMIUM() { return 0; } | |
| 148 virtual bool genSyncTokenCHROMIUM(WGC3Duint64, WGC3Dbyte*) { return false; } | 140 virtual bool genSyncTokenCHROMIUM(WGC3Duint64, WGC3Dbyte*) { return false; } |
| 149 virtual void waitSyncTokenCHROMIUM(const WGC3Dbyte*) {} | |
| 150 | 141 |
| 151 // Synthesizes an OpenGL error which will be returned from a | 142 // Synthesizes an OpenGL error which will be returned from a |
| 152 // later call to getError. This is used to emulate OpenGL ES | 143 // later call to getError. This is used to emulate OpenGL ES |
| 153 // 2.0 behavior on the desktop and to enforce additional error | 144 // 2.0 behavior on the desktop and to enforce additional error |
| 154 // checking mandated by WebGL. | 145 // checking mandated by WebGL. |
| 155 // | 146 // |
| 156 // Per the behavior of glGetError, this stores at most one | 147 // Per the behavior of glGetError, this stores at most one |
| 157 // instance of any given error, and returns them from calls to | 148 // instance of any given error, and returns them from calls to |
| 158 // getError in the order they were added. | 149 // getError in the order they were added. |
| 159 virtual void synthesizeGLError(WGC3Denum) = 0; | 150 virtual void synthesizeGLError(WGC3Denum) = 0; |
| 160 | 151 |
| 161 // GL_CHROMIUM_request_extension | 152 // GL_CHROMIUM_request_extension |
| 162 virtual WebString getRequestableExtensionsCHROMIUM() = 0; | 153 virtual WebString getRequestableExtensionsCHROMIUM() = 0; |
| 163 virtual void requestExtensionCHROMIUM(const char*) = 0; | |
| 164 | 154 |
| 165 // GL_CHROMIUM_framebuffer_multisample | 155 // GL_CHROMIUM_framebuffer_multisample |
| 166 virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Din
t srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Din
t dstY1, WGC3Dbitfield mask, WGC3Denum filter) = 0; | 156 virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Din
t srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Din
t dstY1, WGC3Dbitfield mask, WGC3Denum filter) = 0; |
| 167 virtual void renderbufferStorageMultisampleCHROMIUM(WGC3Denum target, WGC3Ds
izei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) = 0
; | |
| 168 | 157 |
| 169 // The entry points below map directly to the OpenGL ES 2.0 API. | 158 // The entry points below map directly to the OpenGL ES 2.0 API. |
| 170 // See: http://www.khronos.org/registry/gles/ | 159 // See: http://www.khronos.org/registry/gles/ |
| 171 // and: http://www.khronos.org/opengles/sdk/docs/man/ | 160 // and: http://www.khronos.org/opengles/sdk/docs/man/ |
| 172 virtual void activeTexture(WGC3Denum texture) = 0; | |
| 173 virtual void attachShader(WebGLId program, WebGLId shader) = 0; | |
| 174 virtual void bindAttribLocation(WebGLId program, WGC3Duint index, const WGC3
Dchar* name) = 0; | |
| 175 virtual void bindBuffer(WGC3Denum target, WebGLId buffer) = 0; | |
| 176 virtual void bindFramebuffer(WGC3Denum target, WebGLId framebuffer) = 0; | |
| 177 virtual void bindRenderbuffer(WGC3Denum target, WebGLId renderbuffer) = 0; | |
| 178 virtual void bindTexture(WGC3Denum target, WebGLId texture) = 0; | |
| 179 virtual void blendColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue
, WGC3Dclampf alpha) = 0; | |
| 180 virtual void blendEquation(WGC3Denum mode) = 0; | |
| 181 virtual void blendEquationSeparate(WGC3Denum modeRGB, WGC3Denum modeAlpha) =
0; | |
| 182 virtual void blendFunc(WGC3Denum sfactor, WGC3Denum dfactor) = 0; | |
| 183 virtual void blendFuncSeparate(WGC3Denum srcRGB, WGC3Denum dstRGB, WGC3Denum
srcAlpha, WGC3Denum dstAlpha) = 0; | |
| 184 | |
| 185 virtual void bufferData(WGC3Denum target, WGC3Dsizeiptr size, const void* da
ta, WGC3Denum usage) = 0; | |
| 186 virtual void bufferSubData(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeip
tr size, const void* data) = 0; | |
| 187 | |
| 188 virtual WGC3Denum checkFramebufferStatus(WGC3Denum target) = 0; | |
| 189 virtual void clear(WGC3Dbitfield mask) = 0; | |
| 190 virtual void clearColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue
, WGC3Dclampf alpha) = 0; | |
| 191 virtual void clearDepth(WGC3Dclampf depth) = 0; | |
| 192 virtual void clearStencil(WGC3Dint s) = 0; | |
| 193 virtual void colorMask(WGC3Dboolean red, WGC3Dboolean green, WGC3Dboolean bl
ue, WGC3Dboolean alpha) = 0; | |
| 194 virtual void compileShader(WebGLId shader) = 0; | |
| 195 | |
| 196 virtual void compressedTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denu
m internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Dsiz
ei imageSize, const void* data) = 0; | |
| 197 virtual void compressedTexSubImage2D(WGC3Denum target, WGC3Dint level, WGC3D
int xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum fo
rmat, WGC3Dsizei imageSize, const void* data) = 0; | |
| 198 virtual void copyTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum inte
rnalformat, WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height, WGC3Din
t border) = 0; | |
| 199 virtual void copyTexSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xo
ffset, WGC3Dint yoffset, WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei he
ight) = 0; | |
| 200 virtual void cullFace(WGC3Denum mode) = 0; | |
| 201 virtual void depthFunc(WGC3Denum func) = 0; | |
| 202 virtual void depthMask(WGC3Dboolean flag) = 0; | |
| 203 virtual void depthRange(WGC3Dclampf zNear, WGC3Dclampf zFar) = 0; | |
| 204 virtual void detachShader(WebGLId program, WebGLId shader) = 0; | |
| 205 virtual void disable(WGC3Denum cap) = 0; | |
| 206 virtual void disableVertexAttribArray(WGC3Duint index) = 0; | |
| 207 virtual void drawArrays(WGC3Denum mode, WGC3Dint first, WGC3Dsizei count) =
0; | |
| 208 virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type,
WGC3Dintptr offset) = 0; | 161 virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type,
WGC3Dintptr offset) = 0; |
| 209 | 162 |
| 210 virtual void enable(WGC3Denum cap) = 0; | |
| 211 virtual void enableVertexAttribArray(WGC3Duint index) = 0; | |
| 212 virtual void finish() = 0; | 163 virtual void finish() = 0; |
| 213 virtual void flush() = 0; | 164 virtual void flush() = 0; |
| 214 virtual void frontFace(WGC3Denum mode) = 0; | 165 virtual void frontFace(WGC3Denum mode) = 0; |
| 215 virtual void generateMipmap(WGC3Denum target) = 0; | 166 virtual void generateMipmap(WGC3Denum target) = 0; |
| 216 | 167 |
| 217 virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&)
= 0; | 168 virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&)
= 0; |
| 218 virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&)
= 0; | 169 virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&)
= 0; |
| 219 virtual void getAttachedShaders(WebGLId program, WGC3Dsizei maxCount, WGC3Ds
izei* count, WebGLId* shaders) = 0; | 170 virtual void getAttachedShaders(WebGLId program, WGC3Dsizei maxCount, WGC3Ds
izei* count, WebGLId* shaders) = 0; |
| 220 virtual WGC3Dint getAttribLocation(WebGLId program, const WGC3Dchar* name) =
0; | 171 virtual WGC3Dint getAttribLocation(WebGLId program, const WGC3Dchar* name) =
0; |
| 221 virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) = 0; | 172 virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) = 0; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 virtual WebGLId createShader(WGC3Denum) = 0; | 275 virtual WebGLId createShader(WGC3Denum) = 0; |
| 325 | 276 |
| 326 virtual void deleteShader(WebGLId) = 0; | 277 virtual void deleteShader(WebGLId) = 0; |
| 327 virtual void deleteProgram(WebGLId) = 0; | 278 virtual void deleteProgram(WebGLId) = 0; |
| 328 | 279 |
| 329 virtual void setContextLostCallback(WebGraphicsContextLostCallback* callback
) { } | 280 virtual void setContextLostCallback(WebGraphicsContextLostCallback* callback
) { } |
| 330 virtual void setErrorMessageCallback(WebGraphicsErrorMessageCallback* callba
ck) { } | 281 virtual void setErrorMessageCallback(WebGraphicsErrorMessageCallback* callba
ck) { } |
| 331 | 282 |
| 332 virtual WebString getTranslatedShaderSourceANGLE(WebGLId shader) = 0; | 283 virtual WebString getTranslatedShaderSourceANGLE(WebGLId shader) = 0; |
| 333 | 284 |
| 334 // GL_CHROMIUM_screen_space_antialiasing | |
| 335 virtual void applyScreenSpaceAntialiasingCHROMIUM() { } | |
| 336 | |
| 337 // GL_EXT_texture_storage | 285 // GL_EXT_texture_storage |
| 338 virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint in
ternalformat, | 286 virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint in
ternalformat, |
| 339 WGC3Dint width, WGC3Dint height) { } | 287 WGC3Dint width, WGC3Dint height) { } |
| 340 | 288 |
| 341 // GL_EXT_occlusion_query | 289 // GL_EXT_occlusion_query |
| 342 virtual WebGLId createQueryEXT() { return 0; } | 290 virtual WebGLId createQueryEXT() { return 0; } |
| 343 virtual void deleteQueryEXT(WebGLId query) { } | 291 virtual void deleteQueryEXT(WebGLId query) { } |
| 344 virtual WGC3Dboolean isQueryEXT(WebGLId query) { return false; } | 292 virtual WGC3Dboolean isQueryEXT(WebGLId query) { return false; } |
| 345 virtual void beginQueryEXT(WGC3Denum target, WebGLId query) { } | 293 virtual void beginQueryEXT(WGC3Denum target, WebGLId query) { } |
| 346 virtual void endQueryEXT(WGC3Denum target) { } | 294 virtual void endQueryEXT(WGC3Denum target) { } |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 virtual void vertexAttribIPointer(WGC3Duint index, WGC3Dint size, WGC3Denum
type, WGC3Dsizei stride, WGC3Dintptr pointer) { } | 440 virtual void vertexAttribIPointer(WGC3Duint index, WGC3Dint size, WGC3Denum
type, WGC3Dsizei stride, WGC3Dintptr pointer) { } |
| 493 virtual void waitSync(WGC3Dsync sync, WGC3Dbitfield flags, WGC3Duint64 timeo
ut) { } | 441 virtual void waitSync(WGC3Dsync sync, WGC3Dbitfield flags, WGC3Duint64 timeo
ut) { } |
| 494 | 442 |
| 495 // Prefer getting a GLES2Interface off WebGraphicsContext3DProvider if possi
ble, and avoid using WebGraphicsContext3D at all. | 443 // Prefer getting a GLES2Interface off WebGraphicsContext3DProvider if possi
ble, and avoid using WebGraphicsContext3D at all. |
| 496 virtual gpu::gles2::GLES2Interface* getGLES2Interface() = 0; | 444 virtual gpu::gles2::GLES2Interface* getGLES2Interface() = 0; |
| 497 }; | 445 }; |
| 498 | 446 |
| 499 } // namespace blink | 447 } // namespace blink |
| 500 | 448 |
| 501 #endif | 449 #endif |
| OLD | NEW |