Index: uspace/lib/guigfx/private/canvas.h
===================================================================
--- uspace/lib/guigfx/private/canvas.h	(revision cea9f0cdb1a2d2752bc931602d11342eb862c44e)
+++ uspace/lib/guigfx/private/canvas.h	(revision f8375f741d0ccd376851c593af6a16c2591aa927)
@@ -48,4 +48,6 @@
 /** Actual structure of canvas GC. */
 struct canvas_gc {
+	/** Memory GC */
+	mem_gc_t *mgc;
 	/** Base graphic context */
 	gfx_context_t *gc;
@@ -54,17 +56,5 @@
 	/** Surface */
 	surface_t *surface;
-	/** Memory GC */
-	mem_gc_t *mgc;
-	/** Base GC for memory GC */
-	gfx_context_t *mbgc;
 };
-
-/** Bitmap in canvas GC */
-typedef struct {
-	/** Containing canvas GC */
-	struct canvas_gc *cgc;
-	/** Memory GC bitmap */
-	gfx_bitmap_t *mbitmap;
-} canvas_gc_bitmap_t;
 
 #endif
Index: uspace/lib/guigfx/src/canvas.c
===================================================================
--- uspace/lib/guigfx/src/canvas.c	(revision cea9f0cdb1a2d2752bc931602d11342eb862c44e)
+++ uspace/lib/guigfx/src/canvas.c	(revision f8375f741d0ccd376851c593af6a16c2591aa927)
@@ -49,55 +49,5 @@
 //#include "../../private/color.h"
 
-static errno_t canvas_gc_set_color(void *, gfx_color_t *);
-static errno_t canvas_gc_fill_rect(void *, gfx_rect_t *);
-static errno_t canvas_gc_bitmap_create(void *, gfx_bitmap_params_t *,
-    gfx_bitmap_alloc_t *, void **);
-static errno_t canvas_gc_bitmap_destroy(void *);
-static errno_t canvas_gc_bitmap_render(void *, gfx_rect_t *, gfx_coord2_t *);
-static errno_t canvas_gc_bitmap_get_alloc(void *, gfx_bitmap_alloc_t *);
-
-gfx_context_ops_t canvas_gc_ops = {
-	.set_color = canvas_gc_set_color,
-	.fill_rect = canvas_gc_fill_rect,
-	.bitmap_create = canvas_gc_bitmap_create,
-	.bitmap_destroy = canvas_gc_bitmap_destroy,
-	.bitmap_render = canvas_gc_bitmap_render,
-	.bitmap_get_alloc = canvas_gc_bitmap_get_alloc
-};
-
-/** Set color on canvas GC.
- *
- * Set drawing color on canvas GC.
- *
- * @param arg Canvas GC
- * @param color Color
- *
- * @return EOK on success or an error code
- */
-static errno_t canvas_gc_set_color(void *arg, gfx_color_t *color)
-{
-	canvas_gc_t *cgc = (canvas_gc_t *) arg;
-
-	return gfx_set_color(cgc->mbgc, color);
-}
-
-/** Fill rectangle on canvas GC.
- *
- * @param arg Canvas GC
- * @param rect Rectangle
- *
- * @return EOK on success or an error code
- */
-static errno_t canvas_gc_fill_rect(void *arg, gfx_rect_t *rect)
-{
-	canvas_gc_t *cgc = (canvas_gc_t *) arg;
-	errno_t rc;
-
-	rc = gfx_fill_rect(cgc->mbgc, rect);
-	if (rc == EOK)
-		update_canvas(cgc->canvas, cgc->surface);
-
-	return rc;
-}
+static void canvas_gc_update_cb(void *, gfx_rect_t *);
 
 /** Create canvas GC.
@@ -115,5 +65,4 @@
 {
 	canvas_gc_t *cgc = NULL;
-	gfx_context_t *gc = NULL;
 	surface_coord_t w, h;
 	gfx_rect_t rect;
@@ -129,8 +78,4 @@
 	}
 
-	rc = gfx_context_new(&canvas_gc_ops, cgc, &gc);
-	if (rc != EOK)
-		goto error;
-
 	rect.p0.x = 0;
 	rect.p0.y = 0;
@@ -142,11 +87,11 @@
 	alloc.pixels = surface_direct_access(surface);
 
-	rc = mem_gc_create(&rect, &alloc, &cgc->mgc);
+	rc = mem_gc_create(&rect, &alloc, canvas_gc_update_cb,
+	    (void *)cgc, &cgc->mgc);
 	if (rc != EOK)
 		goto error;
 
-	cgc->mbgc = mem_gc_get_ctx(cgc->mgc);
+	cgc->gc = mem_gc_get_ctx(cgc->mgc);
 
-	cgc->gc = gc;
 	cgc->canvas = canvas;
 	cgc->surface = surface;
@@ -154,6 +99,4 @@
 	return EOK;
 error:
-	if (gc != NULL)
-		gfx_context_delete(gc);
 	if (cgc != NULL)
 		free(cgc);
@@ -189,85 +132,14 @@
 }
 
-/** Create bitmap in canvas GC.
+/** Canvas GC update callback called by memory GC.
  *
  * @param arg Canvas GC
- * @param params Bitmap params
- * @param alloc Bitmap allocation info or @c NULL
- * @param rbm Place to store pointer to new bitmap
- * @return EOK on success or an error code
+ * @param rect Rectangle to update
  */
