Index: uspace/lib/memgfx/include/memgfx/memgc.h
===================================================================
--- uspace/lib/memgfx/include/memgfx/memgc.h	(revision f8375f741d0ccd376851c593af6a16c2591aa927)
+++ uspace/lib/memgfx/include/memgfx/memgc.h	(revision d70e7b7bcaa004700e0af401f3e5b48e47f018c1)
@@ -48,4 +48,5 @@
     mem_gc_update_cb_t, void *, mem_gc_t **);
 extern errno_t mem_gc_delete(mem_gc_t *);
+extern void mem_gc_retarget(mem_gc_t *, gfx_rect_t *, gfx_bitmap_alloc_t *);
 extern gfx_context_t *mem_gc_get_ctx(mem_gc_t *);
 
Index: uspace/lib/memgfx/src/memgc.c
===================================================================
--- uspace/lib/memgfx/src/memgc.c	(revision f8375f741d0ccd376851c593af6a16c2591aa927)
+++ uspace/lib/memgfx/src/memgc.c	(revision d70e7b7bcaa004700e0af401f3e5b48e47f018c1)
@@ -95,5 +95,4 @@
 	mem_gc_t *mgc = (mem_gc_t *) arg;
 	gfx_rect_t crect;
-	gfx_coord2_t dims;
 	gfx_coord_t x, y;
 	pixelmap_t pixelmap;
@@ -102,7 +101,9 @@
 	gfx_rect_clip(rect, &mgc->rect, &crect);
 
-	gfx_rect_dims(&mgc->rect, &dims);
-	pixelmap.width = dims.x;
-	pixelmap.height = dims.y;
+	assert(mgc->rect.p0.x == 0);
+	assert(mgc->rect.p0.y == 0);
+	assert(mgc->alloc.pitch == mgc->rect.p1.x * (int)sizeof(uint32_t));
+	pixelmap.width = mgc->rect.p1.x;
+	pixelmap.height = mgc->rect.p1.y;
 	pixelmap.data = mgc->alloc.pixels;
 
@@ -150,15 +151,4 @@
 	mgc->alloc = *alloc;
 
-	/*
-	 * These are the limitations of pixelmap which we are using.
-	 * Rather than falling back to an ad-hoc method of pixel access
-	 * (which is not searchable), use pixelmap for now and switch
-	 * to a better, more universal method later (e.g. supporting
-	 * different color depths).
-	 */
-	assert(rect->p0.x == 0);
-	assert(rect->p0.y == 0);
-	assert(alloc->pitch == rect->p1.x * (int)sizeof(uint32_t));
-
 	mgc->update = update_cb;
 	mgc->cb_arg = cb_arg;
@@ -187,4 +177,17 @@
 	free(mgc);
 	return EOK;
+}
+
+/** Retarget memory GC to a different block of memory.
+ *
+ * @param mgc Memory GC
+ * @param rect New bounding rectangle
+ * @param alloc Allocation info of the new block
+ */
+void mem_gc_retarget(mem_gc_t *mgc, gfx_rect_t *rect,
+    gfx_bitmap_alloc_t *alloc)
+{
+	mgc->rect = *rect;
+	mgc->alloc = *alloc;
 }
 
@@ -283,6 +286,4 @@
 	gfx_coord2_t dim;
 	gfx_coord_t x, y;
-	gfx_coord2_t sdims;
-	gfx_coord2_t ddims;
 	pixelmap_t smap;
 	pixelmap_t dmap;
@@ -306,12 +307,16 @@
 	gfx_coord2_subtract(&drect.p1, &drect.p0, &dim);
 
-	gfx_rect_dims(&mbm->rect, &sdims);
-	smap.width = sdims.x;
-	smap.height = sdims.y;
+	assert(mbm->rect.p0.x == 0);
+	assert(mbm->rect.p0.y == 0);
+	assert(mbm->alloc.pitch == mbm->rect.p1.x * (int)sizeof(uint32_t));
+	smap.width = mbm->rect.p1.x;
+	smap.height = mbm->rect.p1.y;
 	smap.data = mbm->alloc.pixels;
 
-	gfx_rect_dims(&mbm->mgc->rect, &ddims);
-	dmap.width = ddims.x;
-	dmap.height = ddims.y;
+	assert(mbm->mgc->rect.p0.x == 0);
+	assert(mbm->mgc->rect.p0.y == 0);
+	assert(mbm->mgc->alloc.pitch == mbm->mgc->rect.p1.x * (int)sizeof(uint32_t));
+	dmap.width = mbm->mgc->rect.p1.x;
+	dmap.height = mbm->mgc->rect.p1.y;
 	dmap.data = mbm->mgc->alloc.pixels;
 
