[PATCH 3/3] wined3d: Remove redundant state restoration from read_from_framebuffer.
Stefan Dösinger
stefan at codeweavers.com
Thu Nov 28 03:48:34 CST 2013
---
dlls/wined3d/surface.c | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index e574956..a9a69ec 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3451,9 +3451,6 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
int i;
BOOL bpp;
BOOL srcIsUpsideDown;
- GLint rowLen = 0;
- GLint skipPix = 0;
- GLint skipRow = 0;
context = context_acquire(device, surface);
context_apply_blit_state(context, device);
@@ -3533,21 +3530,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
ERR("mem not null for pbo -- unexpected\n");
}
- /* Save old pixel store pack state */
- gl_info->gl_ops.gl.p_glGetIntegerv(GL_PACK_ROW_LENGTH, &rowLen);
- checkGLcall("glGetIntegerv");
- gl_info->gl_ops.gl.p_glGetIntegerv(GL_PACK_SKIP_PIXELS, &skipPix);
- checkGLcall("glGetIntegerv");
- gl_info->gl_ops.gl.p_glGetIntegerv(GL_PACK_SKIP_ROWS, &skipRow);
- checkGLcall("glGetIntegerv");
-
/* Setup pixel store pack state -- to glReadPixels into the correct place */
gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, surface->resource.width);
checkGLcall("glPixelStorei");
- gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
- checkGLcall("glPixelStorei");
- gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_SKIP_ROWS, 0);
- checkGLcall("glPixelStorei");
gl_info->gl_ops.gl.p_glReadPixels(0, 0,
surface->resource.width, surface->resource.height,
@@ -3555,11 +3540,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
checkGLcall("glReadPixels");
/* Reset previous pixel store pack state */
- gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, rowLen);
- checkGLcall("glPixelStorei");
- gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_SKIP_PIXELS, skipPix);
- checkGLcall("glPixelStorei");
- gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_SKIP_ROWS, skipRow);
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, 0);
checkGLcall("glPixelStorei");
if (data->buffer_object && !srcIsUpsideDown)
--
1.8.3.2
More information about the wine-patches
mailing list