Classes |
| struct | ExtensionBitset |
| struct | RectTriangles |
| | Helper for DecomposeIntoNoRepeatTriangles. More...
|
Public Types |
| enum | GLContextType {
ContextTypeUnknown,
ContextTypeWGL,
ContextTypeCGL,
ContextTypeGLX,
ContextTypeEGL,
ContextTypeOSMesa
} |
| enum | NativeDataType { NativeGLContext,
NativeImageSurface,
NativeThebesSurface,
NativeDataTypeMax
} |
| enum | {
VendorIntel,
VendorNVIDIA,
VendorATI,
VendorQualcomm,
VendorOther
} |
| enum | GLExtensions {
EXT_framebuffer_object,
ARB_framebuffer_object,
ARB_texture_rectangle,
EXT_bgra,
EXT_texture_format_BGRA8888,
OES_depth24,
OES_depth32,
OES_stencil8,
OES_texture_npot,
OES_depth_texture,
OES_packed_depth_stencil,
IMG_read_format,
EXT_read_format_bgra,
APPLE_client_storage,
ARB_texture_non_power_of_two,
ARB_pixel_buffer_object,
Extensions_Max
} |
| | Known GL extensions that can be queried by IsExtensionSupported.
More...
|
Public Member Functions |
| nsrefcnt | AddRef (void) |
| nsrefcnt | Release (void) |
| | GLContext (const ContextFormat &aFormat, PRBool aIsOffscreen=0, GLContext *aSharedContext=0L) |
| virtual | ~GLContext () |
| virtual GLContextType | GetContextType () |
| virtual PRBool | MakeCurrentImpl (PRBool aForce=0)=0 |
| PRBool | MakeCurrent (PRBool aForce=0) |
| virtual PRBool | SetupLookupFunction ()=0 |
| virtual void | WindowDestroyed () |
| void * | GetUserData (void *aKey) |
| void | SetUserData (void *aKey, void *aValue) |
| void | MarkDestroyed () |
| PRBool | IsDestroyed () |
| virtual void * | GetNativeData (NativeDataType aType) |
| GLContext * | GetSharedContext () |
| PRBool | IsGlobalSharedContext () |
| void | SetIsGlobalSharedContext (PRBool aIsOne) |
| const ContextFormat & | CreationFormat () |
| const ContextFormat & | ActualFormat () |
| virtual void * | GetD3DShareHandle () |
| | If this GL context has a D3D texture share handle, returns non-null.
|
| virtual PRBool | IsDoubleBuffered () |
| | If this context is double-buffered, returns TRUE.
|
| PRBool | IsGLES2 () |
| | If this context is the GLES2 API, returns TRUE.
|
| int | Vendor () const |
| PRBool | IsWindowOriginBottomLeft () |
| | Returns PR_TRUE if the window coordinate origin is the bottom left corener.
|
| nsIntRect & | FixWindowCoordinateRect (nsIntRect &aRect, int aWindowHeight) |
| | Fix up the rectangle given in aRect, taking into account window height aWindowHeight and whether windows have their natural origin in the bottom left or not.
|
| virtual PRBool | SwapBuffers () |
| | If this context wraps a double-buffered target, swap the back and front buffers.
|
| virtual PRBool | BindTexImage () |
| | Defines a two-dimensional texture image for context target surface.
|
| virtual PRBool | ReleaseTexImage () |
| virtual PRBool | BindOffscreenNeedsTexture (GLContext *aOffscreen) |
| virtual PRBool | BindTex2DOffscreen (GLContext *aOffscreen) |
| virtual void | UnbindTex2DOffscreen (GLContext *aOffscreen) |
| PRBool | IsOffscreen () |
| virtual PRBool | ResizeOffscreen (const gfxIntSize &aNewSize) |
| gfxIntSize | OffscreenSize () |
| gfxIntSize | OffscreenActualSize () |
| GLuint | GetOffscreenFBO () |
| GLuint | GetOffscreenTexture () |
| virtual PRBool | TextureImageSupportsGetBackingSurface () |
| virtual PRBool | RenewSurface () |
virtual already_AddRefed
< TextureImage > | CreateTextureImage (const nsIntSize &aSize, TextureImage::ContentType aContentType, GLenum aWrapMode, PRBool aUseNearestFilter=0) |
| | ` Return a valid, allocated TextureImage of |aSize| with |aContentType|.
|
| already_AddRefed< gfxImageSurface > | ReadTextureImage (GLuint aTexture, const gfxIntSize &aSize, GLenum aTextureFormat) |
| | Read the image data contained in aTexture, and return it as an ImageSurface.
|
| void | ReadPixelsIntoImageSurface (GLint aX, GLint aY, GLsizei aWidth, GLsizei aHeight, gfxImageSurface *aDest) |
| | Call ReadPixels into an existing gfxImageSurface for the given bounds.
|
| void | BlitTextureImage (TextureImage *aSrc, const nsIntRect &aSrcRect, TextureImage *aDst, const nsIntRect &aDstRect) |
| | Copy a rectangle from one TextureImage into another.
|
| ShaderProgramType | UploadSurfaceToTexture (gfxASurface *aSurface, const nsIntRegion &aDstRegion, GLuint &aTexture, bool aOverwrite=false, const nsIntPoint &aSrcPoint=nsIntPoint(0, 0), bool aPixelBuffer=0) |
| | Creates a RGB/RGBA texture (or uses one provided) and uploads the surface contents to it within aSrcRect.
|
| virtual ShaderProgramType | UploadSurfaceToTextureExternal (gfxASurface *aSurface, const nsIntRect &aSrcRect, GLuint &aTexture, bool aOverwrite=false, const nsIntPoint &aDstPoint=nsIntPoint(0, 0), bool aPixelBuffer=0) |
| PRBool | IsExtensionSupported (GLExtensions aKnownExtension) |
| GLint | GetMaxTextureSize () |
| GLenum | fGetError () |
| void | fScissor (GLint x, GLint y, GLsizei width, GLsizei height) |
| nsIntRect & | ScissorRect () |
| void | PushScissorRect () |
| void | PushScissorRect (const nsIntRect &aRect) |
| void | PopScissorRect () |
| void | fViewport (GLint x, GLint y, GLsizei width, GLsizei height) |
| nsIntRect & | ViewportRect () |
| void | PushViewportRect () |
| void | PushViewportRect (const nsIntRect &aRect) |
| void | PopViewportRect () |
| void | fActiveTexture (GLenum texture) |
| void | fAttachShader (GLuint program, GLuint shader) |
| void | fBindAttribLocation (GLuint program, GLuint index, const GLchar *name) |
| void | fBindBuffer (GLenum target, GLuint buffer) |
| void | fBindTexture (GLenum target, GLuint texture) |
| void | fBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) |
| void | fBlendEquation (GLenum mode) |
| void | fBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha) |
| void | fBlendFunc (GLenum sfactor, GLenum dfactor) |
| void | fBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) |
| void | fBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) |
| void | fBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) |
| void | fClear (GLbitfield mask) |
| void | fClearColor (GLclampf r, GLclampf g, GLclampf b, GLclampf a) |
| void | fClearStencil (GLint s) |
| void | fColorMask (realGLboolean red, realGLboolean green, realGLboolean blue, realGLboolean alpha) |
| void | fCullFace (GLenum mode) |
| void | fDetachShader (GLuint program, GLuint shader) |
| void | fDepthFunc (GLenum func) |
| void | fDepthMask (realGLboolean flag) |
| void | fDisable (GLenum capability) |
| void | fDisableVertexAttribArray (GLuint index) |
| void | fDrawArrays (GLenum mode, GLint first, GLsizei count) |
| void | fDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) |
| void | fEnable (GLenum capability) |
| void | fEnableVertexAttribArray (GLuint index) |
| void | fFinish () |
| void | fFlush () |
| void | fFrontFace (GLenum face) |
| void | fGetActiveAttrib (GLuint program, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLchar *name) |
| void | fGetActiveUniform (GLuint program, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLchar *name) |
| void | fGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders) |
| GLint | fGetAttribLocation (GLuint program, const GLchar *name) |
| void | fGetIntegerv (GLenum pname, GLint *params) |
| void | fGetFloatv (GLenum pname, GLfloat *params) |
| void | fGetBooleanv (GLenum pname, realGLboolean *params) |
| void | fGetBufferParameteriv (GLenum target, GLenum pname, GLint *params) |
| void | fGenerateMipmap (GLenum target) |
| void | fGetProgramiv (GLuint program, GLenum pname, GLint *param) |
| void | fGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog) |
| void | fTexParameteri (GLenum target, GLenum pname, GLint param) |
| void | fTexParameterf (GLenum target, GLenum pname, GLfloat param) |
| const GLubyte * | fGetString (GLenum name) |
| void | fGetTexParameterfv (GLenum target, GLenum pname, const GLfloat *params) |
| void | fGetTexParameteriv (GLenum target, GLenum pname, const GLint *params) |
| void | fGetUniformfv (GLuint program, GLint location, GLfloat *params) |
| void | fGetUniformiv (GLuint program, GLint location, GLint *params) |
| GLint | fGetUniformLocation (GLint programObj, const GLchar *name) |
| void | fGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *retval) |
| void | fGetVertexAttribiv (GLuint index, GLenum pname, GLint *retval) |
| void | fHint (GLenum target, GLenum mode) |
| realGLboolean | fIsBuffer (GLuint buffer) |
| realGLboolean | fIsEnabled (GLenum capability) |
| realGLboolean | fIsProgram (GLuint program) |
| realGLboolean | fIsShader (GLuint shader) |
| realGLboolean | fIsTexture (GLuint texture) |
| void | fLineWidth (GLfloat width) |
| void | fLinkProgram (GLuint program) |
| void | fPixelStorei (GLenum pname, GLint param) |
| void | fPolygonOffset (GLfloat factor, GLfloat bias) |
| void | fReadBuffer (GLenum mode) |
| void | fReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) |
| void | fSampleCoverage (GLclampf value, realGLboolean invert) |
| void | fStencilFunc (GLenum func, GLint ref, GLuint mask) |
| void | fStencilFuncSeparate (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) |
| void | fStencilMask (GLuint mask) |
| void | fStencilMaskSeparate (GLenum face, GLuint mask) |
| void | fStencilOp (GLenum fail, GLenum zfail, GLenum zpass) |
| void | fStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) |
| void | fTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) |
| void | fTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) |
| void | fUniform1f (GLint location, GLfloat v0) |
| void | fUniform1fv (GLint location, GLsizei count, const GLfloat *value) |
| void | fUniform1i (GLint location, GLint v0) |
| void | fUniform1iv (GLint location, GLsizei count, const GLint *value) |
| void | fUniform2f (GLint location, GLfloat v0, GLfloat v1) |
| void | fUniform2fv (GLint location, GLsizei count, const GLfloat *value) |
| void | fUniform2i (GLint location, GLint v0, GLint v1) |
| void | fUniform2iv (GLint location, GLsizei count, const GLint *value) |
| void | fUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2) |
| void | fUniform3fv (GLint location, GLsizei count, const GLfloat *value) |
| void | fUniform3i (GLint location, GLint v0, GLint v1, GLint v2) |
| void | fUniform3iv (GLint location, GLsizei count, const GLint *value) |
| void | fUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) |
| void | fUniform4fv (GLint location, GLsizei count, const GLfloat *value) |
| void | fUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3) |
| void | fUniform4iv (GLint location, GLsizei count, const GLint *value) |
| void | fUniformMatrix2fv (GLint location, GLsizei count, realGLboolean transpose, const GLfloat *value) |
| void | fUniformMatrix3fv (GLint location, GLsizei count, realGLboolean transpose, const GLfloat *value) |
| void | fUniformMatrix4fv (GLint location, GLsizei count, realGLboolean transpose, const GLfloat *value) |
| void | fUseProgram (GLuint program) |
| void | fValidateProgram (GLuint program) |
| void | fVertexAttribPointer (GLuint index, GLint size, GLenum type, realGLboolean normalized, GLsizei stride, const GLvoid *pointer) |
| void | fVertexAttrib1f (GLuint index, GLfloat x) |
| void | fVertexAttrib2f (GLuint index, GLfloat x, GLfloat y) |
| void | fVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z) |
| void | fVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) |
| void | fVertexAttrib1fv (GLuint index, const GLfloat *v) |
| void | fVertexAttrib2fv (GLuint index, const GLfloat *v) |
| void | fVertexAttrib3fv (GLuint index, const GLfloat *v) |
| void | fVertexAttrib4fv (GLuint index, const GLfloat *v) |
| void | fCompileShader (GLuint shader) |
| void | fCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) |
| void | fCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) |
| void | fGetShaderiv (GLuint shader, GLenum pname, GLint *param) |
| void | fGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) |
| void | fGetShaderSource (GLint obj, GLsizei maxLength, GLsizei *length, GLchar *source) |
| void | fShaderSource (GLuint shader, GLsizei count, const GLchar **strings, const GLint *lengths) |
| void | fBindFramebuffer (GLenum target, GLuint framebuffer) |
| void | fBindRenderbuffer (GLenum target, GLuint renderbuffer) |
| GLenum | fCheckFramebufferStatus (GLenum target) |
| void | fFramebufferRenderbuffer (GLenum target, GLenum attachmentPoint, GLenum renderbufferTarget, GLuint renderbuffer) |
| void | fFramebufferTexture2D (GLenum target, GLenum attachmentPoint, GLenum textureTarget, GLuint texture, GLint level) |
| void | fGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *value) |
| void | fGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *value) |
| realGLboolean | fIsFramebuffer (GLuint framebuffer) |
| realGLboolean | fIsRenderbuffer (GLuint renderbuffer) |
| void | fRenderbufferStorage (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height) |
| void | fDepthRange (GLclampf a, GLclampf b) |
| void | fClearDepth (GLclampf v) |
| void * | fMapBuffer (GLenum target, GLenum access) |
| realGLboolean | fUnmapBuffer (GLenum target) |
| GLuint | fCreateProgram () |
| GLuint | fCreateShader (GLenum t) |
| void | fGenBuffers (GLsizei n, GLuint *names) |
| void | fGenTextures (GLsizei n, GLuint *names) |
| void | fGenFramebuffers (GLsizei n, GLuint *names) |
| void | fGenRenderbuffers (GLsizei n, GLuint *names) |
| void | fDeleteProgram (GLuint program) |
| void | fDeleteShader (GLuint shader) |
| void | fDeleteBuffers (GLsizei n, GLuint *names) |
| void | fDeleteTextures (GLsizei n, GLuint *names) |
| void | fDeleteFramebuffers (GLsizei n, GLuint *names) |
| void | fDeleteRenderbuffers (GLsizei n, GLuint *names) |
Static Public Member Functions |
| static void | DecomposeIntoNoRepeatTriangles (const nsIntRect &aTexCoordRect, const nsIntSize &aTexSize, RectTriangles &aRects) |
| | Decompose drawing the possibly-wrapped aTexCoordRect rectangle of a texture of aTexSize into one or more rectangles (represented as 2 triangles) and associated tex coordinates, such that we don't have to use the REPEAT wrap mode.
|
| static PRBool | ListHasExtension (const GLubyte *extensions, const char *extension) |
Protected Types |
| enum | { DebugEnabled = 1 << 0,
DebugTrace = 1 << 1,
DebugAbortOnError = 1 << 2
} |
Protected Member Functions |
| void | UpdateActualFormat () |
| void | UseBlitProgram () |
| void | SetBlitFramebufferForDestTexture (GLuint aTexture) |
| PRBool | ResizeOffscreenFBO (const gfxIntSize &aSize) |
| void | DeleteOffscreenFBO () |
| void | ClearSafely () |
| void | SetIsGLES2 (PRBool aIsGLES2) |
| PRBool | InitWithPrefix (const char *prefix, PRBool trygl) |
| void | InitExtensions () |
| PRBool | IsExtensionSupported (const char *extension) |
virtual already_AddRefed
< TextureImage > | CreateBasicTextureImage (GLuint aTexture, const nsIntSize &aSize, GLenum aWrapMode, TextureImage::ContentType aContentType, GLContext *aContext) |
| void | raw_fScissor (GLint x, GLint y, GLsizei width, GLsizei height) |
| void | raw_fViewport (GLint x, GLint y, GLsizei width, GLsizei height) |
Protected Attributes |
| nsAutoRefCnt | mRefCnt |
| PRPackedBool | mInitialized |
| PRPackedBool | mIsOffscreen |
| PRPackedBool | mIsGLES2 |
| PRPackedBool | mIsGlobalSharedContext |
| PRPackedBool | mWindowOriginBottomLeft |
| PRInt32 | mVendor |
| PRUint32 | mDebugMode |
| ContextFormat | mCreationFormat |
| nsRefPtr< GLContext > | mSharedContext |
| GLContextSymbols | mSymbols |
| ContextFormat | mActualFormat |
| gfxIntSize | mOffscreenSize |
| gfxIntSize | mOffscreenActualSize |
| GLuint | mOffscreenTexture |
| GLuint | mBlitProgram |
| GLuint | mBlitFramebuffer |
| GLuint | mOffscreenFBO |
| GLuint | mOffscreenDepthRB |
| GLuint | mOffscreenStencilRB |
| ExtensionBitset< Extensions_Max > | mAvailableExtensions |
nsDataHashtable
< nsVoidPtrHashKey, void * > | mUserData |
| nsTArray< nsIntRect > | mViewportStack |
| nsTArray< nsIntRect > | mScissorStack |
| GLint | mMaxTextureSize |