diff options
Diffstat (limited to 'WebCore/html/canvas/CanvasObject.h')
-rw-r--r-- | WebCore/html/canvas/CanvasObject.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/WebCore/html/canvas/CanvasObject.h b/WebCore/html/canvas/CanvasObject.h index 748278d..b7b016a 100644 --- a/WebCore/html/canvas/CanvasObject.h +++ b/WebCore/html/canvas/CanvasObject.h @@ -33,14 +33,14 @@ namespace WebCore { - class CanvasRenderingContext3D; + class WebGLRenderingContext; class CanvasObject : public RefCounted<CanvasObject> { public: virtual ~CanvasObject(); Platform3DObject object() const { return m_object; } - void setObject(Platform3DObject); + void setObject(Platform3DObject, bool shouldDeleteObject = true); void deleteObject(); void detachContext() @@ -49,15 +49,22 @@ namespace WebCore { m_context = 0; } - CanvasRenderingContext3D* context() const { return m_context; } + WebGLRenderingContext* context() const { return m_context; } protected: - CanvasObject(CanvasRenderingContext3D*); + CanvasObject(WebGLRenderingContext*); virtual void _deleteObject(Platform3DObject) = 0; private: Platform3DObject m_object; - CanvasRenderingContext3D* m_context; + // The shouldDeleteObject flag indicates whether this wrapper + // owns the underlying resource and should delete it when the + // wrapper is unreferenced for the last time and deleted. It + // is only set to false for certain objects returned from get + // queries. FIXME: should consider canonicalizing all of these + // objects in the future. + bool m_shouldDeleteObject; + WebGLRenderingContext* m_context; }; } // namespace WebCore |