summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-10-13 23:23:48 -0700
committerBenjamin Otte <otte@redhat.com>2011-10-15 00:06:22 -0700
commit8f648b68986918ab57de202a3b0d0df430461ef9 (patch)
tree1ffe2e81736e1568624ef1f3794f1221462b623d
parent8ad98d256e72b91ddfaa581454390572067c30c4 (diff)
graphic: Remove game_graphic_draw_area_no_cache()
Caches are gone, so there's no need for this function.
-rw-r--r--libgame/game-graphic.c40
-rw-r--r--libgame/game-graphic.h3
2 files changed, 16 insertions, 27 deletions
diff --git a/libgame/game-graphic.c b/libgame/game-graphic.c
index eb2e056..c68525d 100644
--- a/libgame/game-graphic.c
+++ b/libgame/game-graphic.c
@@ -222,29 +222,6 @@ game_graphic_invalidate_cache (GameGraphic *graphic)
}
gboolean
-game_graphic_draw_area_no_cache (GameGraphic *graphic, cairo_t *cr,
- const GameRectangle *rect)
-{
- GameGraphicClass *klass;
-
- cairo_save (cr);
-
- game_rectangle_path (cr, &graphic->rect);
- cairo_clip (cr);
-
- klass = GAME_GRAPHIC_GET_CLASS (graphic);
- g_return_val_if_fail (klass->draw, FALSE);
- klass->draw (graphic, cr, rect);
- if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
- gchar *s = game_object_to_string (GAME_OBJECT (graphic));
- g_printerr ("Error drawing to %s: %s\n", s, cairo_status_to_string (cairo_status (cr)));
- g_free (s);
- }
- cairo_restore (cr);
- return cairo_status (cr) == CAIRO_STATUS_SUCCESS;
-}
-
-gboolean
game_graphic_draw (GameGraphic *graphic, cairo_t *cr)
{
g_return_val_if_fail (GAME_IS_GRAPHIC (graphic), FALSE);
@@ -257,6 +234,7 @@ gboolean
game_graphic_draw_area (GameGraphic *graphic, cairo_t *cr, const
GameRectangle *rect)
{
+ GameGraphicClass *klass;
GameRectangle inval;
g_return_val_if_fail (GAME_IS_GRAPHIC (graphic), FALSE);
@@ -266,7 +244,21 @@ game_graphic_draw_area (GameGraphic *graphic, cairo_t *cr, const
if (!game_rectangle_intersect (&inval, &graphic->rect, rect))
return TRUE;
- return game_graphic_draw_area_no_cache (graphic, cr, rect);
+ cairo_save (cr);
+
+ game_rectangle_path (cr, &graphic->rect);
+ cairo_clip (cr);
+
+ klass = GAME_GRAPHIC_GET_CLASS (graphic);
+ g_return_val_if_fail (klass->draw, FALSE);
+ klass->draw (graphic, cr, rect);
+ if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
+ gchar *s = game_object_to_string (GAME_OBJECT (graphic));
+ g_printerr ("Error drawing to %s: %s\n", s, cairo_status_to_string (cairo_status (cr)));
+ g_free (s);
+ }
+ cairo_restore (cr);
+ return cairo_status (cr) == CAIRO_STATUS_SUCCESS;
}
gboolean
diff --git a/libgame/game-graphic.h b/libgame/game-graphic.h
index 72babc6..cbbb57f 100644
--- a/libgame/game-graphic.h
+++ b/libgame/game-graphic.h
@@ -73,9 +73,6 @@ gboolean game_graphic_draw (GameGraphic * graphic,
gboolean game_graphic_draw_area (GameGraphic * graphic,
cairo_t * cr,
const GameRectangle * rectangle);
-gboolean game_graphic_draw_area_no_cache (GameGraphic * graphic,
- cairo_t * cr,
- const GameRectangle * rect);
/* FIXME: find a header/file for this */
gboolean game_cairo_pattern_matches (cairo_t * cr,