[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
zmo at google.com
zmo at google.com
Wed Dec 22 16:13:50 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 70c80adaddf3f4b59e7ff0a599b7417532e16b4c
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 19 21:48:46 2010 +0000
2010-11-18 Zhenyao Mo <zmo at google.com>
Reviewed by Kenneth Russell.
Make sure is* return false if the name is never bound
https://bugs.webkit.org/show_bug.cgi?id=49767
* html/canvas/WebGLBuffer.h: Add function to check whether the buffer has been bound before.
(WebCore::WebGLBuffer::hasEverBeenBound):
* html/canvas/WebGLFramebuffer.cpp: Ditto.
(WebCore::WebGLFramebuffer::WebGLFramebuffer):
* html/canvas/WebGLFramebuffer.h: Ditto.
(WebCore::WebGLFramebuffer::hasEverBeenBound):
(WebCore::WebGLFramebuffer::setBound):
* html/canvas/WebGLRenderbuffer.cpp: Ditto.
(WebCore::WebGLRenderbuffer::WebGLRenderbuffer):
* html/canvas/WebGLRenderbuffer.h: Ditto.
(WebCore::WebGLRenderbuffer::hasEverBeenBound):
(WebCore::WebGLRenderbuffer::setBound):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::bindFramebuffer): Set bound status to true.
(WebCore::WebGLRenderingContext::bindRenderbuffer): Ditto.
(WebCore::WebGLRenderingContext::isBuffer): Return false if it's never bound.
(WebCore::WebGLRenderingContext::isFramebuffer): Ditto.
(WebCore::WebGLRenderingContext::isRenderbuffer): Ditto.
(WebCore::WebGLRenderingContext::isTexture): Ditto.
* html/canvas/WebGLTexture.h: Add function to check whether the texture has been bound before.
(WebCore::WebGLTexture::hasEverBeenBound):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 59d40d6..e0006ad 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,32 @@
+2010-11-18 Zhenyao Mo <zmo at google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Make sure is* return false if the name is never bound
+ https://bugs.webkit.org/show_bug.cgi?id=49767
+
+ * html/canvas/WebGLBuffer.h: Add function to check whether the buffer has been bound before.
+ (WebCore::WebGLBuffer::hasEverBeenBound):
+ * html/canvas/WebGLFramebuffer.cpp: Ditto.
+ (WebCore::WebGLFramebuffer::WebGLFramebuffer):
+ * html/canvas/WebGLFramebuffer.h: Ditto.
+ (WebCore::WebGLFramebuffer::hasEverBeenBound):
+ (WebCore::WebGLFramebuffer::setBound):
+ * html/canvas/WebGLRenderbuffer.cpp: Ditto.
+ (WebCore::WebGLRenderbuffer::WebGLRenderbuffer):
+ * html/canvas/WebGLRenderbuffer.h: Ditto.
+ (WebCore::WebGLRenderbuffer::hasEverBeenBound):
+ (WebCore::WebGLRenderbuffer::setBound):
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::bindFramebuffer): Set bound status to true.
+ (WebCore::WebGLRenderingContext::bindRenderbuffer): Ditto.
+ (WebCore::WebGLRenderingContext::isBuffer): Return false if it's never bound.
+ (WebCore::WebGLRenderingContext::isFramebuffer): Ditto.
+ (WebCore::WebGLRenderingContext::isRenderbuffer): Ditto.
+ (WebCore::WebGLRenderingContext::isTexture): Ditto.
+ * html/canvas/WebGLTexture.h: Add function to check whether the texture has been bound before.
+ (WebCore::WebGLTexture::hasEverBeenBound):
+
2010-11-19 Benjamin Poulain <benjamin.poulain at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/html/canvas/WebGLBuffer.h b/WebCore/html/canvas/WebGLBuffer.h
index f18a9bf..af819a3 100644
--- a/WebCore/html/canvas/WebGLBuffer.h
+++ b/WebCore/html/canvas/WebGLBuffer.h
@@ -59,6 +59,8 @@ public:
unsigned long getTarget() const { return m_target; }
void setTarget(unsigned long);
+ bool hasEverBeenBound() const { return object() && m_target; }
+
protected:
WebGLBuffer(WebGLRenderingContext*);
diff --git a/WebCore/html/canvas/WebGLFramebuffer.cpp b/WebCore/html/canvas/WebGLFramebuffer.cpp
index 5bf3779..9e2db56 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.cpp
+++ b/WebCore/html/canvas/WebGLFramebuffer.cpp
@@ -75,6 +75,7 @@ PassRefPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRenderingContext* ctx
WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContext* ctx)
: WebGLObject(ctx)
+ , m_hasEverBeenBound(false)
{
setObject(context()->graphicsContext3D()->createFramebuffer());
}
diff --git a/WebCore/html/canvas/WebGLFramebuffer.h b/WebCore/html/canvas/WebGLFramebuffer.h
index 394b770..b86417d 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.h
+++ b/WebCore/html/canvas/WebGLFramebuffer.h
@@ -56,6 +56,10 @@ public:
// Return false does not mean COMPLETE, might still be INCOMPLETE.
bool isIncomplete(bool checkInternalFormat) const;
+ bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; }
+
+ void setHasEverBeenBound() { m_hasEverBeenBound = true; }
+
protected:
WebGLFramebuffer(WebGLRenderingContext*);
@@ -76,6 +80,8 @@ private:
RefPtr<WebGLObject> m_depthAttachment;
RefPtr<WebGLObject> m_stencilAttachment;
RefPtr<WebGLObject> m_depthStencilAttachment;
+
+ bool m_hasEverBeenBound;
};
} // namespace WebCore
diff --git a/WebCore/html/canvas/WebGLRenderbuffer.cpp b/WebCore/html/canvas/WebGLRenderbuffer.cpp
index b9efd47..0c3ac84 100644
--- a/WebCore/html/canvas/WebGLRenderbuffer.cpp
+++ b/WebCore/html/canvas/WebGLRenderbuffer.cpp
@@ -45,6 +45,7 @@ WebGLRenderbuffer::WebGLRenderbuffer(WebGLRenderingContext* ctx)
, m_width(0)
, m_height(0)
, m_isValid(true)
+ , m_hasEverBeenBound(false)
{
setObject(context()->graphicsContext3D()->createRenderbuffer());
}
diff --git a/WebCore/html/canvas/WebGLRenderbuffer.h b/WebCore/html/canvas/WebGLRenderbuffer.h
index 9a23ca5..a432f9d 100644
--- a/WebCore/html/canvas/WebGLRenderbuffer.h
+++ b/WebCore/html/canvas/WebGLRenderbuffer.h
@@ -60,6 +60,10 @@ public:
bool isInitialized() const { return m_initialized; }
void setInitialized() { m_initialized = true; }
+ bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; }
+
+ void setHasEverBeenBound() { m_hasEverBeenBound = true; }
+
protected:
WebGLRenderbuffer(WebGLRenderingContext*);
@@ -72,6 +76,8 @@ private:
bool m_initialized;
unsigned long m_width, m_height;
bool m_isValid; // This is only false if internalFormat is DEPTH_STENCIL and packed_depth_stencil is not supported.
+
+ bool m_hasEverBeenBound;
};
} // namespace WebCore
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 7d20afe..0f4e65a 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -310,6 +310,8 @@ void WebGLRenderingContext::bindFramebuffer(unsigned long target, WebGLFramebuff
}
m_framebufferBinding = buffer;
m_context->bindFramebuffer(target, objectOrZero(buffer));
+ if (buffer)
+ buffer->setHasEverBeenBound();
cleanupAfterGraphicsCall(false);
}
@@ -328,6 +330,8 @@ void WebGLRenderingContext::bindRenderbuffer(unsigned long target, WebGLRenderbu
}
m_renderbufferBinding = renderBuffer;
m_context->bindRenderbuffer(target, objectOrZero(renderBuffer));
+ if (renderBuffer)
+ renderBuffer->setHasEverBeenBound();
cleanupAfterGraphicsCall(false);
}
@@ -2080,6 +2084,9 @@ bool WebGLRenderingContext::isBuffer(WebGLBuffer* buffer)
if (!buffer || isContextLost())
return false;
+ if (!buffer->hasEverBeenBound())
+ return false;
+
return m_context->isBuffer(buffer->object());
}
@@ -2100,6 +2107,9 @@ bool WebGLRenderingContext::isFramebuffer(WebGLFramebuffer* framebuffer)
if (!framebuffer || isContextLost())
return false;
+ if (!framebuffer->hasEverBeenBound())
+ return false;
+
return m_context->isFramebuffer(framebuffer->object());
}
@@ -2116,6 +2126,9 @@ bool WebGLRenderingContext::isRenderbuffer(WebGLRenderbuffer* renderbuffer)
if (!renderbuffer || isContextLost())
return false;
+ if (!renderbuffer->hasEverBeenBound())
+ return false;
+
return m_context->isRenderbuffer(renderbuffer->object());
}
@@ -2132,6 +2145,9 @@ bool WebGLRenderingContext::isTexture(WebGLTexture* texture)
if (!texture || isContextLost())
return false;
+ if (!texture->hasEverBeenBound())
+ return false;
+
return m_context->isTexture(texture->object());
}
diff --git a/WebCore/html/canvas/WebGLTexture.h b/WebCore/html/canvas/WebGLTexture.h
index 6ee3dcc..493ef7e 100644
--- a/WebCore/html/canvas/WebGLTexture.h
+++ b/WebCore/html/canvas/WebGLTexture.h
@@ -61,6 +61,8 @@ public:
// Determine if texture sampling should always return [0, 0, 0, 1] (OpenGL ES 2.0 Sec 3.8.2).
bool needToUseBlackTexture() const;
+ bool hasEverBeenBound() const { return object() && m_target; }
+
static int computeLevelCount(int width, int height);
protected:
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list