[eog] Replace GdkInterpType with cairo_filter_t in EogScrollView
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] Replace GdkInterpType with cairo_filter_t in EogScrollView
- Date: Wed, 8 Sep 2010 16:43:31 +0000 (UTC)
commit 793ede27dd4cd0aa73d5e84cc478641e25424f54
Author: Claudio Saavedra <csaavedra igalia com>
Date: Wed Aug 18 02:02:01 2010 +0300
Replace GdkInterpType with cairo_filter_t in EogScrollView
https://bugzilla.gnome.org/show_bug.cgi?id=626795
src/eog-scroll-view.c | 44 ++++++++++++++++++++++----------------------
1 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/src/eog-scroll-view.c b/src/eog-scroll-view.c
index 4b634fb..c013720 100644
--- a/src/eog-scroll-view.c
+++ b/src/eog-scroll-view.c
@@ -129,10 +129,10 @@ struct _EogScrollViewPrivate {
guint idle_id;
/* Interpolation type when zoomed in*/
- GdkInterpType interp_type_in;
+ cairo_filter_t interp_type_in;
/* Interpolation type when zoomed out*/
- GdkInterpType interp_type_out;
+ cairo_filter_t interp_type_out;
/* Scroll wheel zoom */
gboolean scroll_wheel_zoom;
@@ -830,7 +830,7 @@ draw_svg (EogScrollView *view, EogIRect *render_rect, EogIRect *image_rect)
/* Paints a rectangle of the dirty region */
static void
-paint_rectangle (EogScrollView *view, EogIRect *rect, GdkInterpType interp_type)
+paint_rectangle (EogScrollView *view, EogIRect *rect, cairo_filter_t interp_type)
{
EogScrollViewPrivate *priv;
GdkPixbuf *tmp;
@@ -936,7 +936,7 @@ paint_rectangle (EogScrollView *view, EogIRect *rect, GdkInterpType interp_type)
return;
switch (interp_type) {
- case GDK_INTERP_NEAREST:
+ case CAIRO_FILTER_NEAREST:
str = "NEAREST";
break;
default:
@@ -947,7 +947,7 @@ paint_rectangle (EogScrollView *view, EogIRect *rect, GdkInterpType interp_type)
str, d.x0, d.y0, d.x1, d.y1);
#ifdef HAVE_RSVG
- if (eog_image_is_svg (view->priv->image) && interp_type != GDK_INTERP_NEAREST) {
+ if (eog_image_is_svg (view->priv->image) && interp_type != CAIRO_FILTER_NEAREST) {
draw_svg (view, &d, &r);
return;
}
@@ -998,7 +998,7 @@ paint_rectangle (EogScrollView *view, EogIRect *rect, GdkInterpType interp_type)
d.x1 - d.x0, d.y1 - d.y0,
-(d.x0 - xofs), -(d.y0 - yofs),
priv->zoom, priv->zoom,
- is_unity_zoom (view) ? GDK_INTERP_NEAREST : interp_type,
+ is_unity_zoom (view) ? CAIRO_FILTER_NEAREST : interp_type,
255,
d.x0 - xofs, d.y0 - yofs,
check_size,
@@ -1044,7 +1044,7 @@ paint_iteration_idle (gpointer data)
else if (is_zoomed_out (view))
paint_rectangle (view, &rect, priv->interp_type_out);
else
- paint_rectangle (view, &rect, GDK_INTERP_NEAREST);
+ paint_rectangle (view, &rect, CAIRO_FILTER_NEAREST);
}
if (!priv->uta) {
@@ -1086,11 +1086,11 @@ request_paint_area (EogScrollView *view, GdkRectangle *area)
return;
/* Do nearest neighbor, 1:1 zoom or active progressive loading synchronously for speed. */
- if ((is_zoomed_in (view) && priv->interp_type_in == GDK_INTERP_NEAREST) ||
- (is_zoomed_out (view) && priv->interp_type_out == GDK_INTERP_NEAREST) ||
+ if ((is_zoomed_in (view) && priv->interp_type_in == CAIRO_FILTER_NEAREST) ||
+ (is_zoomed_out (view) && priv->interp_type_out == CAIRO_FILTER_NEAREST) ||
is_unity_zoom (view) ||
priv->progressive_state == PROGRESSIVE_LOADING) {
- paint_rectangle (view, &r, GDK_INTERP_NEAREST);
+ paint_rectangle (view, &r, CAIRO_FILTER_NEAREST);
return;
}
@@ -1102,7 +1102,7 @@ request_paint_area (EogScrollView *view, GdkRectangle *area)
else if (!priv->image || !eog_image_is_animation (priv->image))
/* do nearest neigbor before anti aliased version,
except for animations to avoid a "blinking" effect. */
- paint_rectangle (view, &r, GDK_INTERP_NEAREST);
+ paint_rectangle (view, &r, CAIRO_FILTER_NEAREST);
/* All other interpolation types are delayed. */
if (priv->uta)
@@ -1964,7 +1964,7 @@ image_loading_finished_cb (EogImage *img, gpointer data)
gtk_widget_queue_draw (GTK_WIDGET (priv->display));
}
- else if (priv->interp_type != GDK_INTERP_NEAREST &&
+ else if (priv->interp_type != CAIRO_FILTER_NEAREST &&
!is_unity_zoom (view))
{
// paint antialiased image version
@@ -2087,13 +2087,13 @@ void
eog_scroll_view_set_antialiasing_in (EogScrollView *view, gboolean state)
{
EogScrollViewPrivate *priv;
- GdkInterpType new_interp_type;
+ cairo_filter_t new_interp_type;
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
priv = view->priv;
- new_interp_type = state ? GDK_INTERP_BILINEAR : GDK_INTERP_NEAREST;
+ new_interp_type = state ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_NEAREST;
if (priv->interp_type_in != new_interp_type) {
priv->interp_type_in = new_interp_type;
@@ -2106,13 +2106,13 @@ void
eog_scroll_view_set_antialiasing_out (EogScrollView *view, gboolean state)
{
EogScrollViewPrivate *priv;
- GdkInterpType new_interp_type;
+ cairo_filter_t new_interp_type;
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
priv = view->priv;
- new_interp_type = state ? GDK_INTERP_BILINEAR : GDK_INTERP_NEAREST;
+ new_interp_type = state ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_NEAREST;
if (priv->interp_type_out != new_interp_type) {
priv->interp_type_out = new_interp_type;
@@ -2358,8 +2358,8 @@ eog_scroll_view_set_image (EogScrollView *view, EogImage *image)
}
#if 0
- else if ((is_zoomed_in (view) && priv->interp_type_in != GDK_INTERP_NEAREST) ||
- (is_zoomed_out (view) && priv->interp_type_out != GDK_INTERP_NEAREST))
+ else if ((is_zoomed_in (view) && priv->interp_type_in != CAIRO_FILTER_NEAREST) ||
+ (is_zoomed_out (view) && priv->interp_type_out != CAIRO_FILTER_NEAREST))
{
/* paint antialiased image version */
priv->progressive_state = PROGRESSIVE_POLISHING;
@@ -2447,8 +2447,8 @@ eog_scroll_view_init (EogScrollView *view)
priv->zoom_mode = ZOOM_MODE_FIT;
priv->upscale = FALSE;
priv->uta = NULL;
- priv->interp_type_in = GDK_INTERP_BILINEAR;
- priv->interp_type_out = GDK_INTERP_BILINEAR;
+ priv->interp_type_in = CAIRO_FILTER_BILINEAR;
+ priv->interp_type_out = CAIRO_FILTER_BILINEAR;
priv->scroll_wheel_zoom = FALSE;
priv->zoom_multiplier = IMAGE_VIEW_ZOOM_MULTIPLIER;
priv->image = NULL;
@@ -2611,13 +2611,13 @@ eog_scroll_view_get_property (GObject *object, guint property_id,
switch (property_id) {
case PROP_ANTIALIAS_IN:
{
- gboolean filter = (priv->interp_type_in != GDK_INTERP_NEAREST);
+ gboolean filter = (priv->interp_type_in != CAIRO_FILTER_NEAREST);
g_value_set_boolean (value, filter);
break;
}
case PROP_ANTIALIAS_OUT:
{
- gboolean filter = (priv->interp_type_out != GDK_INTERP_NEAREST);
+ gboolean filter = (priv->interp_type_out != CAIRO_FILTER_NEAREST);
g_value_set_boolean (value, filter);
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]