{
GLenum format = 0;
GLuint cur_tex = 0;
- GLsizei unpack_alignment = 0;
+ GLsizei unpack[3];
YAGL_LOG_FUNC_SET(glUpdateOffscreenImageYAGL);
gles_api_ts->driver->GetIntegerv(GL_TEXTURE_BINDING_2D,
(GLint*)&cur_tex);
- gles_api_ts->driver->GetIntegerv(GL_UNPACK_ALIGNMENT,
- &unpack_alignment);
+ gles_api_ts->driver->GetIntegerv(GL_UNPACK_ALIGNMENT, &unpack[0]);
+ gles_api_ts->driver->GetIntegerv(GL_UNPACK_ROW_LENGTH, &unpack[1]);
+ gles_api_ts->driver->GetIntegerv(GL_UNPACK_IMAGE_HEIGHT, &unpack[2]);
gles_api_ts->driver->PixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ gles_api_ts->driver->PixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ gles_api_ts->driver->PixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
gles_api_ts->driver->BindTexture(GL_TEXTURE_2D,
yagl_gles_object_get(texture));
GL_UNSIGNED_INT_8_8_8_8_REV,
pixels);
- gles_api_ts->driver->PixelStorei(GL_UNPACK_ALIGNMENT,
- unpack_alignment);
+ gles_api_ts->driver->PixelStorei(GL_UNPACK_ALIGNMENT, unpack[0]);
+ gles_api_ts->driver->PixelStorei(GL_UNPACK_ROW_LENGTH, unpack[1]);
+ gles_api_ts->driver->PixelStorei(GL_UNPACK_IMAGE_HEIGHT, unpack[2]);
gles_api_ts->driver->BindTexture(GL_TEXTURE_2D, cur_tex);
}
((struct yagl_egl_offscreen*)ctx->base.dpy->backend)->gles_driver;
bool ret = false;
GLuint current_fb = 0;
- GLint current_pack_alignment = 0;
+ GLint current_pack[3];
GLuint current_pbo = 0;
uint32_t rp_line_size = width * bpp;
uint32_t rp_size = rp_line_size * height;
gles_driver->GetIntegerv(GL_READ_FRAMEBUFFER_BINDING,
(GLint*)¤t_fb);
- gles_driver->GetIntegerv(GL_PACK_ALIGNMENT,
- ¤t_pack_alignment);
-
gles_driver->BindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+ gles_driver->GetIntegerv(GL_PACK_ALIGNMENT, ¤t_pack[0]);
+ gles_driver->GetIntegerv(GL_PACK_ROW_LENGTH, ¤t_pack[1]);
+ gles_driver->GetIntegerv(GL_PACK_IMAGE_HEIGHT, ¤t_pack[2]);
+
if (!ctx->rp_pbo) {
/*
* No buffer yet, create one.
}
gles_driver->PixelStorei(GL_PACK_ALIGNMENT, 1);
+ gles_driver->PixelStorei(GL_PACK_ROW_LENGTH, 0);
+ gles_driver->PixelStorei(GL_PACK_IMAGE_HEIGHT, 0);
gles_driver->ReadPixels(0, 0,
width, height, format, GL_UNSIGNED_INT_8_8_8_8_REV,
if (mapped_pixels) {
gles_driver->UnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB);
}
- gles_driver->PixelStorei(GL_PACK_ALIGNMENT, current_pack_alignment);
+ gles_driver->PixelStorei(GL_PACK_ALIGNMENT, current_pack[0]);
+ gles_driver->PixelStorei(GL_PACK_ROW_LENGTH, current_pack[1]);
+ gles_driver->PixelStorei(GL_PACK_IMAGE_HEIGHT, current_pack[2]);
gles_driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB,
current_pbo);
gles_driver->BindFramebuffer(GL_READ_FRAMEBUFFER, current_fb);