Hi all,
I am using super dev mode and i have an issue, i think,, with same origin
policy.
I have a ClientBundle containing many ImageResource which will be used as
WebGL textures.
To load those images i do :
Image image = new Image(myImageResource.getSafeUri().asString();
RootLayoutPanel.get().add(image);
image.setVisible(false);
this.img.addLoadHandler(this);
this.img.addErrorHandler(this);
where this is a class implenting LoadHandler and ErrorHandler.
Then in the onLoad method :
this.InitializeTexture(this.img.getElement());
RootLayoutPanel.get().remove(this.img);
And finally the InitializeTexture :
/**
* \brief Initializes the gl texture with the loaded image.
*/
public void InitializeTexture(Element inElement)
{
// Set current texture object as active
this.Bind(WebGLRenderingContext.TEXTURE_2D);
// If generating mipmap is requested, parameter the texture filtering to
using them and generate mipmaps ...
if(this.generateMipmap)
{
this.gl.texParameteri(WebGLRenderingContext.TEXTURE_2D,
WebGLRenderingContext.TEXTURE_MAG_FILTER, WebGLRenderingContext.LINEAR);
this.gl.texParameteri(WebGLRenderingContext.TEXTURE_2D,
WebGLRenderingContext.TEXTURE_MIN_FILTER,
WebGLRenderingContext.LINEAR_MIPMAP_NEAREST);
this.gl.generateMipmap(WebGLRenderingContext.TEXTURE_2D);
}
else // else do not use mipmap
{
this.gl.texParameteri(WebGLRenderingContext.TEXTURE_2D,
WebGLRenderingContext.TEXTURE_MAG_FILTER, WebGLRenderingContext.LINEAR);
this.gl.texParameteri(WebGLRenderingContext.TEXTURE_2D,
WebGLRenderingContext.TEXTURE_MIN_FILTER, WebGLRenderingContext.LINEAR);
}
this.gl.texParameteri(WebGLRenderingContext.TEXTURE_2D,
WebGLRenderingContext.TEXTURE_WRAP_S, WebGLRenderingContext.CLAMP_TO_EDGE);
this.gl.texParameteri(WebGLRenderingContext.TEXTURE_2D,
WebGLRenderingContext.TEXTURE_WRAP_T, WebGLRenderingContext.CLAMP_TO_EDGE);
// And finaly, set the image pixels data in the texture object.
this.gl.texImage2D(WebGLRenderingContext.TEXTURE_2D, 0,
WebGLRenderingContext.RGBA, WebGLRenderingContext.RGBA,
WebGLRenderingContext.UNSIGNED_BYTE, inElement);
// Finaly unbind the texture object
this.Unbind(WebGLRenderingContext.TEXTURE_2D);
}
All is ok in production mode but when i use superdevmode i get under chrome
and firefox a security error while calling texImage2D method.
Do you think that is a SOP issue ?
Any idea to solve it ?
I can use superdevmode with chrome using --disable-web-security option but
i did not succeed in finding a workaround with firefox ... setting in
about:config the option security.fileuri.strict_origin_policy to false does
not help.
Regards,
Harold
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.