diff options
Diffstat (limited to 'Source/WebCore/html/canvas/WebGLProgram.h')
-rw-r--r-- | Source/WebCore/html/canvas/WebGLProgram.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/WebCore/html/canvas/WebGLProgram.h b/Source/WebCore/html/canvas/WebGLProgram.h index 0dd3ba0..13a5bdd 100644 --- a/Source/WebCore/html/canvas/WebGLProgram.h +++ b/Source/WebCore/html/canvas/WebGLProgram.h @@ -42,23 +42,21 @@ public: static PassRefPtr<WebGLProgram> create(WebGLRenderingContext*); - // cacheActiveAttribLocation() is only called once after linkProgram() - // succeeds. - bool cacheActiveAttribLocations(); - unsigned numActiveAttribLocations() const; - GC3Dint getActiveAttribLocation(GC3Duint index) const; + unsigned numActiveAttribLocations(); + GC3Dint getActiveAttribLocation(GC3Duint index); - bool isUsingVertexAttrib0() const; + bool isUsingVertexAttrib0(); - bool getLinkStatus() const { return m_linkStatus; } - void setLinkStatus(bool status) { m_linkStatus = status; } + bool getLinkStatus(); + void setLinkStatus(bool); unsigned getLinkCount() const { return m_linkCount; } // This is to be called everytime after the program is successfully linked. // We don't deal with integer overflow here, assuming in reality a program // will never be linked so many times. - void increaseLinkCount() { ++m_linkCount; } + // Also, we invalidate the cached program info. + void increaseLinkCount(); WebGLShader* getAttachedShader(GC3Denum); bool attachShader(WebGLShader*); @@ -72,6 +70,9 @@ protected: private: virtual bool isProgram() const { return true; } + void cacheActiveAttribLocations(GraphicsContext3D*); + void cacheInfoIfNeeded(); + Vector<GC3Dint> m_activeAttribLocations; GC3Dint m_linkStatus; @@ -82,6 +83,8 @@ private: RefPtr<WebGLShader> m_vertexShader; RefPtr<WebGLShader> m_fragmentShader; + + bool m_infoValid; }; } // namespace WebCore |