mirror of https://github.com/snes9xgit/snes9x.git
Fix warnings on GTK+ display driver with GTK+ 3.
This commit is contained in:
parent
886ea13daf
commit
ec2b9a5165
|
@ -108,7 +108,15 @@ S9xGTKDisplayDriver::output (void *src,
|
||||||
height,
|
height,
|
||||||
24);
|
24);
|
||||||
|
|
||||||
|
#ifndef USE_GTK3
|
||||||
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (drawing_area));
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (drawing_area));
|
||||||
|
#else
|
||||||
|
cairo_rectangle_int_t rect = { x, y, dst_width, dst_height };
|
||||||
|
cairo_region_t *region = cairo_region_create_rectangle (&rect);
|
||||||
|
GdkDrawingContext *context = gdk_window_begin_draw_frame (gtk_widget_get_window (drawing_area),
|
||||||
|
region);
|
||||||
|
cairo_t *cr = gdk_drawing_context_get_cairo_context (context);
|
||||||
|
#endif
|
||||||
|
|
||||||
gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
|
gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
|
||||||
|
|
||||||
|
@ -132,7 +140,12 @@ S9xGTKDisplayDriver::output (void *src,
|
||||||
cairo_rectangle (cr, x, y, dst_width, dst_height);
|
cairo_rectangle (cr, x, y, dst_width, dst_height);
|
||||||
cairo_fill (cr);
|
cairo_fill (cr);
|
||||||
|
|
||||||
|
#ifndef USE_GTK3
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
|
#else
|
||||||
|
gdk_window_end_draw_frame (gtk_widget_get_window (drawing_area), context);
|
||||||
|
cairo_region_destroy (region);
|
||||||
|
#endif
|
||||||
|
|
||||||
window->set_mouseable_area (x, y, width, height);
|
window->set_mouseable_area (x, y, width, height);
|
||||||
|
|
||||||
|
@ -206,7 +219,15 @@ S9xGTKDisplayDriver::clear (void)
|
||||||
width = allocation.width;
|
width = allocation.width;
|
||||||
height = allocation.height;
|
height = allocation.height;
|
||||||
|
|
||||||
|
#ifndef USE_GTK3
|
||||||
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (drawing_area));
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (drawing_area));
|
||||||
|
#else
|
||||||
|
cairo_rectangle_int_t rect = { 0, 0, width, height };
|
||||||
|
cairo_region_t *region = cairo_region_create_rectangle (&rect);
|
||||||
|
GdkDrawingContext *context = gdk_window_begin_draw_frame (gtk_widget_get_window (drawing_area),
|
||||||
|
region);
|
||||||
|
cairo_t *cr = gdk_drawing_context_get_cairo_context (context);
|
||||||
|
#endif
|
||||||
|
|
||||||
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
|
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
|
||||||
|
|
||||||
|
@ -243,7 +264,13 @@ S9xGTKDisplayDriver::clear (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_fill (cr);
|
cairo_fill (cr);
|
||||||
|
|
||||||
|
#ifndef USE_GTK3
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
|
#else
|
||||||
|
gdk_window_end_draw_frame (gtk_widget_get_window (drawing_area), context);
|
||||||
|
cairo_region_destroy (region);
|
||||||
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue