diff options
Diffstat (limited to 'WebCore/platform/graphics/opengl')
3 files changed, 28 insertions, 3 deletions
diff --git a/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp b/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp index a6fa5d9..4215d12 100644 --- a/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp +++ b/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp @@ -76,10 +76,20 @@ bool Extensions3DOpenGL::supports(const String& name) return m_availableExtensions.contains("GL_EXT_framebuffer_blit"); if (name == "GL_ANGLE_framebuffer_multisample") return m_availableExtensions.contains("GL_EXT_framebuffer_multisample"); - + + // If GL_ARB_texture_float is available then we report GL_OES_texture_float and + // GL_OES_texture_half_float as available. + if (name == "GL_OES_texture_float" || name == "GL_OES_texture_half_float") + return m_availableExtensions.contains("GL_ARB_texture_float"); + return m_availableExtensions.contains(name); } +void Extensions3DOpenGL::ensureEnabled(const String& name) +{ + ASSERT_UNUSED(name, supports(name)); +} + int Extensions3DOpenGL::getGraphicsResetStatusARB() { return GraphicsContext3D::NO_ERROR; diff --git a/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h b/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h index 0fbe022..59f8180 100644 --- a/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h +++ b/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h @@ -40,6 +40,7 @@ public: // Extensions3D methods. virtual bool supports(const String&); + virtual void ensureEnabled(const String&); virtual int getGraphicsResetStatusARB(); virtual void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter); virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height); diff --git a/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp b/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp index d295abb..aa3b60e 100644 --- a/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp +++ b/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp @@ -125,7 +125,10 @@ void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* co void GraphicsContext3D::reshape(int width, int height) { - if (width == m_currentWidth && height == m_currentHeight || !m_contextObj) + if (!m_contextObj) + return; + + if (width == m_currentWidth && height == m_currentHeight) return; m_currentWidth = width; @@ -1324,9 +1327,20 @@ long GraphicsContext3D::getVertexAttribOffset(unsigned long index, unsigned long int GraphicsContext3D::texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels) { + if (width && height && !pixels) { + synthesizeGLError(INVALID_VALUE); + return 1; + } makeContextCurrent(); + unsigned openGLInternalFormat = internalformat; + if (type == GL_FLOAT) { + if (format == GL_RGBA) + openGLInternalFormat = GL_RGBA32F_ARB; + else if (format == GL_RGB) + openGLInternalFormat = GL_RGB32F_ARB; + } - ::glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + ::glTexImage2D(target, level, openGLInternalFormat, width, height, border, format, type, pixels); return 0; } |