diff options
Diffstat (limited to 'WebCore/html/canvas/WebGLRenderingContext.h')
-rw-r--r-- | WebCore/html/canvas/WebGLRenderingContext.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h index 48fa7c8..66ec8d8 100644 --- a/WebCore/html/canvas/WebGLRenderingContext.h +++ b/WebCore/html/canvas/WebGLRenderingContext.h @@ -35,6 +35,8 @@ #include "Uint8Array.h" #include "WebGLGetInfo.h" +#include <wtf/OwnArrayPtr.h> + namespace WebCore { class WebGLActiveInfo; @@ -49,7 +51,9 @@ class WebGLTexture; class WebGLUniformLocation; class HTMLImageElement; class HTMLVideoElement; +class ImageBuffer; class ImageData; +class IntSize; class WebKitCSSMatrix; class WebGLRenderingContext : public CanvasRenderingContext { @@ -281,8 +285,6 @@ public: void removeObject(WebGLObject*); - bool paintsIntoCanvasBuffer() const { return m_context->paintsIntoCanvasBuffer(); } - private: friend class WebGLObject; @@ -303,6 +305,8 @@ public: } bool isGLES2Compliant(); + bool isGLES2NPOTStrict(); + bool isErrorGeneratedOnOutOfBoundsAccesses(); // Helper to return the size in bytes of OpenGL data types // like GL_FLOAT, GL_INT, etc. @@ -320,6 +324,8 @@ public: bool validateWebGLObject(WebGLObject* object); + PassRefPtr<Image> videoFrameToImage(HTMLVideoElement* video); + OwnPtr<GraphicsContext3D> m_context; bool m_needsUpdate; bool m_markedCanvasDirty; @@ -387,6 +393,19 @@ public: RefPtr<WebGLTexture> m_blackTexture2D; RefPtr<WebGLTexture> m_blackTextureCubeMap; + // Fixed-size cache of reusable image buffers for video texImage2D calls. + class LRUImageBufferCache { + public: + LRUImageBufferCache(int capacity); + // The pointer returned is owned by the image buffer map. + ImageBuffer* imageBuffer(const IntSize& size); + private: + void bubbleToFront(int idx); + OwnArrayPtr<OwnPtr<ImageBuffer> > m_buffers; + int m_capacity; + }; + LRUImageBufferCache m_videoCache; + int m_maxTextureSize; int m_maxCubeMapTextureSize; int m_maxTextureLevel; |