pixbuf-engine: Get rid of unused mask argument

This commit is contained in:
Benjamin Otte
2010-08-17 04:30:10 +02:00
parent eda14b2d47
commit f7cfaee18a
3 changed files with 15 additions and 36 deletions

View File

@ -131,7 +131,7 @@ draw_simple_image(GtkStyle *style,
if (image->background) if (image->background)
{ {
theme_pixbuf_render (image->background, theme_pixbuf_render (image->background,
window, NULL, area, window, area,
draw_center ? COMPONENT_ALL : COMPONENT_ALL | COMPONENT_CENTER, draw_center ? COMPONENT_ALL : COMPONENT_ALL | COMPONENT_CENTER,
FALSE, FALSE,
x, y, width, height); x, y, width, height);
@ -139,7 +139,7 @@ draw_simple_image(GtkStyle *style,
if (image->overlay && draw_center) if (image->overlay && draw_center)
theme_pixbuf_render (image->overlay, theme_pixbuf_render (image->overlay,
window, NULL, area, COMPONENT_ALL, window, area, COMPONENT_ALL,
TRUE, TRUE,
x, y, width, height); x, y, width, height);
@ -300,19 +300,19 @@ draw_gap_image(GtkStyle *style,
if (image->background) if (image->background)
theme_pixbuf_render (image->background, theme_pixbuf_render (image->background,
window, NULL, area, components, FALSE, window, area, components, FALSE,
x, y, width, height); x, y, width, height);
if (image->gap_start) if (image->gap_start)
theme_pixbuf_render (image->gap_start, theme_pixbuf_render (image->gap_start,
window, NULL, area, COMPONENT_ALL, FALSE, window, area, COMPONENT_ALL, FALSE,
r1.x, r1.y, r1.width, r1.height); r1.x, r1.y, r1.width, r1.height);
if (image->gap) if (image->gap)
theme_pixbuf_render (image->gap, theme_pixbuf_render (image->gap,
window, NULL, area, COMPONENT_ALL, FALSE, window, area, COMPONENT_ALL, FALSE,
r2.x, r2.y, r2.width, r2.height); r2.x, r2.y, r2.width, r2.height);
if (image->gap_end) if (image->gap_end)
theme_pixbuf_render (image->gap_end, theme_pixbuf_render (image->gap_end,
window, NULL, area, COMPONENT_ALL, FALSE, window, area, COMPONENT_ALL, FALSE,
r3.x, r3.y, r3.width, r3.height); r3.x, r3.y, r3.width, r3.height);
return TRUE; return TRUE;
@ -349,7 +349,7 @@ draw_hline (GtkStyle *style,
{ {
if (image->background) if (image->background)
theme_pixbuf_render (image->background, theme_pixbuf_render (image->background,
window, NULL, area, COMPONENT_ALL, FALSE, window, area, COMPONENT_ALL, FALSE,
x1, y, (x2 - x1) + 1, 2); x1, y, (x2 - x1) + 1, 2);
} }
else else
@ -385,7 +385,7 @@ draw_vline (GtkStyle *style,
{ {
if (image->background) if (image->background)
theme_pixbuf_render (image->background, theme_pixbuf_render (image->background,
window, NULL, area, COMPONENT_ALL, FALSE, window, area, COMPONENT_ALL, FALSE,
x, y1, 2, (y2 - y1) + 1); x, y1, 2, (y2 - y1) + 1);
} }
else else

View File

@ -353,7 +353,6 @@ static void
pixbuf_render (GdkPixbuf *src, pixbuf_render (GdkPixbuf *src,
guint hints, guint hints,
GdkWindow *window, GdkWindow *window,
GdkBitmap *mask,
GdkRectangle *clip_rect, GdkRectangle *clip_rect,
gint src_x, gint src_x,
gint src_y, gint src_y,
@ -382,12 +381,7 @@ pixbuf_render (GdkPixbuf *src,
if (hints & THEME_MISSING) if (hints & THEME_MISSING)
return; return;
/* FIXME: Because we use the mask to shape windows, we don't use if (clip_rect)
* clip_rect to clip what we draw to the mask, only to clip
* what we actually draw. But this leads to the horrible ineffiency
* of scale the whole image to get a little bit of it.
*/
if (!mask && clip_rect)
{ {
if (!gdk_rectangle_intersect (clip_rect, &rect, &rect)) if (!gdk_rectangle_intersect (clip_rect, &rect, &rect))
return; return;
@ -479,19 +473,6 @@ pixbuf_render (GdkPixbuf *src,
{ {
cairo_t *cr; cairo_t *cr;
if (mask)
{
cr = gdk_cairo_create (mask);
gdk_cairo_set_source_pixbuf (cr, tmp_pixbuf,
-x_offset + rect.x,
-y_offset + rect.y);
gdk_cairo_rectangle (cr, &rect);
cairo_fill (cr);
cairo_destroy (cr);
}
cr = gdk_cairo_create (window); cr = gdk_cairo_create (window);
gdk_cairo_set_source_pixbuf (cr, gdk_cairo_set_source_pixbuf (cr,
tmp_pixbuf, tmp_pixbuf,
@ -748,7 +729,6 @@ theme_pixbuf_get_pixbuf (ThemePixbuf *theme_pb)
void void
theme_pixbuf_render (ThemePixbuf *theme_pb, theme_pixbuf_render (ThemePixbuf *theme_pb,
GdkWindow *window, GdkWindow *window,
GdkBitmap *mask,
GdkRectangle *clip_rect, GdkRectangle *clip_rect,
guint component_mask, guint component_mask,
gboolean center, gboolean center,
@ -804,11 +784,11 @@ theme_pixbuf_render (ThemePixbuf *theme_pb,
#define RENDER_COMPONENT(X1,X2,Y1,Y2) \ #define RENDER_COMPONENT(X1,X2,Y1,Y2) \
pixbuf_render (pixbuf, theme_pb->hints[Y1][X1], window, mask, clip_rect, \ pixbuf_render (pixbuf, theme_pb->hints[Y1][X1], window, clip_rect, \
src_x[X1], src_y[Y1], \ src_x[X1], src_y[Y1], \
src_x[X2] - src_x[X1], src_y[Y2] - src_y[Y1], \ src_x[X2] - src_x[X1], src_y[Y2] - src_y[Y1], \
dest_x[X1], dest_y[Y1], \ dest_x[X1], dest_y[Y1], \
dest_x[X2] - dest_x[X1], dest_y[Y2] - dest_y[Y1]); dest_x[X2] - dest_x[X1], dest_y[Y2] - dest_y[Y1]);
if (component_mask & COMPONENT_NORTH_WEST) if (component_mask & COMPONENT_NORTH_WEST)
@ -845,7 +825,7 @@ theme_pixbuf_render (ThemePixbuf *theme_pb,
x += (width - pixbuf_width) / 2; x += (width - pixbuf_width) / 2;
y += (height - pixbuf_height) / 2; y += (height - pixbuf_height) / 2;
pixbuf_render (pixbuf, 0, window, NULL, clip_rect, pixbuf_render (pixbuf, 0, window, clip_rect,
0, 0, 0, 0,
pixbuf_width, pixbuf_height, pixbuf_width, pixbuf_height,
x, y, x, y,

View File

@ -202,7 +202,6 @@ G_GNUC_INTERNAL void theme_pixbuf_set_stretch (ThemePixbuf *theme_pb,
gboolean stretch); gboolean stretch);
G_GNUC_INTERNAL void theme_pixbuf_render (ThemePixbuf *theme_pb, G_GNUC_INTERNAL void theme_pixbuf_render (ThemePixbuf *theme_pb,
GdkWindow *window, GdkWindow *window,
GdkBitmap *mask,
GdkRectangle *clip_rect, GdkRectangle *clip_rect,
guint component_mask, guint component_mask,
gboolean center, gboolean center,