summaryrefslogtreecommitdiffstats
path: root/WebCore/html/canvas/WebGLRenderingContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html/canvas/WebGLRenderingContext.cpp')
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 44d3e08..2a1464a 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -29,6 +29,7 @@
#include "WebGLRenderingContext.h"
+#include "CachedImage.h"
#include "CanvasPixelArray.h"
#include "CheckedInt.h"
#include "Console.h"
@@ -86,7 +87,8 @@ private:
PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElement* canvas, WebGLContextAttributes* attrs)
{
HostWindow* hostWindow = canvas->document()->view()->root()->hostWindow();
- OwnPtr<GraphicsContext3D> context(GraphicsContext3D::create(attrs->attributes(), hostWindow));
+ GraphicsContext3D::Attributes emptyAttributes;
+ OwnPtr<GraphicsContext3D> context(GraphicsContext3D::create(attrs ? attrs->attributes() : emptyAttributes, hostWindow));
if (!context)
return 0;
@@ -152,7 +154,7 @@ void WebGLRenderingContext::markContextChanged()
else {
#endif
if (!m_markedCanvasDirty)
- canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height()));
+ canvas()->didDraw(FloatRect(0, 0, canvas()->width(), canvas()->height()));
#if USE(ACCELERATED_COMPOSITING)
}
#endif
@@ -309,23 +311,14 @@ void WebGLRenderingContext::bindTexture(unsigned long target, WebGLTexture* text
if (texture)
texture->setTarget(target, maxLevel);
- // FIXME: do we want to do this on all platforms?
-#if PLATFORM(CHROMIUM)
- // FIXME: GL_TEXTURE_WRAP_R isn't exposed in the OpenGL ES 2.0
- // API. On desktop OpenGL implementations it seems necessary to
- // set this wrap mode to GL_CLAMP_TO_EDGE to get correct behavior
- // of cube maps.
- if (texture) {
- if (target == GraphicsContext3D::TEXTURE_CUBE_MAP) {
- if (!texture->isCubeMapRWrapModeInitialized()) {
- static const int textureWrapR = 0x8072;
- texParameteri(GraphicsContext3D::TEXTURE_CUBE_MAP, textureWrapR, GraphicsContext3D::CLAMP_TO_EDGE);
- texture->setCubeMapRWrapModeInitialized(true);
- }
- } else
- texture->setCubeMapRWrapModeInitialized(false);
- }
-#endif
+ // Note: previously we used to automatically set the TEXTURE_WRAP_R
+ // repeat mode to CLAMP_TO_EDGE for cube map textures, because OpenGL
+ // ES 2.0 doesn't expose this flag (a bug in the specification) and
+ // otherwise the application has no control over the seams in this
+ // dimension. However, it appears that supporting this properly on all
+ // platforms is fairly involved (will require a HashMap from texture ID
+ // in all ports), and we have not had any complaints, so the logic has
+ // been removed.
cleanupAfterGraphicsCall(false);
}