From f486d19d62f1bc33246748b14b14a9dfa617b57f Mon Sep 17 00:00:00 2001 From: Iain Merrick Date: Thu, 19 Aug 2010 17:55:56 +0100 Subject: Merge WebKit at r65615 : Initial merge by git. Change-Id: Ifbf384f4531e3b58475a662e38195c2d9152ae79 --- WebCore/html/canvas/WebGLObject.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'WebCore/html/canvas/WebGLObject.cpp') diff --git a/WebCore/html/canvas/WebGLObject.cpp b/WebCore/html/canvas/WebGLObject.cpp index 6a34269..5fd5534 100644 --- a/WebCore/html/canvas/WebGLObject.cpp +++ b/WebCore/html/canvas/WebGLObject.cpp @@ -35,8 +35,9 @@ namespace WebCore { WebGLObject::WebGLObject(WebGLRenderingContext* context) : m_object(0) - , m_shouldDeleteObject(true) , m_context(context) + , m_attachmentCount(0) + , m_deleted(false) { } @@ -46,27 +47,26 @@ WebGLObject::~WebGLObject() m_context->removeObject(this); } -void WebGLObject::setObject(Platform3DObject object, bool shouldDeleteObject) +void WebGLObject::setObject(Platform3DObject object) { if (object == m_object) return; deleteObject(); m_object = object; - m_shouldDeleteObject = shouldDeleteObject; } void WebGLObject::deleteObject() { if (m_object) { - if (m_shouldDeleteObject) - if (m_context) { - m_context->graphicsContext3D()->makeContextCurrent(); - deleteObjectImpl(m_object); - } - m_object = 0; + if (m_context) { + m_context->graphicsContext3D()->makeContextCurrent(); + deleteObjectImpl(m_object); + } + if (!m_attachmentCount) + m_object = 0; + m_deleted = true; } - m_shouldDeleteObject = true; } } -- cgit v1.1