| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 virtual bool genSyncTokenCHROMIUM(WGC3Duint64, WGC3Dbyte*) { return false; } | 140 virtual bool genSyncTokenCHROMIUM(WGC3Duint64, WGC3Dbyte*) { return false; } |
| 141 | 141 |
| 142 // Synthesizes an OpenGL error which will be returned from a | |
| 143 // later call to getError. This is used to emulate OpenGL ES | |
| 144 // 2.0 behavior on the desktop and to enforce additional error | |
| 145 // checking mandated by WebGL. | |
| 146 // | |
| 147 // Per the behavior of glGetError, this stores at most one | |
| 148 // instance of any given error, and returns them from calls to | |
| 149 // getError in the order they were added. | |
| 150 virtual void synthesizeGLError(WGC3Denum) = 0; | |
| 151 | |
| 152 // GL_CHROMIUM_request_extension | 142 // GL_CHROMIUM_request_extension |
| 153 virtual WebString getRequestableExtensionsCHROMIUM() = 0; | 143 virtual WebString getRequestableExtensionsCHROMIUM() = 0; |
| 154 | 144 |
| 155 // GL_CHROMIUM_framebuffer_multisample | 145 // GL_CHROMIUM_framebuffer_multisample |
| 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; | 146 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; |
| 157 | 147 |
| 158 // The entry points below map directly to the OpenGL ES 2.0 API. | 148 // The entry points below map directly to the OpenGL ES 2.0 API. |
| 159 // See: http://www.khronos.org/registry/gles/ | 149 // See: http://www.khronos.org/registry/gles/ |
| 160 // and: http://www.khronos.org/opengles/sdk/docs/man/ | 150 // and: http://www.khronos.org/opengles/sdk/docs/man/ |
| 161 virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type,
WGC3Dintptr offset) = 0; | 151 virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type,
WGC3Dintptr offset) = 0; |
| 162 | 152 |
| 163 virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&)
= 0; | 153 virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&)
= 0; |
| 164 virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&)
= 0; | 154 virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&)
= 0; |
| 165 virtual WGC3Denum getError() = 0; | |
| 166 virtual WebString getProgramInfoLog(WebGLId program) = 0; | 155 virtual WebString getProgramInfoLog(WebGLId program) = 0; |
| 167 virtual WebString getShaderInfoLog(WebGLId shader) = 0; | 156 virtual WebString getShaderInfoLog(WebGLId shader) = 0; |
| 168 virtual WebString getShaderSource(WebGLId shader) = 0; | 157 virtual WebString getShaderSource(WebGLId shader) = 0; |
| 169 virtual WebString getString(WGC3Denum name) = 0; | 158 virtual WebString getString(WGC3Denum name) = 0; |
| 170 virtual WGC3Dintptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname)
= 0; | 159 virtual WGC3Dintptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname)
= 0; |
| 171 | 160 |
| 172 virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) = 0; | 161 virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) = 0; |
| 173 | 162 |
| 174 virtual void vertexAttribPointer(WGC3Duint index, WGC3Dint size, WGC3Denum t
ype, WGC3Dboolean normalized, | 163 virtual void vertexAttribPointer(WGC3Duint index, WGC3Dint size, WGC3Denum t
ype, WGC3Dboolean normalized, |
| 175 WGC3Dsizei stride, WGC3Dintptr offset) = 0; | 164 WGC3Dsizei stride, WGC3Dintptr offset) = 0; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 virtual void vertexAttribIPointer(WGC3Duint index, WGC3Dint size, WGC3Denum
type, WGC3Dsizei stride, WGC3Dintptr pointer) { } | 249 virtual void vertexAttribIPointer(WGC3Duint index, WGC3Dint size, WGC3Denum
type, WGC3Dsizei stride, WGC3Dintptr pointer) { } |
| 261 virtual void waitSync(WGC3Dsync sync, WGC3Dbitfield flags, WGC3Duint64 timeo
ut) { } | 250 virtual void waitSync(WGC3Dsync sync, WGC3Dbitfield flags, WGC3Duint64 timeo
ut) { } |
| 262 | 251 |
| 263 // Prefer getting a GLES2Interface off WebGraphicsContext3DProvider if possi
ble, and avoid using WebGraphicsContext3D at all. | 252 // Prefer getting a GLES2Interface off WebGraphicsContext3DProvider if possi
ble, and avoid using WebGraphicsContext3D at all. |
| 264 virtual gpu::gles2::GLES2Interface* getGLES2Interface() = 0; | 253 virtual gpu::gles2::GLES2Interface* getGLES2Interface() = 0; |
| 265 }; | 254 }; |
| 266 | 255 |
| 267 } // namespace blink | 256 } // namespace blink |
| 268 | 257 |
| 269 #endif | 258 #endif |
| OLD | NEW |