diff --git a/clutter/cogl/cogl/cogl-texture-2d-sliced.c b/clutter/cogl/cogl/cogl-texture-2d-sliced.c index 0f9e65f22..2d969052c 100644 --- a/clutter/cogl/cogl/cogl-texture-2d-sliced.c +++ b/clutter/cogl/cogl/cogl-texture-2d-sliced.c @@ -998,7 +998,6 @@ _cogl_texture_2d_sliced_new_with_size (unsigned int width, CoglPixelFormat internal_format) { CoglTexture2DSliced *tex_2ds; - CoglTexture *tex; CoglBitmap bmp; /* Since no data, we need some internal format */ @@ -1008,8 +1007,6 @@ _cogl_texture_2d_sliced_new_with_size (unsigned int width, /* Init texture with empty bitmap */ tex_2ds = g_new (CoglTexture2DSliced, 1); - tex = COGL_TEXTURE (tex_2ds); - bmp.width = width; bmp.height = height; bmp.data = NULL; @@ -1037,7 +1034,6 @@ _cogl_texture_2d_sliced_new_from_bitmap (CoglHandle bmp_handle, CoglPixelFormat internal_format) { CoglTexture2DSliced *tex_2ds; - CoglTexture *tex; CoglBitmap *bmp = (CoglBitmap *)bmp_handle; g_return_val_if_fail (bmp_handle != COGL_INVALID_HANDLE, COGL_INVALID_HANDLE); @@ -1045,8 +1041,6 @@ _cogl_texture_2d_sliced_new_from_bitmap (CoglHandle bmp_handle, /* Create new texture and fill with loaded data */ tex_2ds = g_new0 (CoglTexture2DSliced, 1); - tex = COGL_TEXTURE (tex_2ds); - if (flags & COGL_TEXTURE_NO_SLICING) tex_2ds->max_waste = -1; else @@ -1121,7 +1115,8 @@ _cogl_texture_2d_sliced_new_from_foreign (GLuint gl_handle, return COGL_INVALID_HANDLE; /* Make sure binding succeeds */ - gl_error = glGetError (); + while ((gl_error = glGetError ()) != GL_NO_ERROR) + ; glBindTexture (gl_target, gl_handle); if (glGetError () != GL_NO_ERROR) return COGL_INVALID_HANDLE; diff --git a/clutter/cogl/cogl/cogl-texture.c b/clutter/cogl/cogl/cogl-texture.c index e94aaf0e2..bf70c9ef4 100644 --- a/clutter/cogl/cogl/cogl-texture.c +++ b/clutter/cogl/cogl/cogl-texture.c @@ -800,8 +800,8 @@ do_texture_draw_and_read (CoglHandle handle, tex_width = cogl_texture_get_width (handle); tex_height = cogl_texture_get_height (handle); - ry1 = 0; ry2 = 0; - ty1 = 0; ty2 = 0; + ry2 = 0; + ty2 = 0; /* Walk Y axis until whole bitmap height consumed */ for (bh = tex_height; bh > 0; bh -= viewport[3]) @@ -814,8 +814,8 @@ do_texture_draw_and_read (CoglHandle handle, ty1 = ty2; ty2 = (ry2 / (float) tex_height); - rx1 = 0; rx2 = 0; - tx1 = 0; tx2 = 0; + rx2 = 0; + tx2 = 0; /* Walk X axis until whole bitmap width consumed */ for (bw = tex_width; bw > 0; bw-=viewport[2])