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 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebGraphicsContext3D_h | 31 #ifndef WebGraphicsContext3D_h |
32 #define WebGraphicsContext3D_h | 32 #define WebGraphicsContext3D_h |
33 | 33 |
34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
35 #include "WebNonCopyable.h" | 35 #include "WebNonCopyable.h" |
36 #include "WebString.h" | 36 #include "WebString.h" |
37 | 37 |
| 38 namespace gpu { |
| 39 namespace gles2 { |
| 40 class GLES2Interface; |
| 41 } |
| 42 } |
| 43 |
38 struct GrGLInterface; | 44 struct GrGLInterface; |
39 | 45 |
40 namespace blink { | 46 namespace blink { |
41 | 47 |
42 // WGC3D types match the corresponding GL types as defined in OpenGL ES 2.0 | 48 // WGC3D types match the corresponding GL types as defined in OpenGL ES 2.0 |
43 // header file gl2.h from khronos.org. | 49 // header file gl2.h from khronos.org. |
44 typedef char WGC3Dchar; | 50 typedef char WGC3Dchar; |
45 typedef unsigned WGC3Denum; | 51 typedef unsigned WGC3Denum; |
46 typedef unsigned char WGC3Dboolean; | 52 typedef unsigned char WGC3Dboolean; |
47 typedef unsigned WGC3Dbitfield; | 53 typedef unsigned WGC3Dbitfield; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // Synthesizes an OpenGL error which will be returned from a | 168 // Synthesizes an OpenGL error which will be returned from a |
163 // later call to getError. This is used to emulate OpenGL ES | 169 // later call to getError. This is used to emulate OpenGL ES |
164 // 2.0 behavior on the desktop and to enforce additional error | 170 // 2.0 behavior on the desktop and to enforce additional error |
165 // checking mandated by WebGL. | 171 // checking mandated by WebGL. |
166 // | 172 // |
167 // Per the behavior of glGetError, this stores at most one | 173 // Per the behavior of glGetError, this stores at most one |
168 // instance of any given error, and returns them from calls to | 174 // instance of any given error, and returns them from calls to |
169 // getError in the order they were added. | 175 // getError in the order they were added. |
170 virtual void synthesizeGLError(WGC3Denum) = 0; | 176 virtual void synthesizeGLError(WGC3Denum) = 0; |
171 | 177 |
172 virtual bool isContextLost() = 0; | |
173 | |
174 // GL_CHROMIUM_map_sub | 178 // GL_CHROMIUM_map_sub |
175 virtual void* mapBufferSubDataCHROMIUM(WGC3Denum target, WGC3Dintptr offset,
WGC3Dsizeiptr size, WGC3Denum access) = 0; | 179 virtual void* mapBufferSubDataCHROMIUM(WGC3Denum target, WGC3Dintptr offset,
WGC3Dsizeiptr size, WGC3Denum access) = 0; |
176 virtual void unmapBufferSubDataCHROMIUM(const void*) = 0; | 180 virtual void unmapBufferSubDataCHROMIUM(const void*) = 0; |
177 virtual void* mapTexSubImage2DCHROMIUM(WGC3Denum target, WGC3Dint level, WGC
3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum
format, WGC3Denum type, WGC3Denum access) = 0; | 181 virtual void* mapTexSubImage2DCHROMIUM(WGC3Denum target, WGC3Dint level, WGC
3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum
format, WGC3Denum type, WGC3Denum access) = 0; |
178 virtual void unmapTexSubImage2DCHROMIUM(const void*) = 0; | 182 virtual void unmapTexSubImage2DCHROMIUM(const void*) = 0; |
179 | 183 |
180 // GL_CHROMIUM_request_extension | 184 // GL_CHROMIUM_request_extension |
181 virtual WebString getRequestableExtensionsCHROMIUM() = 0; | 185 virtual WebString getRequestableExtensionsCHROMIUM() = 0; |
182 virtual void requestExtensionCHROMIUM(const char*) = 0; | 186 virtual void requestExtensionCHROMIUM(const char*) = 0; |
183 | 187 |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 virtual void uniformMatrix4x2fv(WGC3Dint location, WGC3Dsizei count, WGC3Dbo
olean transpose, const WGC3Dfloat* value) { } | 547 virtual void uniformMatrix4x2fv(WGC3Dint location, WGC3Dsizei count, WGC3Dbo
olean transpose, const WGC3Dfloat* value) { } |
544 virtual void uniformMatrix4x3fv(WGC3Dint location, WGC3Dsizei count, WGC3Dbo
olean transpose, const WGC3Dfloat* value) { } | 548 virtual void uniformMatrix4x3fv(WGC3Dint location, WGC3Dsizei count, WGC3Dbo
olean transpose, const WGC3Dfloat* value) { } |
545 virtual WGC3Dboolean unmapBuffer(WGC3Denum target) { return false; } | 549 virtual WGC3Dboolean unmapBuffer(WGC3Denum target) { return false; } |
546 | 550 |
547 virtual void vertexAttribI4i(WGC3Duint index, WGC3Dint x, WGC3Dint y, WGC3Di
nt z, WGC3Dint w) { } | 551 virtual void vertexAttribI4i(WGC3Duint index, WGC3Dint x, WGC3Dint y, WGC3Di
nt z, WGC3Dint w) { } |
548 virtual void vertexAttribI4iv(WGC3Duint index, const WGC3Dint *v) { } | 552 virtual void vertexAttribI4iv(WGC3Duint index, const WGC3Dint *v) { } |
549 virtual void vertexAttribI4ui(WGC3Duint index, WGC3Duint x, WGC3Duint y, WGC
3Duint z, WGC3Duint w) { } | 553 virtual void vertexAttribI4ui(WGC3Duint index, WGC3Duint x, WGC3Duint y, WGC
3Duint z, WGC3Duint w) { } |
550 virtual void vertexAttribI4uiv(WGC3Duint index, const WGC3Duint *v) { } | 554 virtual void vertexAttribI4uiv(WGC3Duint index, const WGC3Duint *v) { } |
551 virtual void vertexAttribIPointer(WGC3Duint index, WGC3Dint size, WGC3Denum
type, WGC3Dsizei stride, WGC3Dintptr pointer) { } | 555 virtual void vertexAttribIPointer(WGC3Duint index, WGC3Dint size, WGC3Denum
type, WGC3Dsizei stride, WGC3Dintptr pointer) { } |
552 virtual void waitSync(WGC3Dsync sync, WGC3Dbitfield flags, WGC3Duint64 timeo
ut) { } | 556 virtual void waitSync(WGC3Dsync sync, WGC3Dbitfield flags, WGC3Duint64 timeo
ut) { } |
| 557 |
| 558 // Prefer getting a GLES2Interface off WebGraphicsContext3DProvider if possi
ble, and avoid using WebGraphicsContext3D at all. |
| 559 virtual gpu::gles2::GLES2Interface* getGLES2Interface() = 0; |
553 }; | 560 }; |
554 | 561 |
555 } // namespace blink | 562 } // namespace blink |
556 | 563 |
557 #endif | 564 #endif |
OLD | NEW |