| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 typedef signed long int WGC3Dintptr; | 57 typedef signed long int WGC3Dintptr; |
| 58 typedef signed long int WGC3Dsizeiptr; | 58 typedef signed long int WGC3Dsizeiptr; |
| 59 | 59 |
| 60 // Typedef for server-side objects like OpenGL textures and program objects. | 60 // Typedef for server-side objects like OpenGL textures and program objects. |
| 61 typedef WGC3Duint WebGLId; | 61 typedef WGC3Duint WebGLId; |
| 62 | 62 |
| 63 // This interface abstracts the operations performed by the | 63 // This interface abstracts the operations performed by the |
| 64 // GraphicsContext3D in order to implement WebGL. Nearly all of the | 64 // GraphicsContext3D in order to implement WebGL. Nearly all of the |
| 65 // methods exposed on this interface map directly to entry points in | 65 // methods exposed on this interface map directly to entry points in |
| 66 // the OpenGL ES 2.0 API. | 66 // the OpenGL ES 2.0 API. |
| 67 // | |
| 68 // Creating a WebGraphicsContext does not make it current, or guarantee | |
| 69 // that the context has been created successfully. Use | |
| 70 // makeContextCurrent() to complete initialization of the context, treating | |
| 71 // a false return value as indication that the context could not be created | |
| 72 // successfully. | |
| 73 class WebGraphicsContext3D : public WebNonCopyable { | 67 class WebGraphicsContext3D : public WebNonCopyable { |
| 74 public: | 68 public: |
| 75 // Return value from getActiveUniform and getActiveAttrib. | 69 // Return value from getActiveUniform and getActiveAttrib. |
| 76 struct ActiveInfo { | 70 struct ActiveInfo { |
| 77 WebString name; | 71 WebString name; |
| 78 WGC3Denum type; | 72 WGC3Denum type; |
| 79 WGC3Dint size; | 73 WGC3Dint size; |
| 80 }; | 74 }; |
| 81 | 75 |
| 82 // Context creation attributes. | 76 // Context creation attributes. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 public: | 131 public: |
| 138 virtual void onSwapBuffersComplete() = 0; | 132 virtual void onSwapBuffersComplete() = 0; |
| 139 | 133 |
| 140 protected: | 134 protected: |
| 141 virtual ~WebGraphicsSwapBuffersCompleteCallbackCHROMIUM() { } | 135 virtual ~WebGraphicsSwapBuffersCompleteCallbackCHROMIUM() { } |
| 142 }; | 136 }; |
| 143 | 137 |
| 144 // This destructor needs to be public so that using classes can destroy inst
ances if initialization fails. | 138 // This destructor needs to be public so that using classes can destroy inst
ances if initialization fails. |
| 145 virtual ~WebGraphicsContext3D() { } | 139 virtual ~WebGraphicsContext3D() { } |
| 146 | 140 |
| 147 // Makes the OpenGL context current on the current thread. Returns true on | |
| 148 // success. | |
| 149 virtual bool makeContextCurrent() = 0; | |
| 150 | |
| 151 // Each flush or finish is assigned an unique ID. The larger | 141 // Each flush or finish is assigned an unique ID. The larger |
| 152 // the ID number, the more recently the context has been flushed. | 142 // the ID number, the more recently the context has been flushed. |
| 153 virtual uint32_t lastFlushID() { return 0; } | 143 virtual uint32_t lastFlushID() { return 0; } |
| 154 | 144 |
| 155 // Resizes the region into which this WebGraphicsContext3D is drawing. | 145 // Resizes the region into which this WebGraphicsContext3D is drawing. |
| 156 virtual void reshapeWithScaleFactor(int width, int height, float scaleFactor
) { } | 146 virtual void reshapeWithScaleFactor(int width, int height, float scaleFactor
) { } |
| 157 | 147 |
| 158 // GL_CHROMIUM_setVisibility - Changes the visibility of the backbuffer | 148 // GL_CHROMIUM_setVisibility - Changes the visibility of the backbuffer |
| 159 virtual void setVisibilityCHROMIUM(bool visible) = 0; | 149 virtual void setVisibilityCHROMIUM(bool visible) = 0; |
| 160 | 150 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 virtual void vertexAttribDivisorANGLE(WGC3Duint index, WGC3Duint divisor) {
} | 463 virtual void vertexAttribDivisorANGLE(WGC3Duint index, WGC3Duint divisor) {
} |
| 474 | 464 |
| 475 // GL_EXT_multisampled_render_to_texture | 465 // GL_EXT_multisampled_render_to_texture |
| 476 virtual void framebufferTexture2DMultisampleEXT(WGC3Denum target, WGC3Denum
attachment, WGC3Denum textarget, WebGLId texture, WGC3Dint level, WGC3Dsizei sam
ples) { } | 466 virtual void framebufferTexture2DMultisampleEXT(WGC3Denum target, WGC3Denum
attachment, WGC3Denum textarget, WebGLId texture, WGC3Dint level, WGC3Dsizei sam
ples) { } |
| 477 virtual void renderbufferStorageMultisampleEXT(WGC3Denum target, WGC3Dsizei
samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { }; | 467 virtual void renderbufferStorageMultisampleEXT(WGC3Denum target, WGC3Dsizei
samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { }; |
| 478 }; | 468 }; |
| 479 | 469 |
| 480 } // namespace blink | 470 } // namespace blink |
| 481 | 471 |
| 482 #endif | 472 #endif |
| OLD | NEW |