[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 15:55:41 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit aa3d3cf57fa1623976292bcb04cc4415d27d6418
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 16 19:30:32 2010 +0000
2010-11-12 Zhenyao Mo <zmo at google.com>
Reviewed by Kenneth Russell.
Refactor GL backend flags
https://bugs.webkit.org/show_bug.cgi?id=49460
* public/WebGraphicsContext3D.h: Remove GL flag queries at this level.
* src/GraphicsContext3DChromium.cpp: Ditto.
* src/GraphicsContext3DInternal.h: Ditto.
* src/WebGraphicsContext3DDefaultImpl.cpp: Ditto.
* src/WebGraphicsContext3DDefaultImpl.h: Ditto.
2010-11-12 Zhenyao Mo <zmo at google.com>
Reviewed by Kenneth Russell.
Refactor GL backend flags
https://bugs.webkit.org/show_bug.cgi?id=49460
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::WebGLRenderingContext): Call setupFlags().
(WebCore::WebGLRenderingContext::initializeNewContext): Remove flag initialization to setupFlags().
(WebCore::WebGLRenderingContext::setupFlags): Initialize GL flags.
(WebCore::WebGLRenderingContext::getRenderbufferParameter): Use accessor function instead of member.
(WebCore::WebGLRenderingContext::renderbufferStorage): Ditto.
* html/canvas/WebGLRenderingContext.h: Use flags set in setupFlags instead of querying underlying GL implementation.
(WebCore::WebGLRenderingContext::isGLES2Compliant):
(WebCore::WebGLRenderingContext::isGLES2NPOTStrict):
(WebCore::WebGLRenderingContext::isErrorGeneratedOnOutOfBoundsAccesses):
(WebCore::WebGLRenderingContext::isResourceSafe):
(WebCore::WebGLRenderingContext::isDepthStencilSupported):
* platform/graphics/Extensions3D.h: Add NPOT extension.
* platform/graphics/GraphicsContext3D.h: Remove GL flag queries at this level.
* platform/graphics/chromium/Extensions3DChromium.h: Add resource_safe and strict_attribs extensions.
* platform/graphics/mac/GraphicsContext3DMac.mm: Remove GL flag queries at this level.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index edfca0c..1d0c5d3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-11-12 Zhenyao Mo <zmo at google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Refactor GL backend flags
+ https://bugs.webkit.org/show_bug.cgi?id=49460
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::WebGLRenderingContext): Call setupFlags().
+ (WebCore::WebGLRenderingContext::initializeNewContext): Remove flag initialization to setupFlags().
+ (WebCore::WebGLRenderingContext::setupFlags): Initialize GL flags.
+ (WebCore::WebGLRenderingContext::getRenderbufferParameter): Use accessor function instead of member.
+ (WebCore::WebGLRenderingContext::renderbufferStorage): Ditto.
+ * html/canvas/WebGLRenderingContext.h: Use flags set in setupFlags instead of querying underlying GL implementation.
+ (WebCore::WebGLRenderingContext::isGLES2Compliant):
+ (WebCore::WebGLRenderingContext::isGLES2NPOTStrict):
+ (WebCore::WebGLRenderingContext::isErrorGeneratedOnOutOfBoundsAccesses):
+ (WebCore::WebGLRenderingContext::isResourceSafe):
+ (WebCore::WebGLRenderingContext::isDepthStencilSupported):
+ * platform/graphics/Extensions3D.h: Add NPOT extension.
+ * platform/graphics/GraphicsContext3D.h: Remove GL flag queries at this level.
+ * platform/graphics/chromium/Extensions3DChromium.h: Add resource_safe and strict_attribs extensions.
+ * platform/graphics/mac/GraphicsContext3DMac.mm: Remove GL flag queries at this level.
+
2010-11-16 Kenneth Russell <kbr at google.com>
Reviewed by Dimitri Glazkov.
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index fa19b0d..af34c4d 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -107,6 +107,7 @@ WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, Pa
, m_contextLost(false)
{
ASSERT(m_context);
+ setupFlags();
initializeNewContext();
}
@@ -151,15 +152,26 @@ void WebGLRenderingContext::initializeNewContext()
if (!isGLES2Compliant())
initVertexAttrib0();
- if (isGLES2Compliant())
- m_isDepthStencilSupported = m_context->getExtensions()->supports("GL_OES_packed_depth_stencil");
- else
- m_isDepthStencilSupported = m_context->getExtensions()->supports("GL_EXT_packed_depth_stencil");
-
m_context->reshape(canvas()->width(), canvas()->height());
m_context->viewport(0, 0, canvas()->width(), canvas()->height());
}
+void WebGLRenderingContext::setupFlags()
+{
+ ASSERT(m_context);
+
+ m_isGLES2Compliant = m_context->isGLES2Compliant();
+ m_isErrorGeneratedOnOutOfBoundsAccesses = m_context->getExtensions()->supports("GL_CHROMIUM_strict_attribs");
+ m_isResourceSafe = m_context->getExtensions()->supports("GL_CHROMIUM_resource_safe");
+ if (m_isGLES2Compliant) {
+ m_isGLES2NPOTStrict = !m_context->getExtensions()->supports("GL_OES_texture_npot");
+ m_isDepthStencilSupported = m_context->getExtensions()->supports("GL_OES_packed_depth_stencil");
+ } else {
+ m_isGLES2NPOTStrict = !m_context->getExtensions()->supports("GL_ARB_texture_non_power_of_two");
+ m_isDepthStencilSupported = m_context->getExtensions()->supports("GL_EXT_packed_depth_stencil");
+ }
+}
+
WebGLRenderingContext::~WebGLRenderingContext()
{
detachAndRemoveAllObjects();
@@ -1715,7 +1727,7 @@ WebGLGetInfo WebGLRenderingContext::getRenderbufferParameter(unsigned long targe
if (m_renderbufferBinding->getInternalFormat() == GraphicsContext3D::DEPTH_STENCIL
&& !m_renderbufferBinding->isValid()) {
- ASSERT(!m_isDepthStencilSupported);
+ ASSERT(!isDepthStencilSupported());
long value = 0;
switch (pname) {
case GraphicsContext3D::RENDERBUFFER_WIDTH:
@@ -2304,12 +2316,12 @@ void WebGLRenderingContext::renderbufferStorage(unsigned long target, unsigned l
cleanupAfterGraphicsCall(false);
break;
case GraphicsContext3D::DEPTH_STENCIL:
- if (m_isDepthStencilSupported) {
+ if (isDepthStencilSupported()) {
m_context->renderbufferStorage(target, Extensions3D::DEPTH24_STENCIL8, width, height);
cleanupAfterGraphicsCall(false);
} else
m_renderbufferBinding->setSize(width, height);
- m_renderbufferBinding->setIsValid(m_isDepthStencilSupported);
+ m_renderbufferBinding->setIsValid(isDepthStencilSupported());
m_renderbufferBinding->setInternalFormat(internalformat);
break;
default:
@@ -3406,21 +3418,6 @@ WebGLGetInfo WebGLRenderingContext::getWebGLIntArrayParameter(unsigned long pnam
return WebGLGetInfo(Int32Array::create(value, length));
}
-bool WebGLRenderingContext::isGLES2Compliant()
-{
- return m_context->isGLES2Compliant();
-}
-
-bool WebGLRenderingContext::isGLES2NPOTStrict()
-{
- return m_context->isGLES2NPOTStrict();
-}
-
-bool WebGLRenderingContext::isErrorGeneratedOnOutOfBoundsAccesses()
-{
- return m_context->isErrorGeneratedOnOutOfBoundsAccesses();
-}
-
void WebGLRenderingContext::handleNPOTTextures(bool prepareToDraw)
{
bool resetActiveUnit = false;
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index fbcb082..950d704 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -296,6 +296,7 @@ public:
WebGLRenderingContext(HTMLCanvasElement*, PassRefPtr<GraphicsContext3D>);
void initializeNewContext();
+ void setupFlags();
void addObject(WebGLObject*);
void detachAndRemoveAllObjects();
@@ -311,9 +312,16 @@ public:
markContextChanged();
}
- bool isGLES2Compliant();
- bool isGLES2NPOTStrict();
- bool isErrorGeneratedOnOutOfBoundsAccesses();
+ // Query whether it is built on top of compliant GLES2 implementation.
+ bool isGLES2Compliant() { return m_isGLES2Compliant; }
+ // Query if the GL implementation is NPOT strict.
+ bool isGLES2NPOTStrict() { return m_isGLES2NPOTStrict; }
+ // Query if the GL implementation generates errors on out-of-bounds buffer accesses.
+ bool isErrorGeneratedOnOutOfBoundsAccesses() { return m_isErrorGeneratedOnOutOfBoundsAccesses; }
+ // Query if the GL implementation initializes textures/renderbuffers to 0.
+ bool isResourceSafe() { return m_isResourceSafe; }
+ // Query if depth_stencil buffer is supported.
+ bool isDepthStencilSupported() { return m_isDepthStencilSupported; }
// Helper to return the size in bytes of OpenGL data types
// like GL_FLOAT, GL_INT, etc.
@@ -429,6 +437,10 @@ public:
long m_stencilFuncRef; // Note that this is the user specified value, not the internal clamped value.
unsigned long m_stencilFuncMask;
+ bool m_isGLES2Compliant;
+ bool m_isGLES2NPOTStrict;
+ bool m_isErrorGeneratedOnOutOfBoundsAccesses;
+ bool m_isResourceSafe;
bool m_isDepthStencilSupported;
// Helpers for getParameter and others
diff --git a/WebCore/platform/graphics/Extensions3D.h b/WebCore/platform/graphics/Extensions3D.h
index d2e6383..74210a5 100644
--- a/WebCore/platform/graphics/Extensions3D.h
+++ b/WebCore/platform/graphics/Extensions3D.h
@@ -47,6 +47,7 @@ public:
// GL_EXT_texture_format_BGRA8888
// GL_EXT_read_format_bgra
// GL_ARB_robustness
+ // GL_ARB_texture_non_power_of_two / GL_OES_texture_npot
// GL_EXT_packed_depth_stencil / GL_OES_packed_depth_stencil
// GL_ANGLE_framebuffer_blit / GL_ANGLE_framebuffer_multisample
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index d59d78f..c1fffdf 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -473,8 +473,6 @@ public:
int sizeInBytes(int type);
bool isGLES2Compliant() const;
- bool isGLES2NPOTStrict() const;
- bool isErrorGeneratedOnOutOfBoundsAccesses() const;
//----------------------------------------------------------------------
// Helpers for texture uploading and pixel readback.
diff --git a/WebCore/platform/graphics/chromium/Extensions3DChromium.h b/WebCore/platform/graphics/chromium/Extensions3DChromium.h
index 2a71a38..5fda020 100644
--- a/WebCore/platform/graphics/chromium/Extensions3DChromium.h
+++ b/WebCore/platform/graphics/chromium/Extensions3DChromium.h
@@ -36,6 +36,10 @@ class Extensions3DChromium : public Extensions3D {
public:
virtual ~Extensions3DChromium();
+ // Supported extensions:
+ // GL_CHROMIUM_resource_safe : indicating that textures/renderbuffers are always initialized before read/write.
+ // GL_CHROMIUM_strict_attribs : indicating a GL error is generated for out-of-bounds buffer accesses.
+
// Extensions3D methods.
virtual bool supports(const String&);
virtual int getGraphicsResetStatusARB();
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
index ab6993f..321d0ef 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
@@ -251,17 +251,6 @@ bool GraphicsContext3D::isGLES2Compliant() const
return false;
}
-bool GraphicsContext3D::isGLES2NPOTStrict() const
-{
- return false;
-}
-
-bool GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses() const
-{
- return false;
-}
-
-
}
#endif // ENABLE(3D_CANVAS)
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index aa01e84..396e5f4 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-12 Zhenyao Mo <zmo at google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Refactor GL backend flags
+ https://bugs.webkit.org/show_bug.cgi?id=49460
+
+ * public/WebGraphicsContext3D.h: Remove GL flag queries at this level.
+ * src/GraphicsContext3DChromium.cpp: Ditto.
+ * src/GraphicsContext3DInternal.h: Ditto.
+ * src/WebGraphicsContext3DDefaultImpl.cpp: Ditto.
+ * src/WebGraphicsContext3DDefaultImpl.h: Ditto.
+
2010-11-16 Pavel Feldman <pfeldman at chromium.org>
Not reviewed. Chromium build fix.
diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h
index 9656887..932004c 100644
--- a/WebKit/chromium/public/WebGraphicsContext3D.h
+++ b/WebKit/chromium/public/WebGraphicsContext3D.h
@@ -105,11 +105,6 @@ public:
// Query whether it is built on top of compliant GLES2 implementation.
virtual bool isGLES2Compliant() = 0;
- // Query whether it is built on top of GLES2 NPOT strict implementation.
- virtual bool isGLES2NPOTStrict() = 0;
- // Query whether it is built on top of implementation that generates errors
- // on out-of-bounds buffer accesses.
- virtual bool isErrorGeneratedOnOutOfBoundsAccesses() = 0;
// Helper for software compositing path. Reads back the frame buffer into
// the memory region pointed to by "pixels" with size "bufferSize". It is
diff --git a/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/WebKit/chromium/src/GraphicsContext3DChromium.cpp
index 4d9e40b..8cfe8c0 100644
--- a/WebKit/chromium/src/GraphicsContext3DChromium.cpp
+++ b/WebKit/chromium/src/GraphicsContext3DChromium.cpp
@@ -365,16 +365,6 @@ bool GraphicsContext3DInternal::isGLES2Compliant() const
return m_impl->isGLES2Compliant();
}
-bool GraphicsContext3DInternal::isGLES2NPOTStrict() const
-{
- return m_impl->isGLES2NPOTStrict();
-}
-
-bool GraphicsContext3DInternal::isErrorGeneratedOnOutOfBoundsAccesses() const
-{
- return m_impl->isErrorGeneratedOnOutOfBoundsAccesses();
-}
-
DELEGATE_TO_IMPL_1(activeTexture, unsigned long)
DELEGATE_TO_IMPL_2(attachShader, Platform3DObject, Platform3DObject)
@@ -1051,16 +1041,6 @@ bool GraphicsContext3D::isGLES2Compliant() const
return m_internal->isGLES2Compliant();
}
-bool GraphicsContext3D::isGLES2NPOTStrict() const
-{
- return m_internal->isGLES2NPOTStrict();
-}
-
-bool GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses() const
-{
- return m_internal->isErrorGeneratedOnOutOfBoundsAccesses();
-}
-
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebKit/chromium/src/GraphicsContext3DInternal.h b/WebKit/chromium/src/GraphicsContext3DInternal.h
index 17163a4..4453d28 100644
--- a/WebKit/chromium/src/GraphicsContext3DInternal.h
+++ b/WebKit/chromium/src/GraphicsContext3DInternal.h
@@ -75,8 +75,6 @@ public:
WebGLLayerChromium* platformLayer() const;
#endif
bool isGLES2Compliant() const;
- bool isGLES2NPOTStrict() const;
- bool isErrorGeneratedOnOutOfBoundsAccesses() const;
//----------------------------------------------------------------------
// Entry points for WebGL.
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
index 683de46..bd070c6 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -287,16 +287,6 @@ bool WebGraphicsContext3DDefaultImpl::isGLES2Compliant()
return m_isGLES2;
}
-bool WebGraphicsContext3DDefaultImpl::isGLES2NPOTStrict()
-{
- return false;
-}
-
-bool WebGraphicsContext3DDefaultImpl::isErrorGeneratedOnOutOfBoundsAccesses()
-{
- return false;
-}
-
unsigned int WebGraphicsContext3DDefaultImpl::getPlatformTextureId()
{
return m_texture;
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
index 2db610c..e865710 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
@@ -70,8 +70,6 @@ public:
virtual int sizeInBytes(int type);
virtual bool isGLES2Compliant();
- virtual bool isGLES2NPOTStrict();
- virtual bool isErrorGeneratedOnOutOfBoundsAccesses();
virtual void reshape(int width, int height);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list