summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-06-30 05:38:21 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2000-06-30 05:38:21 +0000
commit3f393d968cef1e5a1208020aba69275a3784707b (patch)
tree53ea36b584458b8b4473660156e46cfcdfb85232
parent9263d5381686b05d6b04f304c26c3ba62a6eb7f0 (diff)
downloadeog-3f393d968cef1e5a1208020aba69275a3784707b.tar.gz
New argument to support explicit synch behavior for the first pass.
2000-06-30 Federico Mena Quintero <federico@helixcode.com> * image-view.c (request_paint_area): New argument to support explicit synch behavior for the first pass. (scroll_to): Draw the first pass synchronously. This eliminates trailing. (image_view_expose): Draw this asynchronously. (image_view_draw): Ditto.
-rw-r--r--libeog/image-view.c19
-rw-r--r--src/ChangeLog9
-rw-r--r--src/image-view.c19
3 files changed, 33 insertions, 14 deletions
diff --git a/libeog/image-view.c b/libeog/image-view.c
index 5a64a47e..2d4b77d9 100644
--- a/libeog/image-view.c
+++ b/libeog/image-view.c
@@ -684,7 +684,7 @@ paint_iteration_idle (gpointer data)
/* Queues a repaint of the specified area in window coordinates */
static void
-request_paint_area (ImageView *view, GdkRectangle *area)
+request_paint_area (ImageView *view, GdkRectangle *area, gboolean asynch)
{
ImageViewPrivate *priv;
ArtIRect r;
@@ -718,7 +718,12 @@ request_paint_area (ImageView *view, GdkRectangle *area)
priv->idle_id = g_idle_add (paint_iteration_idle, view);
}
- priv->uta1 = uta_add_rect (priv->uta1, r.x0, r.y0, r.x1, r.y1);
+ if (asynch || prefs_scroll != SCROLL_TWO_PASS)
+ priv->uta1 = uta_add_rect (priv->uta1, r.x0, r.y0, r.x1, r.y1);
+ else {
+ paint_rectangle (view, &r, GDK_INTERP_NEAREST);
+ priv->uta2 = uta_add_rect (priv->uta2, r.x0, r.y0, r.x1, r.y1);
+ }
}
/* Scrolls the view to the specified offsets. Does not perform range checking! */
@@ -762,7 +767,7 @@ scroll_to (ImageView *view, int x, int y)
area.width = width;
area.height = height;
- request_paint_area (view, &area);
+ request_paint_area (view, &area, FALSE);
return;
}
@@ -826,7 +831,7 @@ scroll_to (ImageView *view, int x, int y)
r.width = abs (xofs);
r.height = height;
- request_paint_area (view, &r);
+ request_paint_area (view, &r, FALSE);
}
if (yofs) {
@@ -837,7 +842,7 @@ scroll_to (ImageView *view, int x, int y)
r.width = width;
r.height = abs (yofs);
- request_paint_area (view, &r);
+ request_paint_area (view, &r, FALSE);
}
/* Process graphics exposures */
@@ -1081,7 +1086,7 @@ image_view_draw (GtkWidget *widget, GdkRectangle *area)
view = IMAGE_VIEW (widget);
- request_paint_area (view, area);
+ request_paint_area (view, area, TRUE);
}
/* Button press handler for the image view */
@@ -1210,7 +1215,7 @@ image_view_expose (GtkWidget *widget, GdkEventExpose *event)
view = IMAGE_VIEW (widget);
- request_paint_area (view, &event->area);
+ request_paint_area (view, &event->area, TRUE);
return TRUE;
}
diff --git a/src/ChangeLog b/src/ChangeLog
index e3ab783e..e2e2f2c5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2000-06-30 Federico Mena Quintero <federico@helixcode.com>
+
+ * image-view.c (request_paint_area): New argument to support
+ explicit synch behavior for the first pass.
+ (scroll_to): Draw the first pass synchronously. This eliminates
+ trailing.
+ (image_view_expose): Draw this asynchronously.
+ (image_view_draw): Ditto.
+
2000-06-20 Federico Mena Quintero <federico@helixcode.com>
* image-view.c (paint_rectangle): Special-case zoom == 1.0 to
diff --git a/src/image-view.c b/src/image-view.c
index 5a64a47e..2d4b77d9 100644
--- a/src/image-view.c
+++ b/src/image-view.c
@@ -684,7 +684,7 @@ paint_iteration_idle (gpointer data)
/* Queues a repaint of the specified area in window coordinates */
static void
-request_paint_area (ImageView *view, GdkRectangle *area)
+request_paint_area (ImageView *view, GdkRectangle *area, gboolean asynch)
{
ImageViewPrivate *priv;
ArtIRect r;
@@ -718,7 +718,12 @@ request_paint_area (ImageView *view, GdkRectangle *area)
priv->idle_id = g_idle_add (paint_iteration_idle, view);
}
- priv->uta1 = uta_add_rect (priv->uta1, r.x0, r.y0, r.x1, r.y1);
+ if (asynch || prefs_scroll != SCROLL_TWO_PASS)
+ priv->uta1 = uta_add_rect (priv->uta1, r.x0, r.y0, r.x1, r.y1);
+ else {
+ paint_rectangle (view, &r, GDK_INTERP_NEAREST);
+ priv->uta2 = uta_add_rect (priv->uta2, r.x0, r.y0, r.x1, r.y1);
+ }
}
/* Scrolls the view to the specified offsets. Does not perform range checking! */
@@ -762,7 +767,7 @@ scroll_to (ImageView *view, int x, int y)
area.width = width;
area.height = height;
- request_paint_area (view, &area);
+ request_paint_area (view, &area, FALSE);
return;
}
@@ -826,7 +831,7 @@ scroll_to (ImageView *view, int x, int y)
r.width = abs (xofs);
r.height = height;
- request_paint_area (view, &r);
+ request_paint_area (view, &r, FALSE);
}
if (yofs) {
@@ -837,7 +842,7 @@ scroll_to (ImageView *view, int x, int y)
r.width = width;
r.height = abs (yofs);
- request_paint_area (view, &r);
+ request_paint_area (view, &r, FALSE);
}
/* Process graphics exposures */
@@ -1081,7 +1086,7 @@ image_view_draw (GtkWidget *widget, GdkRectangle *area)
view = IMAGE_VIEW (widget);
- request_paint_area (view, area);
+ request_paint_area (view, area, TRUE);
}
/* Button press handler for the image view */
@@ -1210,7 +1215,7 @@ image_view_expose (GtkWidget *widget, GdkEventExpose *event)
view = IMAGE_VIEW (widget);
- request_paint_area (view, &event->area);
+ request_paint_area (view, &event->area, TRUE);
return TRUE;
}