* pixbuf-renderer.c: Add argument to pr_queue_to_tiles to only redraw
the parts of the image that have an existing tile, fixes slow loading
of images when zoomed in because it was generating a tile for even
off screen parts of the image.
+Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
+
+ * pixbuf-renderer.c: Add argument to pr_queue_to_tiles to only redraw
+ the parts of the image that have an existing tile, fixes slow loading
+ of images when zoomed in because it was generating a tile for even
+ off screen parts of the image.
+
Mon Apr 4 12:07:05 2005 John Ellis <johne@verizon.net>
* pan-view.c: Optimize pixbuf_draw_line, and use pixbuf_set_rect_fill
Mon Apr 4 12:07:05 2005 John Ellis <johne@verizon.net>
* pan-view.c: Optimize pixbuf_draw_line, and use pixbuf_set_rect_fill
> make this a g_object with signals for completed, changed, etc.
d> fix region computation rounding when updating scaled image in 'area ready' signal.
> fix delay flip 'completed' signal (full screen busy cursor is not always turned off)
> make this a g_object with signals for completed, changed, etc.
d> fix region computation rounding when updating scaled image in 'area ready' signal.
> fix delay flip 'completed' signal (full screen busy cursor is not always turned off)
- > fix slow loading of images when zoomed out - bug could be poor clamping to visible in PixbufRenderer.
+ d> fix slow loading of images when zoomed out - bug could be poor clamping to visible in PixbufRenderer.
static void pr_queue_clear(PixbufRenderer *pr);
static void pr_queue_merge(QueueData *parent, QueueData *qd);
static void pr_queue(PixbufRenderer *pr, gint x, gint y, gint w, gint h,
static void pr_queue_clear(PixbufRenderer *pr);
static void pr_queue_merge(QueueData *parent, QueueData *qd);
static void pr_queue(PixbufRenderer *pr, gint x, gint y, gint w, gint h,
- gint clamp, ImageTileRenderType render, gint new_data);
+ gint clamp, ImageTileRenderType render, gint new_data, gint only_existing);
static void pr_redraw(PixbufRenderer *pr, gint new_data);
static void pr_redraw(PixbufRenderer *pr, gint new_data);
pr_queue(pr, pr->x_scroll - pr->x_offset + x,
pr->y_scroll - pr->y_offset + y,
w, h,
pr_queue(pr, pr->x_scroll - pr->x_offset + x,
pr->y_scroll - pr->y_offset + y,
w, h,
- FALSE, TILE_RENDER_ALL, FALSE);
+ FALSE, TILE_RENDER_ALL, FALSE, FALSE);
old_vis = od->visible;
if (hidden) od->visible = FALSE;
old_vis = od->visible;
if (hidden) od->visible = FALSE;
-static ImageTile *pr_tile_get(PixbufRenderer *pr, gint x, gint y)
+static ImageTile *pr_tile_get(PixbufRenderer *pr, gint x, gint y, gint only_existing)
+ if (only_existing) return NULL;
+
return pr_tile_add(pr, x, y);
}
return pr_tile_add(pr, x, y);
}
}
static gint pr_queue_to_tiles(PixbufRenderer *pr, gint x, gint y, gint w, gint h,
}
static gint pr_queue_to_tiles(PixbufRenderer *pr, gint x, gint y, gint w, gint h,
- gint clamp, ImageTileRenderType render, gint new_data)
+ gint clamp, ImageTileRenderType render, gint new_data, gint only_existing)
{
gint i, j;
gint x1, x2;
{
gint i, j;
gint x1, x2;
- it = pr_tile_get(pr, i, j);
+ it = pr_tile_get(pr, i, j, only_existing);
}
static void pr_queue(PixbufRenderer *pr, gint x, gint y, gint w, gint h,
}
static void pr_queue(PixbufRenderer *pr, gint x, gint y, gint w, gint h,
- gint clamp, ImageTileRenderType render, gint new_data)
+ gint clamp, ImageTileRenderType render, gint new_data, gint only_existing)
h = CLAMP(h, 0, pr->height - ny);
if (w < 1 || h < 1) return;
h = CLAMP(h, 0, pr->height - ny);
if (w < 1 || h < 1) return;
- if (pr_queue_to_tiles(pr, nx, ny, w, h, clamp, render, new_data) &&
+ if (pr_queue_to_tiles(pr, nx, ny, w, h, clamp, render, new_data, only_existing) &&
((!pr->draw_queue && !pr->draw_queue_2pass) || pr->draw_idle_id == -1 || !pr->draw_idle_high))
{
if (pr->draw_idle_id != -1) g_source_remove(pr->draw_idle_id);
((!pr->draw_queue && !pr->draw_queue_2pass) || pr->draw_idle_id == -1 || !pr->draw_idle_high))
{
if (pr->draw_idle_id != -1) g_source_remove(pr->draw_idle_id);
static void pr_redraw(PixbufRenderer *pr, gint new_data)
{
pr_queue_clear(pr);
static void pr_redraw(PixbufRenderer *pr, gint new_data)
{
pr_queue_clear(pr);
- pr_queue(pr, 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, new_data);
+ pr_queue(pr, 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, new_data, FALSE);
pr_queue(pr, x, y,
MIN((gint)area->width, pr->width - x),
MIN((gint)area->height, pr->height - y),
pr_queue(pr, x, y,
MIN((gint)area->width, pr->width - x),
MIN((gint)area->height, pr->height - y),
- FALSE, TILE_RENDER_ALL, FALSE);
+ FALSE, TILE_RENDER_ALL, FALSE, FALSE);
if (w < 1 || h < 1)
{
/* scrolled completely to new material */
if (w < 1 || h < 1)
{
/* scrolled completely to new material */
- pr_queue(pr, 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, FALSE);
+ pr_queue(pr, 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, FALSE, FALSE);
{
pr_queue(pr,
x_off > 0 ? pr->x_scroll + (pr->vis_width - w) : pr->x_scroll, pr->y_scroll,
{
pr_queue(pr,
x_off > 0 ? pr->x_scroll + (pr->vis_width - w) : pr->x_scroll, pr->y_scroll,
- w, pr->vis_height, TRUE, TILE_RENDER_ALL, FALSE);
+ w, pr->vis_height, TRUE, TILE_RENDER_ALL, FALSE, FALSE);
}
if (h > 0)
{
/* FIXME, to optimize this, remove overlap */
pr_queue(pr,
pr->x_scroll, y_off > 0 ? pr->y_scroll + (pr->vis_height - h) : pr->y_scroll,
}
if (h > 0)
{
/* FIXME, to optimize this, remove overlap */
pr_queue(pr,
pr->x_scroll, y_off > 0 ? pr->y_scroll + (pr->vis_height - h) : pr->y_scroll,
- pr->vis_width, h, TRUE, TILE_RENDER_ALL, FALSE);
+ pr->vis_width, h, TRUE, TILE_RENDER_ALL, FALSE, FALSE);
x2 = (gint)ceil((double)(x + width) * pr->scale);
y2 = (gint)ceil((double)(y + height) * pr->scale);
x2 = (gint)ceil((double)(x + width) * pr->scale);
y2 = (gint)ceil((double)(y + height) * pr->scale);
- pr_queue(pr, x1, y1, x2 - x1, y2 - y1, FALSE, TILE_RENDER_AREA, TRUE);
+ pr_queue(pr, x1, y1, x2 - x1, y2 - y1, FALSE, TILE_RENDER_AREA, TRUE, TRUE);
}
void pixbuf_renderer_zoom_adjust(PixbufRenderer *pr, gdouble increment)
}
void pixbuf_renderer_zoom_adjust(PixbufRenderer *pr, gdouble increment)