-errno_t canvas_gc_bitmap_create(void *arg, gfx_bitmap_params_t *params,
-    gfx_bitmap_alloc_t *alloc, void **rbm)
+static void canvas_gc_update_cb(void *arg, gfx_rect_t *rect)
 {
-	canvas_gc_t *cgc = (canvas_gc_t *) arg;
-	canvas_gc_bitmap_t *cbm = NULL;
-	errno_t rc;
+	canvas_gc_t *cgc = (canvas_gc_t *)arg;
 
-	cbm = calloc(1, sizeof(canvas_gc_bitmap_t));
-	if (cbm == NULL)
-		return ENOMEM;
-
-	rc = gfx_bitmap_create(cgc->mbgc, params, alloc, &cbm->mbitmap);
-	if (rc != EOK)
-		goto error;
-
-	cbm->cgc = cgc;
-	*rbm = (void *)cbm;
-	return EOK;
-error:
-	if (cbm != NULL)
-		free(cbm);
-	return rc;
-}
-
-/** Destroy bitmap in canvas GC.
- *
- * @param bm Bitmap
- * @return EOK on success or an error code
- */
-static errno_t canvas_gc_bitmap_destroy(void *bm)
-{
-	canvas_gc_bitmap_t *cbm = (canvas_gc_bitmap_t *)bm;
-	errno_t rc;
-
-	rc = gfx_bitmap_destroy(cbm->mbitmap);
-	if (rc != EOK)
-		return rc;
-
-	free(cbm);
-	return EOK;
-}
-
-/** Render bitmap in canvas GC.
- *
- * @param bm Bitmap
- * @param srect0 Source rectangle or @c NULL
- * @param offs0 Offset or @c NULL
- * @return EOK on success or an error code
- */
-static errno_t canvas_gc_bitmap_render(void *bm, gfx_rect_t *srect0,
-    gfx_coord2_t *offs0)
-{
-	canvas_gc_bitmap_t *cbm = (canvas_gc_bitmap_t *)bm;
-	errno_t rc;
-
-	rc = gfx_bitmap_render(cbm->mbitmap, srect0, offs0);
-	if (rc == EOK)
-		update_canvas(cbm->cgc->canvas, cbm->cgc->surface);
-
-	return rc;
-}
-
-/** Get allocation info for bitmap in canvas GC.
- *
- * @param bm Bitmap
- * @param alloc Place to store allocation info
- * @return EOK on success or an error code
- */
-static errno_t canvas_gc_bitmap_get_alloc(void *bm, gfx_bitmap_alloc_t *alloc)
-{
-	canvas_gc_bitmap_t *cbm = (canvas_gc_bitmap_t *)bm;
-
-	return gfx_bitmap_get_alloc(cbm->mbitmap, alloc);
+	update_canvas(cgc->canvas, cgc->surface);
 }
 
