{
PixbufRenderer *pr = rt->pr;
- rt->x_scroll = (rt->stereo_mode & PR_STEREO_MIRROR) ?
- pr->width - pr->vis_width - pr->x_scroll
+ rt->x_scroll = (rt->stereo_mode & PR_STEREO_MIRROR) ?
+ pr->width - pr->vis_width - pr->x_scroll
: pr->x_scroll;
- rt->y_scroll = (rt->stereo_mode & PR_STEREO_FLIP) ?
- pr->height - pr->vis_height - pr->y_scroll
+ rt->y_scroll = (rt->stereo_mode & PR_STEREO_FLIP) ?
+ pr->height - pr->vis_height - pr->y_scroll
: pr->y_scroll;
}
ImageTile *it)
{
PixbufRenderer *pr = rt->pr;
- GtkWidget *box;
GList *work;
- box = GTK_WIDGET(pr);
-
work = rt->overlay_list;
while (work)
{
gint srs, drs;
guchar *s_pix, *d_pix;
guchar *sp, *dp;
- guchar *spi, *dpi;
+ guchar *dpi;
gint i, j;
gint tw = rt->tile_width;
gint th = rt->tile_height;
srs = gdk_pixbuf_get_rowstride(src);
s_pix = gdk_pixbuf_get_pixels(src);
- spi = s_pix + (x * COLOR_BYTES);
dest = rt_get_spare_tile(rt);
drs = gdk_pixbuf_get_rowstride(dest);
gboolean new_data, gboolean fast)
{
PixbufRenderer *pr = rt->pr;
- GtkWidget *box;
GList *list;
GList *work;
gboolean draw = FALSE;
- box = GTK_WIDGET(pr);
-
if (pr->zoom == 1.0 || pr->scale == 1.0)
{
list = pr_source_tile_compute_region(pr, it->x + x, it->y + y, w, h, TRUE);
return draw;
}
-static void rt_tile_get_region(gboolean has_alpha,
+static void rt_tile_get_region(gboolean has_alpha,
const GdkPixbuf *src, GdkPixbuf *dest,
int pb_x, int pb_y, int pb_w, int pb_h,
double offset_x, double offset_y, double scale_x, double scale_y,
pb_w, pb_h,
dest,
pb_x, pb_y);
- }
+ }
else
{
- gdk_pixbuf_scale(src, dest,
+ gdk_pixbuf_scale(src, dest,
pb_x, pb_y, pb_w, pb_h,
offset_x,
offset_y,
}
else
{
- gdk_pixbuf_composite_color(src, dest,
+ gdk_pixbuf_composite_color(src, dest,
pb_x, pb_y, pb_w, pb_h,
offset_x,
offset_y,
gboolean new_data, gboolean fast)
{
PixbufRenderer *pr = rt->pr;
- GtkWidget *box;
gboolean has_alpha;
gboolean draw = FALSE;
gint orientation = rt_get_orientation(rt);
rt_tile_prepare(rt, it);
has_alpha = (pr->pixbuf && gdk_pixbuf_get_has_alpha(pr->pixbuf));
- box = GTK_WIDGET(pr);
-
/* FIXME checker colors for alpha should be configurable,
* also should be drawn for blank = TRUE
*/
cairo_set_source_rgb(cr, 0, 0, 0);
cairo_fill (cr);
cairo_destroy (cr);
-#if 0
- gdk_draw_rectangle(it->pixmap, box->style->black_gc, TRUE,
- 0, 0, it->w, it->h);
-#endif
}
else if (pr->source_tiles_enabled)
{
else if ((pr->zoom == 1.0 || pr->scale == 1.0) &&
pr->aspect_ratio == 1.0 &&
!has_alpha &&
- orientation == EXIF_ORIENTATION_TOP_LEFT &&
+ orientation == EXIF_ORIENTATION_TOP_LEFT &&
!(pr->func_post_process && !(pr->post_process_slow && fast)) &&
!(rt->stereo_mode & PR_STEREO_ANAGLYPH))
{
scale_x, scale_y,
(fast) ? GDK_INTERP_NEAREST : pr->zoom_quality,
it->x + pb_x, it->y + pb_y);
- if (rt->stereo_mode & PR_STEREO_ANAGLYPH &&
+ if (rt->stereo_mode & PR_STEREO_ANAGLYPH &&
(pr->stereo_pixbuf_offset_right > 0 || pr->stereo_pixbuf_offset_left > 0))
{
GdkPixbuf *right_pb = rt_get_spare_tile(rt);
}
if (it->x + x + w > rt->x_scroll + pr->vis_width)
{
- w = rt->x_scroll + pr->vis_width - it->x - x;
+ w = rt->x_scroll + pr->vis_width - it->x - x;
}
if (w < 1) return;
if (it->y + y < rt->y_scroll)
}
if (it->y + y + h > rt->y_scroll + pr->vis_height)
{
- h = rt->y_scroll + pr->vis_height - it->y - y;
+ h = rt->y_scroll + pr->vis_height - it->y - y;
}
if (h < 1) return;
{
gint area = 0;
- while (work)
+ while (work)
{
QueueData *qd = work->data;
area += qd->w * qd->h;
if (!pr->loading)
{
- /* 2pass prio */
+ /* 2pass prio */
DEBUG_2("redraw priority: 2pass");
rt->draw_idle_id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, rt_queue_draw_idle_cb, rt, NULL);
return FALSE;
fast = FALSE;
}
- if (gtk_widget_get_realized(pr))
+ if (gtk_widget_get_realized(GTK_WIDGET(pr)))
{
if (rt_tile_is_visible(rt, qd->it))
{
rt_sync_scroll(rt);
if (rt->stereo_mode & PR_STEREO_MIRROR) x_off = -x_off;
- if (rt->stereo_mode & PR_STEREO_FLIP) y_off = -y_off;
+ if (rt->stereo_mode & PR_STEREO_FLIP) y_off = -y_off;
gint w = pr->vis_width - abs(x_off);
gint h = pr->vis_height - abs(y_off);
gint x2, y2;
GtkWidget *box;
GdkWindow *window;
-// GdkGC *gc;
- GdkEvent *event;
cairo_t *cr;
cairo_surface_t *surface;
rt->stereo_off_x = 0;
rt->stereo_off_y = 0;
- if (rt->stereo_mode & PR_STEREO_RIGHT)
+ if (rt->stereo_mode & PR_STEREO_RIGHT)
{
- if (rt->stereo_mode & PR_STEREO_HORIZ)
+ if (rt->stereo_mode & PR_STEREO_HORIZ)
{
rt->stereo_off_x = rt->pr->viewport_width;
}
- else if (rt->stereo_mode & PR_STEREO_VERT)
+ else if (rt->stereo_mode & PR_STEREO_VERT)
{
rt->stereo_off_y = rt->pr->viewport_height;
}
- else if (rt->stereo_mode & PR_STEREO_FIXED)
+ else if (rt->stereo_mode & PR_STEREO_FIXED)
{
rt->stereo_off_x = rt->pr->stereo_fixed_x_right;
rt->stereo_off_y = rt->pr->stereo_fixed_y_right;
}
else
{
- if (rt->stereo_mode & PR_STEREO_FIXED)
+ if (rt->stereo_mode & PR_STEREO_FIXED)
{
rt->stereo_off_x = rt->pr->stereo_fixed_x_left;
rt->stereo_off_y = rt->pr->stereo_fixed_y_left;
G_CALLBACK(rt_draw_cb), rt);
#else
g_signal_connect(G_OBJECT(pr), "expose_event",
- G_CALLBACK(rt_expose_cb), NULL);
+ G_CALLBACK(rt_expose_cb), rt);
#endif
return (RendererFuncs *) rt;
}