cogl_offscreen_new_to_texture previously bailed out if the given texture's
GL target was anything but GL_TEXTURE_2D, but it now also allows
foreign GL_TEXTURE_RECTANGLE_ARB textures.
Thanks to Owen for reporting this issue, ref:
https://bugzilla.gnome.org/show_bug.cgi?id=601032
if (!cogl_texture_get_gl_texture (texhandle, &tex_gl_handle, &tex_gl_target))
return COGL_INVALID_HANDLE;
- if (tex_gl_target != GL_TEXTURE_2D)
+ if (tex_gl_target != GL_TEXTURE_2D &&
+ tex_gl_target != GL_TEXTURE_RECTANGLE_ARB)
return COGL_INVALID_HANDLE;
/* Create a renderbuffer for stenciling */